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

labelColor

This commit is contained in:
eeeXun 2022-10-23 16:43:58 +08:00
parent b77ccc2e78
commit 98fbf5b91c
2 changed files with 28 additions and 4 deletions

View File

@ -40,6 +40,7 @@ type Colors struct {
textColor tcell.Color
selectedColor tcell.Color
prefixColor tcell.Color
labelColor tcell.Color
pressColor tcell.Color
}
@ -61,6 +62,7 @@ func (w *Window) colorInit() {
w.src.selectedColor = Themes[theme]["gray"]
w.src.prefixColor = Themes[theme]["cyan"]
w.src.pressColor = Themes[theme]["purple"]
w.src.labelColor = Themes[theme]["yellow"]
w.dst.foregroundColor = Themes[theme]["fg"]
w.dst.borderColor = Themes[theme]["blue"]
w.dst.prefixColor = Themes[theme]["cyan"]

30
ui.go
View File

@ -28,6 +28,20 @@ func updateBackground() {
tcell.StyleDefault.
Background(window.src.selectedColor).
Foreground(window.src.prefixColor))
themeDropDown.SetBackgroundColor(window.src.backgroundColor)
themeDropDown.SetListStyles(tcell.StyleDefault.
Background(window.src.backgroundColor).
Foreground(window.src.foregroundColor),
tcell.StyleDefault.
Background(window.src.selectedColor).
Foreground(window.src.prefixColor))
transparentDropDown.SetBackgroundColor(window.src.backgroundColor)
transparentDropDown.SetListStyles(tcell.StyleDefault.
Background(window.src.backgroundColor).
Foreground(window.src.foregroundColor),
tcell.StyleDefault.
Background(window.src.selectedColor).
Foreground(window.src.prefixColor))
}
// update title and option
@ -68,19 +82,27 @@ func uiInit() {
srcLangDropDown.SetOptions(Lang, nil)
srcLangDropDown.SetFieldBackgroundColor(window.src.selectedColor).
SetFieldTextColor(window.src.foregroundColor).
SetPrefixTextColor(window.dst.prefixColor)
SetPrefixTextColor(window.src.prefixColor)
srcLangDropDown.SetBorder(true).
SetBorderColor(window.src.borderColor).
SetTitleColor(window.src.borderColor)
dstLangDropDown.SetOptions(Lang, nil)
dstLangDropDown.SetFieldBackgroundColor(window.src.selectedColor).
SetFieldTextColor(window.src.foregroundColor).
SetPrefixTextColor(window.dst.prefixColor)
SetPrefixTextColor(window.src.prefixColor)
dstLangDropDown.SetBorder(true).
SetBorderColor(window.dst.borderColor).
SetTitleColor(window.dst.borderColor)
themeDropDown.SetOptions(themes_name, nil).SetLabel("Theme: ")
transparentDropDown.SetOptions([]string{"true", "false"}, nil).SetLabel("Transparent: ")
themeDropDown.SetOptions(themes_name, nil).
SetLabel("Theme: ").SetLabelColor(window.src.labelColor)
themeDropDown.SetFieldBackgroundColor(window.src.selectedColor).
SetFieldTextColor(window.src.foregroundColor).
SetPrefixTextColor(window.src.prefixColor)
transparentDropDown.SetOptions([]string{"true", "false"}, nil).
SetLabel("Transparent: ").SetLabelColor(window.src.labelColor)
transparentDropDown.SetFieldBackgroundColor(window.src.selectedColor).
SetFieldTextColor(window.src.foregroundColor).
SetPrefixTextColor(window.src.prefixColor)
// button
langButton.SetLabelColor(window.src.foregroundColor).