forked from mycherish/brew-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
51 lines (44 loc) · 1.28 KB
/
main.go
File metadata and controls
51 lines (44 loc) · 1.28 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
package main
import (
"embed"
"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" // 引入 Mac 专用选项
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
// Create an instance of the app structure
app := NewApp()
// Create application with options
err := wails.Run(&options.App{
Title: "Brew-Manager",
Width: 1024,
Height: 768,
// Frameless: true, // 1. 隐藏标准标题栏
Mac: &mac.Options{
TitleBar: mac.TitleBarHiddenInset(), // 4. 隐藏标题文字,但保留左上角红绿灯并内嵌
WindowIsTranslucent: true,
WebviewIsTransparent: true,
Appearance: mac.NSAppearanceNameDarkAqua, // 强制深色模式 (可选)
About: &mac.AboutInfo{
Title: "Brew-Manager",
Message: "HomeBrew 服务管理",
},
},
AssetServer: &assetserver.Options{
Assets: assets,
},
// 关键点 1:最外层使用 BackgroundColour 来控制 Webview 基础透明度
// 设置 Alpha 为 0 表示完全透明
BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 0},
OnStartup: app.startup,
Bind: []interface{}{
app,
},
})
if err != nil {
println("Error:", err.Error())
}
}