From 22a95683d2508bcf9090e749bd72bb97ebc9d634 Mon Sep 17 00:00:00 2001 From: ayntgl <90600421+ayntgl@users.noreply.github.com> Date: Sun, 23 Oct 2022 13:10:06 +0530 Subject: [PATCH] Initialize a new view after assigning styles --- ui/application.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/application.go b/ui/application.go index 72b7870..6d80064 100644 --- a/ui/application.go +++ b/ui/application.go @@ -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 }