mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-730 Fix missing color key config error (#738)
* WTF-730 Fix missing color key config error Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Add Subheading color formatting to modules Users can now set a `subheading` color in their config to change the color of subheadings in widget display. Defaults to `red`. Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix oustanding color issues Clean up missing color config changes not addressed in earlier commits. Signed-off-by: Chris Cummer <chriscummer@me.com> * Remove unused dependency Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Base cleanup Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix a few bugs related to color config changes Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix issues with PagerDuty subheading display Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix bug with Todo list colour rendering Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
@@ -20,7 +20,13 @@ func NewDisplay(widgets []wtf.Wtfable, config *config.Config) *Display {
|
||||
config: config,
|
||||
}
|
||||
|
||||
display.Grid.SetBackgroundColor(wtf.ColorFor(config.UString("wtf.colors.background", "transparent")))
|
||||
firstWidget := widgets[0]
|
||||
display.Grid.SetBackgroundColor(
|
||||
wtf.ColorFor(
|
||||
firstWidget.CommonSettings().Colors.WidgetTheme.Background,
|
||||
),
|
||||
)
|
||||
|
||||
display.build(widgets)
|
||||
|
||||
return &display
|
||||
|
||||
@@ -158,7 +158,11 @@ func (tracker *FocusTracker) blur(idx int) {
|
||||
view := widget.TextView()
|
||||
view.Blur()
|
||||
|
||||
view.SetBorderColor(wtf.ColorFor(widget.BorderColor()))
|
||||
view.SetBorderColor(
|
||||
wtf.ColorFor(
|
||||
widget.BorderColor(),
|
||||
),
|
||||
)
|
||||
|
||||
tracker.IsFocused = false
|
||||
}
|
||||
@@ -178,7 +182,11 @@ func (tracker *FocusTracker) focus(idx int) {
|
||||
}
|
||||
|
||||
view := widget.TextView()
|
||||
view.SetBorderColor(wtf.ColorFor(tracker.config.UString("wtf.colors.border.focused", "gray")))
|
||||
view.SetBorderColor(
|
||||
wtf.ColorFor(
|
||||
widget.CommonSettings().Colors.BorderTheme.Focused,
|
||||
),
|
||||
)
|
||||
tracker.App.SetFocus(view)
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ func NewWtfApp(app *tview.Application, config *config.Config, configFilePath str
|
||||
return false
|
||||
})
|
||||
|
||||
wtfApp.pages.Box.SetBackgroundColor(wtf.ColorFor(config.UString("wtf.colors.background", "transparent")))
|
||||
|
||||
wtfApp.app.SetInputCapture(wtfApp.keyboardIntercept)
|
||||
wtfApp.widgets = MakeWidgets(wtfApp.app, wtfApp.pages, wtfApp.config)
|
||||
wtfApp.display = NewDisplay(wtfApp.widgets, wtfApp.config)
|
||||
@@ -54,6 +52,13 @@ func NewWtfApp(app *tview.Application, config *config.Config, configFilePath str
|
||||
|
||||
wtfApp.validator.Validate(wtfApp.widgets)
|
||||
|
||||
firstWidget := wtfApp.widgets[0]
|
||||
wtfApp.pages.Box.SetBackgroundColor(
|
||||
wtf.ColorFor(
|
||||
firstWidget.CommonSettings().Colors.WidgetTheme.Background,
|
||||
),
|
||||
)
|
||||
|
||||
return &wtfApp
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user