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:
@@ -5,7 +5,10 @@ import (
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
)
|
||||
|
||||
const defaultTitle = "ResourceUsage"
|
||||
const (
|
||||
defaultFocusable = false
|
||||
defaultTitle = "ResourceUsage"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
@@ -13,7 +16,7 @@ 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),
|
||||
}
|
||||
|
||||
return &settings
|
||||
|
||||
@@ -12,8 +12,10 @@ import (
|
||||
"github.com/wtfutil/wtf/view"
|
||||
)
|
||||
|
||||
var started = false
|
||||
var ok = true
|
||||
var (
|
||||
ok = true
|
||||
started = false
|
||||
)
|
||||
|
||||
// Widget define wtf widget to register widget later
|
||||
type Widget struct {
|
||||
@@ -26,7 +28,7 @@ type Widget struct {
|
||||
// NewWidget Make new instance of widget
|
||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
BarGraph: view.NewBarGraph(app, settings.common.Name, settings.common, false),
|
||||
BarGraph: view.NewBarGraph(app, settings.common.Name, settings.common),
|
||||
|
||||
app: app,
|
||||
settings: settings,
|
||||
|
||||
Reference in New Issue
Block a user