feat: update options parameter to cancel borderless mode

This commit is contained in:
misitebao 2022-02-14 21:11:36 +08:00
parent 2ba7b333fa
commit 29e5984091
6 changed files with 30 additions and 9 deletions

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -11,6 +11,7 @@
"license": "ISC",
"workspaces": ["JS", "TS"],
"engines": {
"npm": ">=7.0.0"
"npm": ">=7.0.0",
"node": ">=15.0.0"
}
}

View File

@ -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{