This commit is contained in:
2026-06-30 13:08:18 +07:00
parent 795726aea5
commit 1c2bfde005
18 changed files with 1504 additions and 90 deletions

View File

@@ -4,8 +4,11 @@ import (
"embed"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/menu"
"github.com/wailsapp/wails/v2/pkg/menu/keys"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/windows"
)
//go:embed all:frontend/dist
@@ -15,16 +18,26 @@ func main() {
// Create an instance of the app structure
app := NewApp()
appMenu := menu.NewMenu()
fileMenu := appMenu.AddSubmenu("Simple Care")
fileMenu.AddText("Về trang chính", keys.CmdOrCtrl("h"), func(_ *menu.CallbackData) {
app.ReturnToDashboard()
})
// Create application with options
err := wails.Run(&options.App{
Title: "Simple Care — Rikkei Education",
Width: 1024,
Height: 768,
Menu: appMenu,
AssetServer: &assetserver.Options{
Assets: assets,
},
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: app.startup,
Windows: &windows.Options{
WebviewUserDataPath: app.webviewDataPath,
},
Bind: []interface{}{
app,
},