5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-06 02:41:28 +08:00

[v3 mac] DisableWindowShadow -> DisableShadow

This commit is contained in:
Lea Anthony 2023-05-17 08:13:05 +10:00
parent f210357bfe
commit 39c834b83f
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
4 changed files with 13 additions and 13 deletions

View File

@ -32,7 +32,7 @@ Webview Window Interface Methods
| close() | | | Y | | | close() | | | Y | |
| destroy() | | | Y | | | destroy() | | | Y | |
| execJS(js string) | | | Y | | | execJS(js string) | | | Y | |
| focus() | Y | | | | | focus() | Y | | Y | |
| forceReload() | | | Y | | | forceReload() | | | Y | |
| fullscreen() | Y | | Y | | | fullscreen() | Y | | Y | |
| getScreen() (*Screen, error) | | | Y | | | getScreen() (*Screen, error) | | | Y | |
@ -126,7 +126,7 @@ Webview Window Interface Methods
| Size | Y | | Y | | | Size | Y | | Y | |
| SetPosition | Y | | Y | | | SetPosition | Y | | Y | |
| Position | Y | | Y | | | Position | Y | | Y | |
| Focus | Y | | | | | Focus | Y | | Y | |
| FullScreen | Y | | Y | | | FullScreen | Y | | Y | |
| UnFullscreen | Y | | Y | | | UnFullscreen | Y | | Y | |
| Minimise | Y | | Y | | | Minimise | Y | | Y | |
@ -286,12 +286,12 @@ Built-in plugin support:
### Mac Options ### Mac Options
| Feature | Default | Notes | | Feature | Default | Notes |
|-------------------------|-------------------|------------------------------------------------------| |-------------------|-------------------|------------------------------------------------------|
| Backdrop | MacBackdropNormal | Standard solid window | | Backdrop | MacBackdropNormal | Standard solid window |
| DisableWindowShadow | false | | | DisableShadow | false | |
| TitleBar | | Standard window decorations by default | | TitleBar | | Standard window decorations by default |
| Appearance | DefaultAppearance | | | Appearance | DefaultAppearance | |
| InvisibleTitleBarHeight | 0 | Creates an invisible title bar for frameless windows | | InvisibleTitleBarHeight | 0 | Creates an invisible title bar for frameless windows |

View File

@ -275,7 +275,7 @@ func main() {
}) })
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Mac: application.MacWindow{ Mac: application.MacWindow{
DisableWindowShadow: true, DisableShadow: true,
}, },
}) })

View File

@ -44,7 +44,7 @@ const (
// MacWindow contains macOS specific options // MacWindow contains macOS specific options
type MacWindow struct { type MacWindow struct {
Backdrop MacBackdrop Backdrop MacBackdrop
DisableWindowShadow bool DisableShadow bool
TitleBar MacTitleBar TitleBar MacTitleBar
Appearance MacAppearanceType Appearance MacAppearanceType
InvisibleTitleBarHeight int InvisibleTitleBarHeight int

View File

@ -820,7 +820,7 @@ type macosWebviewWindow struct {
} }
func (w *macosWebviewWindow) focus() { func (w *macosWebviewWindow) focus() {
//TODO implement me w.show()
} }
func (w *macosWebviewWindow) openContextMenu(menu *Menu, data *ContextMenuData) { func (w *macosWebviewWindow) openContextMenu(menu *Menu, data *ContextMenuData) {
@ -1176,12 +1176,12 @@ func (w *macosWebviewWindow) run() {
} }
if w.parent.options.Hidden == false { if w.parent.options.Hidden == false {
C.windowShow(w.nsWindow) C.windowShow(w.nsWindow)
w.setHasShadow(!w.parent.options.Mac.DisableWindowShadow) w.setHasShadow(!w.parent.options.Mac.DisableShadow)
} else { } else {
// We have to wait until the window is shown before we can remove the shadow // We have to wait until the window is shown before we can remove the shadow
var cancel func() var cancel func()
cancel = w.parent.On(events.Mac.WindowDidBecomeKey, func(_ *WindowEventContext) { cancel = w.parent.On(events.Mac.WindowDidBecomeKey, func(_ *WindowEventContext) {
w.setHasShadow(!w.parent.options.Mac.DisableWindowShadow) w.setHasShadow(!w.parent.options.Mac.DisableShadow)
cancel() cancel()
}) })
} }