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:
parent
d6b500e346
commit
1b00c032bc
2
wtf.go
2
wtf.go
@ -172,6 +172,8 @@ func addWidget(app *tview.Application, pages *tview.Pages, widgetName string) {
|
||||
switch widgetName {
|
||||
case "bamboohr":
|
||||
Widgets = append(Widgets, bamboohr.NewWidget())
|
||||
case "bargraph":
|
||||
Widgets = append(Widgets, bargraph.NewWidget())
|
||||
case "bittrex":
|
||||
Widgets = append(Widgets, bittrex.NewWidget())
|
||||
case "clocks":
|
||||
|
@ -54,6 +54,10 @@ func (widget *BarGraph) BorderColor() string {
|
||||
return Config.UString("wtf.colors.border.normal", "gray")
|
||||
}
|
||||
|
||||
func (widget *BarGraph) Disable() {
|
||||
widget.enabled = false
|
||||
}
|
||||
|
||||
func (widget *BarGraph) Disabled() bool {
|
||||
return !widget.Enabled()
|
||||
}
|
||||
|
@ -53,6 +53,10 @@ func (widget *TextWidget) BorderColor() string {
|
||||
return Config.UString("wtf.colors.border.normal", "gray")
|
||||
}
|
||||
|
||||
func (widget *TextWidget) Disable() {
|
||||
widget.enabled = false
|
||||
}
|
||||
|
||||
func (widget *TextWidget) Disabled() bool {
|
||||
return !widget.Enabled()
|
||||
}
|
||||
@ -61,10 +65,6 @@ func (widget *TextWidget) Enabled() bool {
|
||||
return widget.enabled
|
||||
}
|
||||
|
||||
func (widget *TextWidget) Disable() {
|
||||
widget.enabled = false
|
||||
}
|
||||
|
||||
func (widget *TextWidget) Focusable() bool {
|
||||
return widget.enabled && widget.focusable
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user