1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-16 06:25:23 +00:00

Merge pull request #38 from BreadMakesYouFat/nologo

Optionally hide splash and banner?
This commit is contained in:
mrusme 2023-06-25 14:56:07 -05:00 committed by GitHub
commit 3b0adfc6f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -45,6 +45,8 @@ type Config struct {
Browser string Browser string
RenderShadows bool RenderShadows bool
RenderImages bool RenderImages bool
RenderSplash bool
RenderBanner bool
Systems []SystemConfig Systems []SystemConfig
@ -192,6 +194,8 @@ func SetDefaults(cacheDir string) {
viper.SetDefault("RenderShadows", "true") viper.SetDefault("RenderShadows", "true")
viper.SetDefault("RenderImages", "true") viper.SetDefault("RenderImages", "true")
viper.SetDefault("RenderSplash", "true")
viper.SetDefault("RenderBanner", "true")
// --- Header --- // --- Header ---
// Header Selector // Header Selector

View File

@ -111,6 +111,10 @@ func (m Model) View() string {
spinner = m.spinner.View() spinner = m.spinner.View()
} }
if !m.ctx.Config.RenderBanner{
banner = ""
}
row = lipgloss.JoinHorizontal(lipgloss.Bottom, row = lipgloss.JoinHorizontal(lipgloss.Bottom,
banner, banner,
" ", " ",

View File

@ -33,6 +33,9 @@ func NewModel(c *ctx.Ctx) Model {
ctx: c, ctx: c,
pix: nil, pix: nil,
} }
if !m.ctx.Config.RenderSplash {
return m
}
m.splashscreen, err = m.ctx.EmbedFS.ReadFile("splashscreen.png") m.splashscreen, err = m.ctx.EmbedFS.ReadFile("splashscreen.png")
if err != nil { if err != nil {
@ -74,7 +77,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m *Model) sleep() tea.Cmd { func (m *Model) sleep() tea.Cmd {
return func() tea.Msg { return func() tea.Msg {
time.Sleep(time.Second * 5) if m.ctx.Config.RenderSplash {
time.Sleep(time.Second * 5)
}
c := cmd.New( c := cmd.New(
cmd.ViewOpen, cmd.ViewOpen,