-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
61 lines (54 loc) · 1.21 KB
/
main.go
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
54
55
56
57
58
59
60
61
/*
* @Author: symbol
* @Date: 2022-05-08 08:49:54
* @LastEditors: symbol
* @LastEditTime: 2022-05-23 22:44:39
* @FilePath: \ToDb\main.go
* @Description:
*
* Copyright (c) 2022 by symbol, All Rights Reserved.
*/
package main
import (
"ToDb/common/consts"
"embed"
"log"
goruntime "runtime"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
)
//go:embed frontend/dist
var assets embed.FS
//go:embed build/appicon.png
var icon []byte
func main() {
// 判断系统如果是win需要增高窗口大小
windowsHeight := 728
osInfo := goruntime.GOOS
if osInfo == "windows" {
windowsHeight = 770
}
// Create an instance of the app structure
// 创建一个App结构体实例
app := NewApp()
// Create application with options
// 使用选项创建应用
err := wails.Run(&options.App{
Title: consts.AppName,
Width: 1342,
Height: windowsHeight,
DisableResize: true,
Assets: assets,
OnStartup: app.startup,
OnDomReady: app.domReady,
OnBeforeClose: app.beforeClose,
OnShutdown: app.shutdown,
WindowStartState: options.Normal,
Bind: []interface{}{
app,
},
})
if err != nil {
log.Fatal(err)
}
}