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

WTF-400 Move name and configKey values from widget to settings

This commit is contained in:
Chris Cummer
2019-04-17 17:16:26 -07:00
parent d174bd1497
commit b50c762dab
93 changed files with 351 additions and 237 deletions

View File

@@ -15,6 +15,11 @@ type Colors struct {
Text string
}
type Module struct {
ConfigKey string
Name string
}
type Position struct {
Height int
Left int
@@ -24,6 +29,7 @@ type Position struct {
type Common struct {
Colors
Module
Position
Enabled bool
@@ -31,7 +37,7 @@ type Common struct {
Title string
}
func NewCommonSettingsFromYAML(ymlConfig *config.Config) *Common {
func NewCommonSettingsFromYAML(name, configKey string, ymlConfig *config.Config) *Common {
common := Common{
Colors: Colors{
Background: ymlConfig.UString("wtf.colors.background", "black"),
@@ -43,6 +49,12 @@ func NewCommonSettingsFromYAML(ymlConfig *config.Config) *Common {
HighlightBack: ymlConfig.UString("wtf.colors.highlight.back"),
Text: ymlConfig.UString("wtf.colors.text", "white"),
},
Module: Module{
ConfigKey: configKey,
Name: name,
},
Position: Position{},
}