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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user