-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
75 lines (68 loc) · 1.93 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
import (
"downloader/backend"
"embed"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/logger"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/wailsapp/wails/v2/pkg/options/windows"
)
//go:embed frontend/dist
var assets embed.FS
//go:embed build/appicon.png
var icon []byte
func main() {
app := backend.NewApp(
"One-Studio", // Developer 开发者
"csgo-demo-downloader", // AppName 应用名称
"0.0.1", // Version 版本
false, // Debug 是否开启debug日志输出
)
err := wails.Run(&options.App{
Title: "CSGO Demo 下载器",
Width: 720,
Height: 480,
DisableResize: true,
Fullscreen: false,
Frameless: true,
StartHidden: false,
HideWindowOnClose: false,
BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255},
Assets: assets,
LogLevel: logger.DEBUG,
OnStartup: app.Startup,
OnDomReady: app.DomReady,
OnBeforeClose: app.BeforeClose,
OnShutdown: app.Shutdown,
Bind: []interface{}{
app,
},
Windows: &windows.Options{
WebviewIsTransparent: true,
WindowIsTranslucent: true,
DisableWindowIcon: true,
DisableFramelessWindowDecorations: false,
},
Mac: &mac.Options{
// WebviewIsTransparent: true,
// WindowIsTranslucent: true,
TitleBar: &mac.TitleBar{
TitlebarAppearsTransparent: false,
HideTitle: false,
HideTitleBar: false,
FullSizeContent: false,
UseToolbar: false,
HideToolbarSeparator: true,
},
About: &mac.AboutInfo{
Title: "CSGO工具箱",
Message: "a tool for parsing demo sharecode and downloading gotv demos",
Icon: icon,
},
},
})
if err != nil {
println("Error:", err)
}
}