Added settings window

This commit is contained in:
2025-05-18 16:16:27 +08:00
parent 4e291b889b
commit 7f25dc942e
13 changed files with 180 additions and 36 deletions

19
main.go
View File

@@ -60,9 +60,26 @@ func main() {
BackgroundColour: application.NewRGB(27, 38, 54),
URL: "/",
})
mainWindow.Center()
settingsWindow := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "voidraft设置",
Width: 500,
Height: 600,
Hidden: true, // 初始时隐藏设置窗口
AlwaysOnTop: true,
Mac: application.MacWindow{
Backdrop: application.MacBackdropTranslucent,
TitleBar: application.MacTitleBarHiddenInset,
InvisibleTitleBarHeight: 50,
},
Windows: application.WindowsWindow{},
BackgroundColour: application.NewRGB(27, 38, 54),
URL: "/settings",
})
settingsWindow.Center()
// 设置系统托盘
systray.SetupSystemTray(app, mainWindow, assets)
systray.SetupSystemTray(app, mainWindow, settingsWindow, assets)
// Create a goroutine that emits an event containing the current time every second.
// The frontend can listen to this event and update the UI accordingly.