From 04efa4e649857e824950968fec4c715c875b36ce Mon Sep 17 00:00:00 2001 From: eeeXun Date: Fri, 30 Jun 2023 20:59:03 +0800 Subject: [PATCH] refactor: move AddPage to uiInit --- main.go | 5 ----- ui.go | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 06d96d0..4881522 100644 --- a/main.go +++ b/main.go @@ -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) diff --git a/ui.go b/ui.go index bc80828..08e7343 100644 --- a/ui.go +++ b/ui.go @@ -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)