mirror of
https://github.com/misitebao/wails-template-vue
synced 2025-02-23 13:02:16 +08:00
feat: update options parameter to cancel borderless mode
This commit is contained in:
parent
2ba7b333fa
commit
29e5984091
10
app.tmpl.go
10
app.tmpl.go
@ -30,6 +30,16 @@ func (a *App) domReady(ctx context.Context) {
|
|||||||
// 在这里添加你的操作
|
// 在这里添加你的操作
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// beforeClose is called when the application is about to quit,
|
||||||
|
// either by clicking the window close button or calling runtime.Quit.
|
||||||
|
// Returning true will cause the application to continue,
|
||||||
|
// false will continue shutdown as normal.
|
||||||
|
// beforeClose在单击窗口关闭按钮或调用runtime.Quit即将退出应用程序时被调用.
|
||||||
|
// 返回 true 将导致应用程序继续,false 将继续正常关闭。
|
||||||
|
func (a *App) beforeClose(ctx context.Context) (prevent bool) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// shutdown is called at application termination
|
// shutdown is called at application termination
|
||||||
// 在应用程序终止时被调用
|
// 在应用程序终止时被调用
|
||||||
func (a *App) shutdown(ctx context.Context) {
|
func (a *App) shutdown(ctx context.Context) {
|
||||||
|
@ -102,8 +102,6 @@ body {
|
|||||||
// width: 900px;
|
// width: 900px;
|
||||||
// height: 520px;
|
// height: 520px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-right: 1px;
|
|
||||||
border-radius: 6px;
|
|
||||||
background-color: rgba(219,188,239,.9);
|
background-color: rgba(219,188,239,.9);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
@ -102,8 +102,6 @@ body {
|
|||||||
// width: 900px;
|
// width: 900px;
|
||||||
// height: 520px;
|
// height: 520px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-right: 1px;
|
|
||||||
border-radius: 6px;
|
|
||||||
background-color: rgba(219,188,239,.9);
|
background-color: rgba(219,188,239,.9);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"workspaces": ["JS", "TS"],
|
"workspaces": ["JS", "TS"],
|
||||||
"engines": {
|
"engines": {
|
||||||
"npm": ">=7.0.0"
|
"npm": ">=7.0.0",
|
||||||
|
"node": ">=15.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
22
main.tmpl.go
22
main.tmpl.go
@ -34,15 +34,19 @@ func main() {
|
|||||||
MaxHeight: 1200,
|
MaxHeight: 1200,
|
||||||
DisableResize: false,
|
DisableResize: false,
|
||||||
Fullscreen: false,
|
Fullscreen: false,
|
||||||
Frameless: true,
|
Frameless: false,
|
||||||
StartHidden: false,
|
StartHidden: false,
|
||||||
HideWindowOnClose: false,
|
HideWindowOnClose: false,
|
||||||
RGBA: &options.RGBA{255, 255, 255, 0},
|
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 0},
|
||||||
Assets: assets,
|
Assets: assets,
|
||||||
|
Menu: nil,
|
||||||
|
Logger: nil,
|
||||||
LogLevel: logger.DEBUG,
|
LogLevel: logger.DEBUG,
|
||||||
OnStartup: app.startup,
|
OnStartup: app.startup,
|
||||||
OnDomReady: app.domReady,
|
OnDomReady: app.domReady,
|
||||||
|
OnBeforeClose: app.beforeClose,
|
||||||
OnShutdown: app.shutdown,
|
OnShutdown: app.shutdown,
|
||||||
|
WindowStartState: options.Normal,
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
@ -50,13 +54,23 @@ func main() {
|
|||||||
// Windows平台特定选项
|
// Windows平台特定选项
|
||||||
Windows: &windows.Options{
|
Windows: &windows.Options{
|
||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
WindowIsTranslucent: true,
|
WindowIsTranslucent: false,
|
||||||
DisableWindowIcon: false,
|
DisableWindowIcon: false,
|
||||||
|
// DisableFramelessWindowDecorations: false,
|
||||||
|
WebviewUserDataPath: "",
|
||||||
},
|
},
|
||||||
// Mac platform specific options
|
// Mac platform specific options
|
||||||
// Mac平台特定选项
|
// Mac平台特定选项
|
||||||
Mac: &mac.Options{
|
Mac: &mac.Options{
|
||||||
TitleBar: mac.TitleBarHiddenInset(),
|
TitleBar: &mac.TitleBar{
|
||||||
|
TitlebarAppearsTransparent: true,
|
||||||
|
HideTitle: false,
|
||||||
|
HideTitleBar: false,
|
||||||
|
FullSizeContent: false,
|
||||||
|
UseToolbar: false,
|
||||||
|
HideToolbarSeparator: true,
|
||||||
|
},
|
||||||
|
Appearance: mac.NSAppearanceNameDarkAqua,
|
||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
WindowIsTranslucent: true,
|
WindowIsTranslucent: true,
|
||||||
About: &mac.AboutInfo{
|
About: &mac.AboutInfo{
|
||||||
|
Loading…
Reference in New Issue
Block a user