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,7 +7,10 @@ import (
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
)
|
||||
|
||||
const defaultTitle = "VictorOps"
|
||||
const (
|
||||
defaultFocusable = true
|
||||
defaultTitle = "VictorOps"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
@@ -18,9 +21,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),
|
||||
|
||||
apiID: ymlConfig.UString("apiID", os.Getenv("WTF_VICTOROPS_API_ID")),
|
||||
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_VICTOROPS_API_KEY"))),
|
||||
|
||||
@@ -19,7 +19,7 @@ type Widget struct {
|
||||
// NewWidget creates a new widget
|
||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
||||
TextWidget: view.NewTextWidget(app, settings.common),
|
||||
}
|
||||
|
||||
widget.View.SetScrollable(true)
|
||||
|
||||
Reference in New Issue
Block a user