mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-19 01:00:20 -07:00
add stylepage
This commit is contained in:
parent
b4466dba03
commit
b77ccc2e78
1
main.go
1
main.go
@ -38,6 +38,7 @@ func main() {
|
||||
|
||||
mainPage.AddPage("translatePage", translateWindow, true, true)
|
||||
mainPage.AddPage("langPage", langWindow, true, false)
|
||||
mainPage.AddPage("stylePage", styleWindow, true, true)
|
||||
|
||||
if err := app.SetRoot(mainPage, true).
|
||||
EnableMouse(true).Run(); err != nil {
|
||||
|
19
ui.go
19
ui.go
@ -11,7 +11,6 @@ func updateBackground() {
|
||||
srcBox.SetTextStyle(tcell.StyleDefault.
|
||||
Background(window.src.backgroundColor).
|
||||
Foreground(window.src.foregroundColor))
|
||||
|
||||
dstBox.SetBackgroundColor(window.dst.backgroundColor)
|
||||
|
||||
// dropdown
|
||||
@ -22,7 +21,6 @@ func updateBackground() {
|
||||
tcell.StyleDefault.
|
||||
Background(window.src.selectedColor).
|
||||
Foreground(window.src.prefixColor))
|
||||
|
||||
dstLangDropDown.SetBackgroundColor(window.dst.backgroundColor)
|
||||
dstLangDropDown.SetListStyles(tcell.StyleDefault.
|
||||
Background(window.src.backgroundColor).
|
||||
@ -61,7 +59,6 @@ func uiInit() {
|
||||
srcBox.SetSelectedStyle(tcell.StyleDefault.
|
||||
Background(window.src.selectedColor).
|
||||
Foreground(window.src.foregroundColor))
|
||||
|
||||
dstBox.SetBorder(true).
|
||||
SetBorderColor(window.dst.borderColor).
|
||||
SetTitleColor(window.dst.borderColor)
|
||||
@ -75,7 +72,6 @@ func uiInit() {
|
||||
srcLangDropDown.SetBorder(true).
|
||||
SetBorderColor(window.src.borderColor).
|
||||
SetTitleColor(window.src.borderColor)
|
||||
|
||||
dstLangDropDown.SetOptions(Lang, nil)
|
||||
dstLangDropDown.SetFieldBackgroundColor(window.src.selectedColor).
|
||||
SetFieldTextColor(window.src.foregroundColor).
|
||||
@ -83,6 +79,8 @@ func uiInit() {
|
||||
dstLangDropDown.SetBorder(true).
|
||||
SetBorderColor(window.dst.borderColor).
|
||||
SetTitleColor(window.dst.borderColor)
|
||||
themeDropDown.SetOptions(themes_name, nil).SetLabel("Theme: ")
|
||||
transparentDropDown.SetOptions([]string{"true", "false"}, nil).SetLabel("Transparent: ")
|
||||
|
||||
// button
|
||||
langButton.SetLabelColor(window.src.foregroundColor).
|
||||
@ -116,13 +114,12 @@ func uiInit() {
|
||||
AddItem(nil, 0, 1, false)
|
||||
styleWindow.SetDirection(tview.FlexRow).
|
||||
AddItem(nil, 0, 1, false).
|
||||
// AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
|
||||
// AddItem())
|
||||
// AddItem(tview.NewFlex().SetDirection(tview.FlexColumn).
|
||||
// AddItem(nil, 0, 1, false).
|
||||
// AddItem(srcDropDown, 32, 1, true).
|
||||
// AddItem(dstDropDown, 32, 1, false).
|
||||
// AddItem(nil, 0, 1, false), 20, 1, true).
|
||||
AddItem(tview.NewFlex().SetDirection(tview.FlexColumn).
|
||||
AddItem(nil, 0, 1, false).
|
||||
AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
|
||||
AddItem(themeDropDown, 1, 1, false).
|
||||
AddItem(transparentDropDown, 1, 1, false), 20, 1, false).
|
||||
AddItem(nil, 0, 1, false), 20, 1, true).
|
||||
AddItem(attachButton(), 1, 1, true).
|
||||
AddItem(nil, 0, 1, false)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user