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
|
||||
// 在应用程序终止时被调用
|
||||
func (a *App) shutdown(ctx context.Context) {
|
||||
|
@ -102,8 +102,6 @@ body {
|
||||
// width: 900px;
|
||||
// height: 520px;
|
||||
height: 100%;
|
||||
margin-right: 1px;
|
||||
border-radius: 6px;
|
||||
background-color: rgba(219,188,239,.9);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -102,8 +102,6 @@ body {
|
||||
// width: 900px;
|
||||
// height: 520px;
|
||||
height: 100%;
|
||||
margin-right: 1px;
|
||||
border-radius: 6px;
|
||||
background-color: rgba(219,188,239,.9);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
"license": "ISC",
|
||||
"workspaces": ["JS", "TS"],
|
||||
"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,
|
||||
DisableResize: false,
|
||||
Fullscreen: false,
|
||||
Frameless: true,
|
||||
Frameless: false,
|
||||
StartHidden: false,
|
||||
HideWindowOnClose: false,
|
||||
RGBA: &options.RGBA{255, 255, 255, 0},
|
||||
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 0},
|
||||
Assets: assets,
|
||||
Menu: nil,
|
||||
Logger: nil,
|
||||
LogLevel: logger.DEBUG,
|
||||
OnStartup: app.startup,
|
||||
OnDomReady: app.domReady,
|
||||
OnBeforeClose: app.beforeClose,
|
||||
OnShutdown: app.shutdown,
|
||||
WindowStartState: options.Normal,
|
||||
Bind: []interface{}{
|
||||
app,
|
||||
},
|
||||
@ -50,13 +54,23 @@ func main() {
|
||||
// Windows平台特定选项
|
||||
Windows: &windows.Options{
|
||||
WebviewIsTransparent: true,
|
||||
WindowIsTranslucent: true,
|
||||
WindowIsTranslucent: false,
|
||||
DisableWindowIcon: false,
|
||||
// DisableFramelessWindowDecorations: false,
|
||||
WebviewUserDataPath: "",
|
||||
},
|
||||
// Mac platform specific options
|
||||
// Mac平台特定选项
|
||||
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,
|
||||
WindowIsTranslucent: true,
|
||||
About: &mac.AboutInfo{
|
||||
|
Loading…
Reference in New Issue
Block a user