From 631c8a1cc8bfc5211273b07f6eb0b6ce003fd2ab Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Thu, 23 Jan 2025 22:10:23 +1100 Subject: [PATCH] New ContextMenu API + example (#4013) * New ContextMenu API + example * Remove redundant code * ContextMenuData now returns a string. New Menu guide. * Update readme * Update v3/pkg/application/context.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add new menubar option * Fix docs --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- docs/src/content/docs/changelog.mdx | 2 ++ v3/examples/window-menu/README.md | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/content/docs/changelog.mdx b/docs/src/content/docs/changelog.mdx index 9a75e2ae7..db29e026c 100644 --- a/docs/src/content/docs/changelog.mdx +++ b/docs/src/content/docs/changelog.mdx @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add diagnostics section to `wails doctor` by [@leaanthony](https://github.com/leaanthony) - Add window to context when calling a service method by [@leaanthony](https://github.com/leaanthony) - Add `window-call` example to demonstrate how to know which window is calling a service by [@leaanthony](https://github.com/leaanthony) +- New Menu guide by [@leaanthony](https://github.com/leaanthony) - Better panic handling by [@leaanthony](https://github.com/leaanthony) - New Menu guide by [@leaanthony](https://github.com/leaanthony) - Add doc comments for Service API by [@fbbdev](https://github.com/fbbdev) in [#4024](https://github.com/wailsapp/wails/pull/4024) @@ -53,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Removed `application.WindowIDKey` and `application.WindowNameKey` (replaced by `application.WindowKey`) by [@leaanthony](https://github.com/leaanthony) +- ContextMenuData now returns a string instead of any by [@leaanthony](https://github.com/leaanthony) - In JS/TS bindings, class fields of fixed-length array types are now initialized with their expected length instead of being empty by [@fbbdev](https://github.com/fbbdev) in [#4001](https://github.com/wailsapp/wails/pull/4001) - 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) diff --git a/v3/examples/window-menu/README.md b/v3/examples/window-menu/README.md index 7b3a517e4..0d825364f 100644 --- a/v3/examples/window-menu/README.md +++ b/v3/examples/window-menu/README.md @@ -19,6 +19,6 @@ go run . ## How it Works -The example creates a window with a default menu and binds the F10 key to toggle the menu bar's visibility. The menu bar will hide when F10 is pressed and show when F10 is released. +The example creates a window with a default menu and binds the F1 key to toggle the menu bar's visibility. The menu bar will show when F2 is pressed and hide when F3 is released. -Note: The menu bar toggling functionality only works on Windows. On other platforms, the F10 key binding will have no effect. +Note: The menu bar toggling functionality only works on Windows. On other platforms, the F1 key binding will have no effect.