v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-19 09:10:42 -07:00

feat: show translator name in terminal title

This commit is contained in:
eeeXun 2023-02-21 01:13:35 +08:00
parent 529decb190
commit edcfe4dde3
3 changed files with 4 additions and 3 deletions

View File

@ -62,9 +62,9 @@ func main() {
case *showVersion:
print(version, "\n")
default:
SetTermTitle("gtt")
configInit()
uiInit()
SetTermTitle(translator.GetEngineName())
mainPage.AddPage("translateWindow", translateWindow, true, true)
mainPage.AddPage("langPopOut", langPopOut, true, false)

1
ui.go
View File

@ -367,6 +367,7 @@ func uiInit() {
translator = translators[text]
updateLangDropDown()
updateCurrentLang()
SetTermTitle(translator.GetEngineName())
})
srcLangDropDown.SetDoneFunc(langDropDownHandler)
dstLangDropDown.SetDoneFunc(langDropDownHandler)

View File

@ -16,8 +16,8 @@ func IndexOf(candidate string, arr []string) int {
return -1
}
func SetTermTitle(title string) {
print("\033]0;", title, "\007")
func SetTermTitle(name string) {
fmt.Printf("\033]0;gtt - %s\007", name)
}
func CopyToClipboard(text string) {