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:
@@ -6,7 +6,10 @@ import (
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
)
|
||||
|
||||
const defaultTitle = "Kubernetes"
|
||||
const (
|
||||
defaultFocusable = false
|
||||
defaultTitle = "Kubernetes"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
@@ -20,7 +23,7 @@ type Settings struct {
|
||||
func NewSettingsFromYAML(name string, moduleConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, moduleConfig, globalConfig),
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, moduleConfig, globalConfig),
|
||||
|
||||
objects: utils.ToStrs(moduleConfig.UList("objects")),
|
||||
title: moduleConfig.UString("title"),
|
||||
|
||||
@@ -24,7 +24,7 @@ type Widget struct {
|
||||
// NewWidget creates a new instance of the widget
|
||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
||||
TextWidget: view.NewTextWidget(app, settings.common),
|
||||
|
||||
objects: settings.objects,
|
||||
title: settings.title,
|
||||
|
||||
Reference in New Issue
Block a user