-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
65 lines (59 loc) · 1.56 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
package main
import (
"context"
"embed"
"fmt"
"github.com/MisakaTAT/GTerm/backend/cmd"
"github.com/MisakaTAT/GTerm/backend/consts"
"github.com/MisakaTAT/GTerm/backend/pkg/base"
"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/mac"
"github.com/wailsapp/wails/v2/pkg/options/windows"
)
//go:embed all:frontend/dist
var assets embed.FS
//go:embed build/appicon.png
var icon []byte
func main() {
app := cmd.NewApp()
if err := wails.Run(&options.App{
Title: consts.ApplicationName,
Width: 1200,
Height: 800,
MinWidth: 1024,
MinHeight: 768,
Frameless: !app.PreferencesSrv.IsDarwin(),
AssetServer: &assetserver.Options{
Assets: assets,
},
Debug: options.Debug{
OpenInspectorOnStartup: true,
},
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 0},
OnStartup: func(ctx context.Context) {
app.Startup(ctx)
},
Bind: app.Bind(),
EnumBind: app.Enums(),
Windows: &windows.Options{
WebviewIsTransparent: true,
WindowIsTranslucent: true,
DisableFramelessWindowDecorations: false,
BackdropType: windows.Tabbed,
},
Mac: &mac.Options{
TitleBar: mac.TitleBarHiddenInset(),
About: &mac.AboutInfo{
Title: fmt.Sprintf("%s %s", consts.ApplicationName, base.Version),
Message: app.PreferencesSrv.Copyright(),
Icon: icon,
},
WebviewIsTransparent: false,
WindowIsTranslucent: false,
},
}); err != nil {
panic(err)
}
}