5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 17:52:29 +08:00

[windows] Fix bug with windows options

This commit is contained in:
Lea Anthony 2021-09-05 22:40:34 +10:00
parent 9a99b47f07
commit 2c2ce66ec4
2 changed files with 16 additions and 18 deletions

View File

@ -23,9 +23,12 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
result.frontendOptions = options result.frontendOptions = options
result.SetIsForm(true) result.SetIsForm(true)
exStyle := w32.WS_EX_CONTROLPARENT | w32.WS_EX_APPWINDOW var exStyle int
if options.Windows.WindowBackgroundIsTranslucent { if options.Windows != nil {
exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP exStyle = w32.WS_EX_CONTROLPARENT | w32.WS_EX_APPWINDOW
if options.Windows.WindowBackgroundIsTranslucent {
exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP
}
} }
var dwStyle = w32.WS_OVERLAPPEDWINDOW var dwStyle = w32.WS_OVERLAPPEDWINDOW
@ -54,12 +57,14 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
result.SetFont(winc.DefaultFont) result.SetFont(winc.DefaultFont)
if options.Windows.WindowBackgroundIsTranslucent { if options.Windows != nil {
result.SetTranslucentBackground() if options.Windows.WindowBackgroundIsTranslucent {
} result.SetTranslucentBackground()
}
if options.Windows.DisableWindowIcon { if options.Windows.DisableWindowIcon {
result.DisableIcon() result.DisableIcon()
}
} }
if options.Fullscreen { if options.Fullscreen {

View File

@ -2,20 +2,13 @@ package options
import ( import (
"github.com/wailsapp/wails/v2/pkg/logger" "github.com/wailsapp/wails/v2/pkg/logger"
"github.com/wailsapp/wails/v2/pkg/options/mac"
) )
// Default options for creating the App // Default options for creating the App
var Default = &App{ var Default = &App{
Width: 1024, Width: 1024,
Height: 768, Height: 768,
RGBA: 0xFFFFFFFF, RGBA: 0xFFFFFFFF,
Mac: &mac.Options{
TitleBar: mac.TitleBarDefault(),
Appearance: mac.DefaultAppearance,
WebviewIsTransparent: false,
WindowBackgroundIsTranslucent: false,
},
Logger: logger.NewDefaultLogger(), Logger: logger.NewDefaultLogger(),
LogLevel: logger.INFO, LogLevel: logger.INFO,
} }