Skip to content

Commit

Permalink
refactor: move AddPage to uiInit
Browse files Browse the repository at this point in the history
  • Loading branch information
eeeXun committed Jun 30, 2023
1 parent 23c4515 commit 04efa4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ func main() {
uiInit()
SetTermTitle(translator.GetEngineName())

mainPage.AddPage("translateWindow", translateWindow, true, true)
mainPage.AddPage("langPopOut", langPopOut, true, false)
mainPage.AddPage("stylePopOut", stylePopOut, true, false)
mainPage.AddPage("keyMapPopOut", keyMapPopOut, true, false)

if err := app.SetRoot(mainPage, true).
EnableMouse(true).Run(); err != nil {
panic(err)
Expand Down
6 changes: 6 additions & 0 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ func showKeyMapPopout() {
}

func uiInit() {
// pages
mainPage.AddPage("translateWindow", translateWindow, true, true)
mainPage.AddPage("langPopOut", langPopOut, true, false)
mainPage.AddPage("stylePopOut", stylePopOut, true, false)
mainPage.AddPage("keyMapPopOut", keyMapPopOut, true, false)

// input/output
srcInput.SetBorder(true)
dstOutput.SetBorder(true)
Expand Down

0 comments on commit 04efa4e

Please sign in to comment.