mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Merge pull request #38 from BreadMakesYouFat/nologo
Optionally hide splash and banner?
This commit is contained in:
commit
3b0adfc6f0
@ -45,6 +45,8 @@ type Config struct {
|
||||
Browser string
|
||||
RenderShadows bool
|
||||
RenderImages bool
|
||||
RenderSplash bool
|
||||
RenderBanner bool
|
||||
|
||||
Systems []SystemConfig
|
||||
|
||||
@ -192,6 +194,8 @@ func SetDefaults(cacheDir string) {
|
||||
|
||||
viper.SetDefault("RenderShadows", "true")
|
||||
viper.SetDefault("RenderImages", "true")
|
||||
viper.SetDefault("RenderSplash", "true")
|
||||
viper.SetDefault("RenderBanner", "true")
|
||||
|
||||
// --- Header ---
|
||||
// Header Selector
|
||||
|
@ -111,6 +111,10 @@ func (m Model) View() string {
|
||||
spinner = m.spinner.View()
|
||||
}
|
||||
|
||||
if !m.ctx.Config.RenderBanner{
|
||||
banner = ""
|
||||
}
|
||||
|
||||
row = lipgloss.JoinHorizontal(lipgloss.Bottom,
|
||||
banner,
|
||||
" ",
|
||||
|
@ -33,6 +33,9 @@ func NewModel(c *ctx.Ctx) Model {
|
||||
ctx: c,
|
||||
pix: nil,
|
||||
}
|
||||
if !m.ctx.Config.RenderSplash {
|
||||
return m
|
||||
}
|
||||
|
||||
m.splashscreen, err = m.ctx.EmbedFS.ReadFile("splashscreen.png")
|
||||
if err != nil {
|
||||
@ -74,7 +77,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
|
||||
func (m *Model) sleep() tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
time.Sleep(time.Second * 5)
|
||||
if m.ctx.Config.RenderSplash {
|
||||
time.Sleep(time.Second * 5)
|
||||
}
|
||||
|
||||
c := cmd.New(
|
||||
cmd.ViewOpen,
|
||||
|
Loading…
Reference in New Issue
Block a user