mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Constantize the defaultFocus value for each module
This commit is contained in:
@@ -7,6 +7,11 @@ import (
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultFocusable = true
|
||||
defaultTitle = "Gerrit"
|
||||
)
|
||||
|
||||
type colors struct {
|
||||
rows struct {
|
||||
even string `help:"Define the foreground color for even-numbered rows." values:"Any X11 color name." optional:"true"`
|
||||
@@ -14,8 +19,6 @@ type colors struct {
|
||||
}
|
||||
}
|
||||
|
||||
const defaultTitle = "Gerrit"
|
||||
|
||||
type Settings struct {
|
||||
colors
|
||||
common *cfg.Common
|
||||
@@ -28,9 +31,8 @@ type Settings struct {
|
||||
}
|
||||
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
domain: ymlConfig.UString("domain", ""),
|
||||
password: ymlConfig.UString("password", os.Getenv("WTF_GERRIT_PASSWORD")),
|
||||
|
||||
@@ -33,7 +33,7 @@ var (
|
||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
||||
TextWidget: view.NewTextWidget(app, settings.common),
|
||||
|
||||
Idx: 0,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user