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

Make Bargraph widget work with new module lazy-loading

This commit is contained in:
Chris Cummer 2018-06-08 15:34:31 -07:00
parent 59cd1d23bf
commit 23f53a06b9
3 changed files with 11 additions and 5 deletions

2
wtf.go
View File

@ -169,6 +169,8 @@ func addWidget(app *tview.Application, pages *tview.Pages, widgetName string) {
switch widgetName { switch widgetName {
case "bamboohr": case "bamboohr":
Widgets = append(Widgets, bamboohr.NewWidget()) Widgets = append(Widgets, bamboohr.NewWidget())
case "bargraph":
Widgets = append(Widgets, bargraph.NewWidget())
case "bittrex": case "bittrex":
Widgets = append(Widgets, bittrex.NewWidget()) Widgets = append(Widgets, bittrex.NewWidget())
case "clocks": case "clocks":

View File

@ -54,6 +54,10 @@ func (widget *BarGraph) BorderColor() string {
return Config.UString("wtf.colors.border.normal", "gray") return Config.UString("wtf.colors.border.normal", "gray")
} }
func (widget *BarGraph) Disable() {
widget.enabled = false
}
func (widget *BarGraph) Disabled() bool { func (widget *BarGraph) Disabled() bool {
return !widget.Enabled() return !widget.Enabled()
} }

View File

@ -53,6 +53,10 @@ func (widget *TextWidget) BorderColor() string {
return Config.UString("wtf.colors.border.normal", "gray") return Config.UString("wtf.colors.border.normal", "gray")
} }
func (widget *TextWidget) Disable() {
widget.enabled = false
}
func (widget *TextWidget) Disabled() bool { func (widget *TextWidget) Disabled() bool {
return !widget.Enabled() return !widget.Enabled()
} }
@ -61,10 +65,6 @@ func (widget *TextWidget) Enabled() bool {
return widget.enabled return widget.enabled
} }
func (widget *TextWidget) Disable() {
widget.enabled = false
}
func (widget *TextWidget) Focusable() bool { func (widget *TextWidget) Focusable() bool {
return widget.enabled && widget.focusable return widget.enabled && widget.focusable
} }