refactored comments and documentation

This commit is contained in:
grantmartin2002-oss 2026-03-05 17:19:33 -06:00
commit 0ff5568cff
3 changed files with 13 additions and 13 deletions

View file

@ -828,7 +828,7 @@ Controls how the window behaves across macOS Spaces and fullscreen. These are bi
- `MacWindowCollectionBehaviorFullScreenAllowsTiling` - Allows side-by-side tiling (macOS 10.11+)
- `MacWindowCollectionBehaviorFullScreenDisallowsTiling` - Prevents tiling (macOS 10.11+)
**Note:** NSWindow fullscreen overlay requires `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }`
**Note:** MacWindowClassWindow fullscreen overlay requires `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }`
**Example - Spotlight-like window:**
```go
@ -850,24 +850,24 @@ Mac: application.MacWindow{
```
**WindowClass** (`MacWindowClass`)
- `NSWindow` - Standard window (default)
- `NSPanel` - Auxiliary window that can float above other windows and receive input without activating the application
- `MacWindowClassWindow` - Standard window (default)
- `MacWindowClassPanel` - Auxiliary window that can float above other windows and receive input without activating the application
**PanelOptions** (`MacPanelOptions`)
**PanelPreferences** (`MacPanelPreferences`)
Options for NSPanel windows (only applies when `WindowClass` is `NSPanel`):
Preferences for MacWindowClassPanel windows (only applies when `WindowClass` is `MacWindowClassPanel`):
- `FloatingPanel` - Panel floats above other windows
- `BecomesKeyOnlyIfNeeded` - Panel becomes key only when needed
- `NonactivatingPanel` - Panel receives input without activating the application
- `UtilityWindow` - Panel uses utility window style
**Note:** Unlike NSWindow, NSPanel fullscreen overlay does NOT require `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }`
**Note:** Unlike MacWindowClassWindow, MacWindowClassPanel fullscreen overlay does NOT require `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }`
**Example - Spotlight-like panel:**
```go
Mac: application.MacWindow{
WindowClass: application.NSPanel,
PanelOptions: application.MacPanelOptions{
WindowClass: application.MacWindowClassPanel,
PanelPreferences: application.MacPanelPreferences{
NonactivatingPanel: true,
},
CollectionBehavior: application.MacWindowCollectionBehaviorCanJoinAllSpaces |

View file

@ -489,7 +489,7 @@ type MacWindow struct {
// WindowClass is the window class for the window
WindowClass MacWindowClass
// PanelOptions contains options for NSPanel windows
// PanelPreferences contains configuration for panel windows
PanelPreferences MacPanelPreferences
}
@ -497,13 +497,13 @@ type MacWindow struct {
type MacWindowClass int
const (
// MacWindowClassWindow - The default value. The window will be a NSWindow, a window that an app displays on the screen.
// MacWindowClassWindow - The default value. A window that an app displays on the screen.
MacWindowClassWindow MacWindowClass = iota
// MacWindowClassPanel - The window will be a NSPanel, a special kind of window that typically performs a function that is auxiliary to the main window
// MacWindowClassPanel - A special kind of window that typically performs a function that is auxiliary to the main window
MacWindowClassPanel
)
// MacPanelOptions contains options for NSPanel windows
// MacPanelPreferences contains options for MacWindowClassPanel windows
type MacPanelPreferences struct {
// FloatingPanel will make the panel float above other windows
FloatingPanel u.Bool

View file

@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Added NSPanel support for macOS. Panels serve as auxiliary windows and can appear over fullscreen apps without activating the application using `NSWindowStyleMaskNonactivatingPanel`. Configure via `Mac.WindowClass` and `Mac.PanelOptions` in window options. Added by [@Grantmartin2002](https://github.com/Grantmartin2002) in [PR](https://github.com/wailsapp/wails/pull/5024)
- Added Panel support for macOS. Panels serve as auxiliary windows and can appear over fullscreen apps without activating the application using `NSWindowStyleMaskNonactivatingPanel`. Configure via `Mac.WindowClass` and `Mac.PanelPreferences` in window options. Added by [@Grantmartin2002](https://github.com/Grantmartin2002) in [PR](https://github.com/wailsapp/wails/pull/5024)
### Fixed
- Fixed locking issue on Windows when multiselect dialog returns an error. Fixed in [PR](https://github.com/wailsapp/wails/pull/4156) by @johannes-luebke