Kaynağa Gözat

Initialize a new view after assigning styles

ayntgl 3 yıl önce
ebeveyn
işleme
22a95683d2
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      ui/application.go

+ 3 - 2
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
 }