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

IPInfo styling (#744)

* WIP

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix the colour scheme for IPInfo to match other modules

Now uses standard label and text colours.

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer
2019-11-12 20:10:26 -08:00
committed by GitHub
parent 1fda7492e4
commit bf85d4b144
7 changed files with 6 additions and 15 deletions

View File

@@ -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
}

View File

@@ -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,