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:
@@ -12,7 +12,7 @@ const (
|
||||
|
||||
// Settings defines the configuration properties for this module
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
*cfg.Common
|
||||
|
||||
color string `help:"The color of the clock."`
|
||||
font string `help:"The font of the clock." values:"bigfont or digitalfont"`
|
||||
@@ -23,7 +23,7 @@ type Settings struct {
|
||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||
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),
|
||||
|
||||
color: ymlConfig.UString("color"),
|
||||
font: ymlConfig.UString("font"),
|
||||
|
||||
@@ -16,7 +16,7 @@ type Widget struct {
|
||||
// NewWidget creates a new widget using settings
|
||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(app, nil, settings.common),
|
||||
TextWidget: view.NewTextWidget(app, nil, settings.Common),
|
||||
|
||||
app: app,
|
||||
settings: settings,
|
||||
|
||||
Reference in New Issue
Block a user