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

fix SetSelectedFunc not work, should put at bottom

This commit is contained in:
eeeXun 2022-10-21 22:10:57 +08:00
parent 4b6561d3dd
commit a11b2f181e
2 changed files with 9 additions and 10 deletions

17
ui.go
View File

@ -23,7 +23,6 @@ func update_background() {
Foreground(window.src.prefix_color))
dst_dropdown.SetBackgroundColor(window.dst.background_color)
// dst_dropdown.SetFieldBackgroundColor(window.src.selected_color)
dst_dropdown.SetListStyles(tcell.StyleDefault.
Background(window.src.background_color).
Foreground(window.src.foreground_color),
@ -35,14 +34,6 @@ func update_background() {
func ui_init() {
update_background()
// handler
pages.SetInputCapture(PagesHandler)
translate_page.SetInputCapture(TranslatePageHandler)
src_dropdown.SetDoneFunc(SrcDropDownHandler)
src_dropdown.SetSelectedFunc(SrcSelected)
dst_dropdown.SetDoneFunc(DstDropDownHandler)
dst_dropdown.SetSelectedFunc(DstSelected)
// box
src_box.SetBorder(true).
SetTitle(translator.src_lang).
@ -78,6 +69,14 @@ func ui_init() {
SetTitle(translator.dst_lang).
SetBorderColor(window.dst.border_color).
SetTitleColor(window.dst.border_color)
// handler
pages.SetInputCapture(PagesHandler)
translate_page.SetInputCapture(TranslatePageHandler)
src_dropdown.SetDoneFunc(SrcDropDownHandler)
src_dropdown.SetSelectedFunc(SrcSelected)
dst_dropdown.SetDoneFunc(DstDropDownHandler)
dst_dropdown.SetSelectedFunc(DstSelected)
}
func PagesHandler(event *tcell.EventKey) *tcell.EventKey {