mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-17 00:00:16 -07:00
camel case
This commit is contained in:
parent
099891c757
commit
54c044f1ff
2
main.go
2
main.go
@ -28,7 +28,7 @@ func main() {
|
||||
// result, _ := translator.Translate("Hello world\nApple\nbumper")
|
||||
// fmt.Println(result)
|
||||
window.colorInit()
|
||||
ui_init()
|
||||
uiInit()
|
||||
translate_page.SetDirection(tview.FlexColumn).
|
||||
AddItem(src_box, 0, 1, true).
|
||||
AddItem(dst_box, 0, 1, false)
|
||||
|
10
ui.go
10
ui.go
@ -4,7 +4,7 @@ import (
|
||||
"github.com/gdamore/tcell/v2"
|
||||
)
|
||||
|
||||
func update_background() {
|
||||
func updateBackground() {
|
||||
// box
|
||||
src_box.SetBackgroundColor(window.src.background_color)
|
||||
src_box.SetTextStyle(tcell.StyleDefault.
|
||||
@ -31,8 +31,8 @@ func update_background() {
|
||||
Foreground(window.src.prefix_color))
|
||||
}
|
||||
|
||||
func ui_init() {
|
||||
update_background()
|
||||
func uiInit() {
|
||||
updateBackground()
|
||||
|
||||
// box
|
||||
src_box.SetBorder(true).
|
||||
@ -91,7 +91,7 @@ func PagesHandler(event *tcell.EventKey) *tcell.EventKey {
|
||||
window.src.background_color = Transparent
|
||||
window.dst.background_color = Transparent
|
||||
}
|
||||
update_background()
|
||||
updateBackground()
|
||||
transparent = !transparent
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ func TranslatePageHandler(event *tcell.EventKey) *tcell.EventKey {
|
||||
case tcell.KeyCtrlP:
|
||||
translator.PlaySound(translator.dst_lang, dst_box.GetText(false))
|
||||
case tcell.KeyCtrlS:
|
||||
dst_box.SetText("SSS")
|
||||
translator.src_lang, translator.dst_lang = translator.dst_lang, translator.src_lang
|
||||
}
|
||||
|
||||
return event
|
||||
|
Loading…
x
Reference in New Issue
Block a user