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

Add a focusable over-ride setting for widgets that are non-focusable by

default

For widgets that are non-focusable by default, you can now specify

    focusable: true

in their config to over-ride the default 'false' value.
This commit is contained in:
Chris Cummer
2019-08-31 10:00:00 -07:00
parent 248fddf3f4
commit d6208b4730
3 changed files with 7 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ type Common struct {
Bordered bool `help:"Whether or not the module should be displayed with a border." values:"true, false" optional:"true" default:"true"`
Enabled bool `help:"Whether or not this module is executed and if its data displayed onscreen." values:"true, false" optional:"true" default:"false"`
Focusable bool `help:"Whether or not this module is focusable." values:"true, false" optional:"true" default:"false"`
RefreshInterval int `help:"How often, in seconds, this module will update its data." values:"A positive integer, 0..n." optional:"true"`
Title string `help:"The title string to show when displaying this module" optional:"true"`
Config *config.Config
@@ -83,6 +84,7 @@ func NewCommonSettingsFromModule(name, defaultTitle string, moduleConfig *config
Bordered: moduleConfig.UBool("border", true),
Enabled: moduleConfig.UBool("enabled", false),
Focusable: moduleConfig.UBool("focusable", false),
RefreshInterval: moduleConfig.UInt("refreshInterval", 300),
Title: moduleConfig.UString("title", defaultTitle),
Config: moduleConfig,