-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
64 lines (55 loc) · 1.33 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
package main
import (
"context"
"embed"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/menu"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/o8x/spirit/app"
menu2 "github.com/o8x/spirit/app/menu"
)
//go:embed all:frontend/dist
var assets embed.FS
//go:embed build/appicon.png
var icon []byte
func main() {
application := app.New()
defaultMenu := menu.NewMenu()
defaultMenu.Append(menu.AppMenu())
defaultMenu.Append(menu.EditMenu())
err := wails.Run(&options.App{
Title: "",
Width: 350,
Height: 350,
AssetServer: &assetserver.Options{
Assets: assets,
},
AlwaysOnTop: menu2.AlwaysOnTop,
Menu: defaultMenu,
BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255, A: 0},
OnStartup: func(ctx context.Context) {
application.Startup(ctx, defaultMenu)
},
Bind: []interface{}{
application,
},
Mac: &mac.Options{
TitleBar: &mac.TitleBar{
TitlebarAppearsTransparent: true,
},
Appearance: mac.NSAppearanceNameVibrantLight,
WebviewIsTransparent: true,
WindowIsTranslucent: true,
About: &mac.AboutInfo{
Title: "Spirit",
Message: "© 2023 Alex",
Icon: icon,
},
},
})
if err != nil {
println("Error:", err.Error())
}
}