Initialize a new view after assigning styles

This commit is contained in:
ayntgl 2022-10-23 13:10:06 +05:30 • committed by GitHub
parent 47579463cd
commit 22a95683d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,12 +56,13 @@ func NewApplication(cfg *config.Config) *Application {
app.EnableMouse(app.config.Mouse)
app.SetBeforeDrawFunc(app.onBeforeDraw)
app.view = newView(app)
// The styles must be assigned before initializing a new view.
tview.Styles.PrimitiveBackgroundColor = tcell.GetColor(cfg.Theme.Background)
tview.Styles.BorderColor = tcell.GetColor(cfg.Theme.Border)
tview.Styles.TitleColor = tcell.GetColor(cfg.Theme.Title)
app.view = newView(app)
return app
}