feat: implement main window layout strategy
This commit is contained in:
@@ -30,6 +30,15 @@ type AppService struct {
|
||||
|
||||
const HotkeyShowSecondWindow = 1
|
||||
|
||||
const (
|
||||
mainWindowWidth = 1280
|
||||
mainWindowHeight = 800
|
||||
mainWindowMinWidth = 1024
|
||||
mainWindowMinHeight = 720
|
||||
secondWindowWidth = 340
|
||||
secondWindowHeight = 320
|
||||
)
|
||||
|
||||
func ConfigureAppService(a *AppService, app *application.App, i18nFS embed.FS, suidb *SuiStore) {
|
||||
a.App = app
|
||||
a.I18nFS = i18nFS
|
||||
@@ -37,8 +46,16 @@ func ConfigureAppService(a *AppService, app *application.App, i18nFS embed.FS, s
|
||||
|
||||
isWindows := runtime.GOOS == "windows"
|
||||
mainWindow := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Title: "main",
|
||||
Frameless: isWindows,
|
||||
Title: "main",
|
||||
Name: "main",
|
||||
Width: mainWindowWidth,
|
||||
Height: mainWindowHeight,
|
||||
MinWidth: mainWindowMinWidth,
|
||||
MinHeight: mainWindowMinHeight,
|
||||
InitialPosition: application.WindowCentered,
|
||||
StartState: application.WindowStateNormal,
|
||||
DisableResize: false,
|
||||
Frameless: isWindows,
|
||||
Mac: application.MacWindow{
|
||||
InvisibleTitleBarHeight: 50,
|
||||
Backdrop: application.MacBackdropTranslucent,
|
||||
@@ -53,8 +70,8 @@ func ConfigureAppService(a *AppService, app *application.App, i18nFS embed.FS, s
|
||||
secondWindow := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Title: "second",
|
||||
Name: "second",
|
||||
Width: 340,
|
||||
Height: 320,
|
||||
Width: secondWindowWidth,
|
||||
Height: secondWindowHeight,
|
||||
Mac: application.MacWindow{
|
||||
InvisibleTitleBarHeight: 50,
|
||||
TitleBar: application.MacTitleBarHidden,
|
||||
|
||||
Reference in New Issue
Block a user