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:
parent
529decb190
commit
edcfe4dde3
2
main.go
2
main.go
@ -62,9 +62,9 @@ func main() {
|
|||||||
case *showVersion:
|
case *showVersion:
|
||||||
print(version, "\n")
|
print(version, "\n")
|
||||||
default:
|
default:
|
||||||
SetTermTitle("gtt")
|
|
||||||
configInit()
|
configInit()
|
||||||
uiInit()
|
uiInit()
|
||||||
|
SetTermTitle(translator.GetEngineName())
|
||||||
|
|
||||||
mainPage.AddPage("translateWindow", translateWindow, true, true)
|
mainPage.AddPage("translateWindow", translateWindow, true, true)
|
||||||
mainPage.AddPage("langPopOut", langPopOut, true, false)
|
mainPage.AddPage("langPopOut", langPopOut, true, false)
|
||||||
|
1
ui.go
1
ui.go
@ -367,6 +367,7 @@ func uiInit() {
|
|||||||
translator = translators[text]
|
translator = translators[text]
|
||||||
updateLangDropDown()
|
updateLangDropDown()
|
||||||
updateCurrentLang()
|
updateCurrentLang()
|
||||||
|
SetTermTitle(translator.GetEngineName())
|
||||||
})
|
})
|
||||||
srcLangDropDown.SetDoneFunc(langDropDownHandler)
|
srcLangDropDown.SetDoneFunc(langDropDownHandler)
|
||||||
dstLangDropDown.SetDoneFunc(langDropDownHandler)
|
dstLangDropDown.SetDoneFunc(langDropDownHandler)
|
||||||
|
4
utils.go
4
utils.go
@ -16,8 +16,8 @@ func IndexOf(candidate string, arr []string) int {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetTermTitle(title string) {
|
func SetTermTitle(name string) {
|
||||||
print("\033]0;", title, "\007")
|
fmt.Printf("\033]0;gtt - %s\007", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CopyToClipboard(text string) {
|
func CopyToClipboard(text string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user