diff --git a/docs/src/content/docs/changelog.mdx b/docs/src/content/docs/changelog.mdx index 3fd303a1b..8afb4bc39 100644 --- a/docs/src/content/docs/changelog.mdx +++ b/docs/src/content/docs/changelog.mdx @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Renamed Service methods: `Name` -> `ServiceName`, `OnStartup` -> `ServiceStartup`, `OnShutdown` -> `ServiceShutdown` by [@leaanthony](https://github.com/leaanthony) - Moved `Path` and `Paths` methods to `application` package by [@leaanthony](https://github.com/leaanthony) +- The application menu is now macOS only by [@leaanthony](https://github.com/leaanthony) ### Added @@ -57,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change paths in windows Taskfile to forward slashes to ensure it works on non-Windows platforms by [@leaanthony](https://github.com/leaanthony) - Mac + Mac JS events now fixed by [@leaanthony](https://github.com/leaanthony) - Fixed event deadlock for macOS by [@leaanthony](https://github.com/leaanthony) +- Fixed a `Parameter incorrect` error in Window initialisation on Windows when HTML provided but no JS by [@leaanthony](https://github.com/leaanthony) ### Changed @@ -66,6 +68,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ContextMenuData now returns a string instead of any by [@leaanthony](https://github.com/leaanthony) - `application.NewService` does not accept options as an optional parameter anymore (use `application.NewServiceWithOptions` instead) by [@leaanthony](https://github.com/leaanthony) in [#4024](https://github.com/wailsapp/wails/pull/4024) - Removed `nanoid` dependency by [@leaanthony](https://github.com/leaanthony) +- Updated Window example for mica/acrylic/tabbed window styles by [@leaanthony](https://github.com/leaanthony) ## v3.0.0-alpha.9 - 2025-01-13 diff --git a/docs/src/content/docs/guides/menus.mdx b/docs/src/content/docs/guides/menus.mdx index ed2de62d8..d3bc165b6 100644 --- a/docs/src/content/docs/guides/menus.mdx +++ b/docs/src/content/docs/guides/menus.mdx @@ -228,11 +228,9 @@ Application menus are the menus that appear at the top of your application windo ### Application Menu Behaviour -When you set an application menu using `app.SetMenu()`, it becomes the default menu for all windows in your application. However, there are a few important behaviours to note: +When you set an application menu using `app.SetMenu()`, it becomes the main menu on macOS. +Menus are set on a pre-window basis for Windows/Linux. -1. **Global Application Menu**: The menu set via `app.SetMenu()` acts as the default menu for all windows. - -2. **Per-Window Menu Override**: Individual windows can override the application menu by setting their own menu through window options: ```go app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ Title: "Custom Menu Window", @@ -242,16 +240,6 @@ app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ }) ``` -3. **Disable Window Menu**: On Windows, you can disable a window's menu completely even when there's a global application menu: -```go -app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ - Title: "No Menu Window", - Windows: application.WindowsWindow{ - DisableMenu: true, // Disable menu for this window - }, -}) -``` - Here's a complete example showing these different menu behaviours: ```go @@ -267,15 +255,10 @@ func main() { window.SetTitle("New Window") }) - // Set as application menu - default for all windows + // Set as application menu - this is for macOS app.SetMenu(appMenu) - // Window with default application menu - app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ - Title: "Default Menu", - }) - - // Window with custom menu + // Window with custom menu on Windows customMenu := application.NewMenu() customMenu.Add("Custom Action") app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ @@ -285,14 +268,6 @@ func main() { }, }) - // Window with no menu - app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ - Title: "No Menu", - Windows: application.WindowsWindow{ - DisableMenu: true, - }, - }) - app.Run() } ``` diff --git a/v3/examples/window/main.go b/v3/examples/window/main.go index 6d5512cec..4b4f01c46 100644 --- a/v3/examples/window/main.go +++ b/v3/examples/window/main.go @@ -234,8 +234,7 @@ func main() { OnClick(func(ctx *application.Context) { app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ Windows: application.WindowsWindow{ - DisableMenu: true, - ExStyle: getExStyle(), + ExStyle: getExStyle(), }, }). SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)). @@ -247,11 +246,7 @@ func main() { } myMenu.Add("New WebviewWindow (Listen to Move)"). OnClick(func(ctx *application.Context) { - w := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ - Windows: application.WindowsWindow{ - DisableMenu: true, - }, - }). + w := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{}). SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)). SetRelativePosition(rand.Intn(1000), rand.Intn(800)). SetURL("https://wails.io"). @@ -264,11 +259,7 @@ func main() { }) myMenu.Add("New WebviewWindow (Listen to Resize)"). OnClick(func(ctx *application.Context) { - w := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ - Windows: application.WindowsWindow{ - DisableMenu: true, - }, - }). + w := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{}). SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)). SetRelativePosition(rand.Intn(1000), rand.Intn(800)). SetURL("https://wails.io"). @@ -389,7 +380,26 @@ func main() { X: rand.Intn(1000), Y: rand.Intn(800), BackgroundType: application.BackgroundTypeTranslucent, - HTML: "
", + HTML: ` + + + + + +