v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-28 05:20:12 -07:00

fix(ui): wrong button color

After update tview (49200f8), the background color of button get wrong.
The SetBackgroundColor doesn't work. Use SetStyle and SetActivatedStyle
instead.
This commit is contained in:
eeeXun 2023-06-18 23:43:31 +08:00
parent 6555252e70
commit 993a8286a3

11
ui.go
View File

@ -155,10 +155,13 @@ func updateNonConfigColor() {
// button
for _, button := range []*tview.Button{langButton, styleButton, keyMapButton} {
button.SetLabelColor(uiStyle.ForegroundColor()).
SetBackgroundColorActivated(uiStyle.PressColor()).
SetLabelColorActivated(uiStyle.ForegroundColor()).
SetBackgroundColor(uiStyle.SelectedColor())
button.SetStyle(tcell.StyleDefault.
Background(uiStyle.SelectedColor()).
Foreground(uiStyle.ForegroundColor())).
SetActivatedStyle(
tcell.StyleDefault.
Background(uiStyle.PressColor()).
Foreground(uiStyle.ForegroundColor()))
}
// key map