-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
53 lines (47 loc) · 1.22 KB
/
main.go
File metadata and controls
53 lines (47 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"embed"
"indraw/core"
"github.com/wailsapp/wails/v2"
"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
var assets embed.FS
func main() {
// Create an instance of the app structure
app := core.NewApp()
// Create application with options
// 注意:模型文件服务器在 App.Startup 中启动,使用独立端口
err := wails.Run(&options.App{
Title: "Indraw Editor",
Width: 1960,
Height: 1280,
MinWidth: 1280,
MinHeight: 800,
AssetServer: &assetserver.Options{
Assets: assets,
},
// 深色背景,与前端 tech-900 (#0B0E14) 匹配
BackgroundColour: &options.RGBA{R: 11, G: 14, B: 20, A: 255},
OnStartup: app.Startup,
// 启用右键菜单(开发调试用)
EnableDefaultContextMenu: true,
// ✅ 启用无边框窗口
Frameless: true,
Bind: []interface{}{
app,
},
// Windows 特定配置
Windows: &windows.Options{
// 使用系统主题
Theme: windows.SystemDefault,
// 禁用缩放控制(避免布局问题)
DisablePinchZoom: true,
},
})
if err != nil {
println("Error:", err.Error())
}
}