1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Simplify the inclusion of the Common config settings into each module

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer
2020-11-26 19:53:21 -08:00
parent f9a06540f1
commit d6a0797bf2
161 changed files with 378 additions and 330 deletions

View File

@@ -11,12 +11,12 @@ const (
)
type Settings struct {
common *cfg.Common
*cfg.Common
}
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
settings := Settings{
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
Common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
}
return &settings

View File

@@ -23,7 +23,7 @@ type Widget struct {
// NewWidget Make new instance of widget
func NewWidget(app *tview.Application, settings *Settings) *Widget {
widget := Widget{
BarGraph: view.NewBarGraph(app, "Sample Bar Graph", settings.common),
BarGraph: view.NewBarGraph(app, "Sample Bar Graph", settings.Common),
app: app,
}