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:
parent
4b6561d3dd
commit
a11b2f181e
@ -18,7 +18,7 @@ const (
|
||||
)
|
||||
|
||||
type Translator struct {
|
||||
src_lang string
|
||||
src_lang string
|
||||
dst_lang string
|
||||
}
|
||||
|
||||
|
17
ui.go
17
ui.go
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user