Skip to content

Commit 29e5984

Browse files
committed
feat: update options parameter to cancel borderless mode
1 parent 2ba7b33 commit 29e5984

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

app.tmpl.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ func (a *App) domReady(ctx context.Context) {
3030
// 在这里添加你的操作
3131
}
3232

33+
// beforeClose is called when the application is about to quit,
34+
// either by clicking the window close button or calling runtime.Quit.
35+
// Returning true will cause the application to continue,
36+
// false will continue shutdown as normal.
37+
// beforeClose在单击窗口关闭按钮或调用runtime.Quit即将退出应用程序时被调用.
38+
// 返回 true 将导致应用程序继续,false 将继续正常关闭。
39+
func (a *App) beforeClose(ctx context.Context) (prevent bool) {
40+
return false
41+
}
42+
3343
// shutdown is called at application termination
3444
// 在应用程序终止时被调用
3545
func (a *App) shutdown(ctx context.Context) {

frontend/JS/src/App.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ body {
102102
// width: 900px;
103103
// height: 520px;
104104
height: 100%;
105-
margin-right: 1px;
106-
border-radius: 6px;
107105
background-color: rgba(219,188,239,.9);
108106
overflow: hidden;
109107
}

frontend/TS/src/App.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ body {
102102
// width: 900px;
103103
// height: 520px;
104104
height: 100%;
105-
margin-right: 1px;
106-
border-radius: 6px;
107105
background-color: rgba(219,188,239,.9);
108106
overflow: hidden;
109107
}

frontend/package.tmpl.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"license": "ISC",
1212
"workspaces": ["JS", "TS"],
1313
"engines": {
14-
"npm": ">=7.0.0"
14+
"npm": ">=7.0.0",
15+
"node": ">=15.0.0"
1516
}
1617
}

go.mod.tmpl renamed to go.tmpl.mod

File renamed without changes.

main.tmpl.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,43 @@ func main() {
3434
MaxHeight: 1200,
3535
DisableResize: false,
3636
Fullscreen: false,
37-
Frameless: true,
37+
Frameless: false,
3838
StartHidden: false,
3939
HideWindowOnClose: false,
40-
RGBA: &options.RGBA{255, 255, 255, 0},
40+
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 0},
4141
Assets: assets,
42+
Menu: nil,
43+
Logger: nil,
4244
LogLevel: logger.DEBUG,
4345
OnStartup: app.startup,
4446
OnDomReady: app.domReady,
47+
OnBeforeClose: app.beforeClose,
4548
OnShutdown: app.shutdown,
49+
WindowStartState: options.Normal,
4650
Bind: []interface{}{
4751
app,
4852
},
4953
// Windows platform specific options
5054
// Windows平台特定选项
5155
Windows: &windows.Options{
5256
WebviewIsTransparent: true,
53-
WindowIsTranslucent: true,
57+
WindowIsTranslucent: false,
5458
DisableWindowIcon: false,
59+
// DisableFramelessWindowDecorations: false,
60+
WebviewUserDataPath: "",
5561
},
5662
// Mac platform specific options
5763
// Mac平台特定选项
5864
Mac: &mac.Options{
59-
TitleBar: mac.TitleBarHiddenInset(),
65+
TitleBar: &mac.TitleBar{
66+
TitlebarAppearsTransparent: true,
67+
HideTitle: false,
68+
HideTitleBar: false,
69+
FullSizeContent: false,
70+
UseToolbar: false,
71+
HideToolbarSeparator: true,
72+
},
73+
Appearance: mac.NSAppearanceNameDarkAqua,
6074
WebviewIsTransparent: true,
6175
WindowIsTranslucent: true,
6276
About: &mac.AboutInfo{

0 commit comments

Comments
 (0)