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

rename defOutput posOutput

This commit is contained in:
eeeXun 2023-01-11 02:07:50 +08:00
parent 22f916f1f9
commit efff94b2ec
2 changed files with 15 additions and 15 deletions

View File

@ -16,8 +16,8 @@ var (
app = tview.NewApplication()
srcInput = tview.NewTextArea()
dstOutput = tview.NewTextView()
definitionOutput = tview.NewTextArea()
partOutput = tview.NewTextArea()
defOutput = tview.NewTextArea()
posOutput = tview.NewTextArea()
srcLangDropDown = tview.NewDropDown()
dstLangDropDown = tview.NewDropDown()
langCycle = ui.NewUICycle(srcLangDropDown, dstLangDropDown)

26
ui.go
View File

@ -48,12 +48,12 @@ func updateBackgroundColor() {
Background(style.BackgroundColor()).
Foreground(style.ForegroundColor()))
dstOutput.SetBackgroundColor(style.BackgroundColor())
definitionOutput.SetBackgroundColor(style.BackgroundColor())
definitionOutput.SetTextStyle(tcell.StyleDefault.
defOutput.SetBackgroundColor(style.BackgroundColor())
defOutput.SetTextStyle(tcell.StyleDefault.
Background(style.BackgroundColor()).
Foreground(style.ForegroundColor()))
partOutput.SetBackgroundColor(style.BackgroundColor())
partOutput.SetTextStyle(tcell.StyleDefault.
posOutput.SetBackgroundColor(style.BackgroundColor())
posOutput.SetTextStyle(tcell.StyleDefault.
Background(style.BackgroundColor()).
Foreground(style.ForegroundColor()))
@ -111,9 +111,9 @@ func updateBorderColor() {
SetTitleColor(style.SrcBorderColor())
dstOutput.SetBorderColor(style.DstBorderColor()).
SetTitleColor(style.DstBorderColor())
definitionOutput.SetBorderColor(style.SrcBorderColor()).
defOutput.SetBorderColor(style.SrcBorderColor()).
SetTitleColor(style.SrcBorderColor())
partOutput.SetBorderColor(style.DstBorderColor()).
posOutput.SetBorderColor(style.DstBorderColor()).
SetTitleColor(style.DstBorderColor())
// dropdown
@ -133,10 +133,10 @@ func updateNonConfigColor() {
Background(style.SelectedColor()).
Foreground(style.ForegroundColor()))
dstOutput.SetTextColor(style.ForegroundColor())
definitionOutput.SetSelectedStyle(tcell.StyleDefault.
defOutput.SetSelectedStyle(tcell.StyleDefault.
Background(style.SelectedColor()).
Foreground(style.ForegroundColor()))
partOutput.SetSelectedStyle(tcell.StyleDefault.
posOutput.SetSelectedStyle(tcell.StyleDefault.
Background(style.SelectedColor()).
Foreground(style.ForegroundColor()))
@ -218,9 +218,9 @@ func uiInit() {
// input/output
srcInput.SetBorder(true)
dstOutput.SetBorder(true)
definitionOutput.SetBorder(true).
defOutput.SetBorder(true).
SetTitle("Definition")
partOutput.SetBorder(true).
posOutput.SetBorder(true).
SetTitle("Part of speech")
// dropdown
@ -256,11 +256,11 @@ func uiInit() {
translateWindow.SetDirection(tview.FlexColumn).
AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
AddItem(srcInput, 0, 1, true).
AddItem(definitionOutput, 0, 1, false),
AddItem(defOutput, 0, 1, false),
0, 1, true).
AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
AddItem(dstOutput, 0, 1, false).
AddItem(partOutput, 0, 1, false),
AddItem(posOutput, 0, 1, false),
0, 1, false)
langWindow.SetDirection(tview.FlexRow).
AddItem(nil, 0, 1, false).
@ -402,7 +402,7 @@ func translatePageHandler(event *tcell.EventKey) *tcell.EventKey {
dstOutput.SetText(err.Error())
} else {
dstOutput.SetText(translation)
partOutput.SetText(partOfSpeech, false)
posOutput.SetText(partOfSpeech, false)
}
}
case tcell.KeyCtrlQ: