diff --git a/cfg/common_settings.go b/cfg/common_settings.go index ed8aedf1..b6a6a729 100644 --- a/cfg/common_settings.go +++ b/cfg/common_settings.go @@ -69,6 +69,7 @@ func NewCommonSettingsFromModule(name, defaultTitle string, defaultFocusable boo baseColors.RowTheme.EvenForeground = moduleConfig.UString("colors.rows.even", colorsConfig.UString("rows.even", defaultColorTheme.RowTheme.EvenForeground)) baseColors.RowTheme.OddForeground = moduleConfig.UString("colors.rows.odd", colorsConfig.UString("rows.odd", defaultColorTheme.RowTheme.OddForeground)) + baseColors.TextTheme.Label = moduleConfig.UString("colors.label", colorsConfig.UString("label", defaultColorTheme.TextTheme.Label)) baseColors.TextTheme.Subheading = moduleConfig.UString("colors.subheading", colorsConfig.UString("subheading", defaultColorTheme.TextTheme.Subheading)) baseColors.TextTheme.Text = moduleConfig.UString("colors.text", colorsConfig.UString("text", defaultColorTheme.TextTheme.Text)) baseColors.TextTheme.Title = moduleConfig.UString("colors.title", colorsConfig.UString("title", defaultColorTheme.TextTheme.Title)) diff --git a/cfg/default_color_theme.go b/cfg/default_color_theme.go index 62771353..d670adbd 100644 --- a/cfg/default_color_theme.go +++ b/cfg/default_color_theme.go @@ -31,11 +31,13 @@ type RowTheme struct { // TextTheme defines the default color scheme for text rendering type TextTheme struct { + Label string Subheading string Text string Title string } +// WidgetTheme defines the default color scheme for the widget rect itself type WidgetTheme struct { Background string } @@ -74,6 +76,7 @@ func NewDefaultColorTheme() ColorTheme { }, TextTheme: TextTheme{ + Label: "lightblue", Subheading: "red", Text: "white", Title: "green", diff --git a/modules/ipaddresses/ipinfo/settings.go b/modules/ipaddresses/ipinfo/settings.go index 8f0e1a46..ff045d30 100644 --- a/modules/ipaddresses/ipinfo/settings.go +++ b/modules/ipaddresses/ipinfo/settings.go @@ -10,24 +10,14 @@ const ( defaultTitle = "IPInfo" ) -type colors struct { - name string - value string -} - type Settings struct { - colors common *cfg.Common } func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { - settings := Settings{ common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), } - settings.colors.name = ymlConfig.UString("colors.name", "red") - settings.colors.value = ymlConfig.UString("colors.value", "white") - return &settings } diff --git a/modules/ipaddresses/ipinfo/widget.go b/modules/ipaddresses/ipinfo/widget.go index cab9e8d3..71ddc9b5 100644 --- a/modules/ipaddresses/ipinfo/widget.go +++ b/modules/ipaddresses/ipinfo/widget.go @@ -87,8 +87,8 @@ func (widget *Widget) setResult(info *ipinfo) { resultBuffer := new(bytes.Buffer) resultTemplate.Execute(resultBuffer, map[string]string{ - "nameColor": widget.settings.colors.name, - "valueColor": widget.settings.colors.value, + "nameColor": widget.settings.common.Colors.Subheading, + "valueColor": widget.settings.common.Colors.Text, "Ip": info.Ip, "Hostname": info.Hostname, "City": info.City, diff --git a/modules/pagerduty/settings.go b/modules/pagerduty/settings.go index 86a4e8c3..e5959dec 100644 --- a/modules/pagerduty/settings.go +++ b/modules/pagerduty/settings.go @@ -23,7 +23,6 @@ type Settings struct { } func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { - settings := Settings{ common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), diff --git a/modules/todo/settings.go b/modules/todo/settings.go index 247acbdb..a50955fd 100644 --- a/modules/todo/settings.go +++ b/modules/todo/settings.go @@ -19,7 +19,6 @@ type Settings struct { } func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { - common := cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig) settings := Settings{ diff --git a/modules/todoist/settings.go b/modules/todoist/settings.go index 9028b28e..c32c4fa4 100644 --- a/modules/todoist/settings.go +++ b/modules/todoist/settings.go @@ -20,7 +20,6 @@ type Settings struct { } func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { - settings := Settings{ common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),