145 Commits

Author SHA1 Message Date
signadou
dca083660d fix: fix unconditional padding for top-level submenus even if no icon (#321) 2025-11-01 17:11:11 +02:00
Pavel Kuzmin
0ae81ad8b2 Fix: Windows submenu icons support (#308) 2025-07-28 16:50:09 +03:00
Pavel Kuzmin
e37d99b6de feat: add icon to submenu (#277) 2025-06-17 04:54:28 +03:00
Daniel Gerhardt
8efa5a201b fix(linux): make mnemonic handling consistent across platforms (#300) 2025-06-14 18:27:36 +03:00
Amr Bashir
8e986af3ce feat: add helper methods to convert ContextMenu to concrete type (#289)
* feat: add helper methods to convert `ContextMenu` to concrete type

* doc wording

* fix docs
2025-03-30 05:09:16 +02:00
Olivier Goffart
e19a6eb741 feat: Make gtk an optional feature (#283)
This helps projects that uses muda on platform other than Linux to not
get the gtk dependencies in their Cargo.lock (and the security
advisories that goes with it)

Fixes https://github.com/tauri-apps/muda/issues/282
2025-03-22 06:09:43 +02:00
amrbashir
0a308be96b ci: Update lockfile on versioning PRs 2025-03-04 05:05:40 +02:00
Tony
6b3e2e51bb fix(windows): buffer overflow when calling text (#278) 2025-03-03 00:13:07 +02:00
Fabian-Lars
372f8a1d09 chore(deps): Update objc2 to 0.6 (#269) 2025-02-21 14:16:49 +01:00
Amr Bashir
66e0df8b66 chore(deps): update winit to 0.30 (#265) 2025-01-22 01:39:24 +02:00
amrbashir
e6b68f9c4d fix: use thread_local and Cell instead of static mut 2025-01-22 00:42:11 +02:00
amrbashir
d64eb8f5ac docs: document usage of event loop proxy and use it in examples
ref: https://github.com/tauri-apps/tray-icon/issues/209
2024-11-28 04:38:31 +02:00
Stijn Frishert
99ec648de4 feat: add Accelerator::key and Accelerator::modifiers getters (#244) 2024-11-05 14:58:34 +02:00
Jason Tsai
cf9dcfafd0 feat: return context menu dismiss result (#236) 2024-11-05 04:21:07 +02:00
Amr Bashir
11a1ef84fa fix(windows): redraw window menu bar when changing an item in it (#241)
closes tauri-apps/tauri#11556
2024-11-05 03:14:00 +02:00
Amr Bashir
3b58a2ef97 fix: dont fire events for about menu item (#237)
closes #215
2024-10-29 22:04:19 +03:00
Amr Bashir
8bf315ea31 fix(gtk): add margin for IconMenuItem only for submenus (#229)
closes tauri-apps/tauri#10867
2024-09-27 08:29:13 +03:00
Amr Bashir
f781c0edd0 refctor!: mark functions as unsafe and document its safety (#227)
* refctor!: mark functions as unsafe and document its safety

* fix examples

* fix doctests

* fix example in README.md
2024-09-23 17:52:23 +03:00
Amr Bashir
40d06c5c97 fix!: acccelerator typo -> accelerator (#226) 2024-09-23 17:09:56 +03:00
Mads Marquart
5c8971a7c2 Migrate from objc/cocoa to objc2 (#221) 2024-09-23 17:09:41 +03:00
Tony
63c9f2873c fix: set_theme_for_hwnd always resulting dark on Windows (#224) 2024-09-23 16:46:35 +03:00
Mads Marquart
0d368bb327 Don't expose macOS implementation details in the public API (#220)
The `show_context_menu_for_nsview` method previously used the
`objc::runtime::Object` type, which means that the library's dependence
on `objc` is exposed as part of the public API.

Additionally, since the method is taking a raw pointer (and as such
would be unsound if passing e.g. `ptr::dangling()`), I took the
opportunity to also mark the method as `unsafe`.

This is done in preparation for transitioning to `objc2`.
2024-09-08 04:32:56 +03:00
npwoods
394cad31fd fix(windows): use TPM_RETURNCMD instead of subclass for context menus (#214)
These changes also address a memory leak where when an HWND is subclassed, the reference to the menu object was placed in a `Box` seemingly unnecessarily, and this `Box` never seems to be dropped.  This was changed to using straight references.
2024-08-22 17:30:50 +03:00
Linda_pp
07ca6382bc fix: fix separator of CARGO_PKG_AUTHORS value in from_cargo_metadata macro (#213) 2024-08-21 16:46:23 +03:00
Amr Bashir
32bff5610f chore(deps): update window-sys to 0.59 (#210) 2024-08-15 17:20:36 +03:00
Amr Bashir
11d8b7a6fe refactor: add from_cargo_metadata macro (#208) 2024-08-13 03:59:08 +03:00
Jason Tsai
20ea54b698 fix(macos): close menu when dropping NsMenuRef, close #129, #173 (#200) 2024-05-27 19:16:09 +03:00
Amr Bashir
87997a97f3 fix(windows): hardcode dark theme values (#196)
* fix(windows): hardcode dark theme values

When windows is in Light theme but we have the menu fixed to dark mode or auto mode but window is dark, `OpenThemeData` and associated `DrawThemeBackground` will draw using light theme color values.

* clippy
2024-05-16 04:08:27 +03:00
Amr Bashir
e758002bff feat(windows): add theme support (#194)
* feat(windows): add theme support

closes #170

* clippy
2024-05-15 02:35:41 +03:00
Remi Thebault
1dc9d3f193 fix: set time for GTK context menu (#190)
* setting the time field of the context menu event

fixes tauri-apps/tauri#9658

* change file

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-05-07 16:25:39 +03:00
Jason Tsai
67c9d6c303 refactor: fix clippy clone assignment (#191)
* refactor: fix clippy

* remove dbg

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-05-07 16:08:38 +03:00
Jason Tsai
2edfbf1a3a fix(macos): crash on removing menu item (#176) 2024-04-01 16:07:28 +02:00
amrbashir
6454ea269b refactor(windows): avoid panic when getting hwnd dpi 2024-03-27 02:16:26 +02:00
Amr Bashir
90926d43f7 refactor!: migrate to dpi crate (#174)
* refactor!: migrate to `dpi` crate

* fix macOS and Linux builds
2024-03-27 01:15:21 +02:00
Amr Bashir
8960f0ddb5 fix(windows): always override context menu subclass (#171)
Overriding the subclass using the same ID and function pointer, results in only updating the reference data
https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-setwindowsubclass#remarks

closes #162
2024-03-26 17:00:50 +02:00
Amr Bashir
cbb9fc0d7b fix: use a separate subclass for context menus (#166)
closes #162
2024-03-12 01:08:53 +02:00
Amr Bashir
a9937ef981 fix(windows): do not remove menubar from menu when a context menu is dropped (#164)
closes #163
2024-03-12 00:28:47 +02:00
Amr Bashir
2d7828fdd9 fix: avoid panic when parsing invalid accelerator string (#157)
* fix: avoid panic when parsing invalid accelerator string

* fix build
2024-03-06 21:13:29 +02:00
Amr Bashir
f64a62fc89 fix(gtk): reorder to be first child when the container is a gtk::Box (#153)
* fix(gtk): reorder to be first child when the container is a `gtk::Box`

* fmt
2024-02-19 18:05:26 +02:00
Jason Tsai
a7e61fb939 fix(macos): retain separator to prevent autorelease too early, closes #128 (#149) 2024-01-15 19:17:00 +02:00
Jason Tsai
20c45a4ccc fix(macos): fix panic when releasing separator menu item (#147) 2024-01-04 01:14:50 +02:00
Amr Bashir
37f8fca135 perf(windows): use predefined virtual key code instead of a function call 2023-11-23 19:53:36 +02:00
Lucas Fernandes Nogueira
afd3e2ecd4 fix(macos): enabled not working on submenu items (#143) 2023-11-18 22:03:29 +02:00
renovate[bot]
07b188f386 fix(deps): update rust crate windows-sys to 0.52 (#141)
* fix(deps): update rust crate windows-sys to 0.52

* fix build

* change file

* Update mod.rs

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2023-11-17 01:55:15 +02:00
Amr Bashir
ae316bf2dd refactor(linux): relax gtk constraints on methods (#139)
* refactor(linux): relax gtk constraints on methods

* fix test
2023-11-13 18:23:54 +02:00
Morgan Hill
9c10715047 ci: add running test with miri to CI (#138)
For T1 Rust targets Miri is able to check for several forms of undefined
behavior that rustc can not.
2023-11-13 18:23:16 +02:00
Amr Bashir
7bd75b8cd3 ci: update actions (#137)
* ci: update actions

* remove pnpm

* remove node

* sinplify checkout

* clippy on all platforms

* PR message

* fix clippy

* rename file

* name workflow
2023-10-24 04:06:35 +03:00
DK Liao
8d95612c27 chore(deps): upgrade gtk to 0.18 (#133)
* Upgrade to gtk 0.18

* Added change file

* Make clippy happy

* Switch to using the re-exported modules in gtk crate

* Perform cargo fmt

* Switch out wry path

* Fix my dumb typo
2023-10-24 02:32:12 +03:00
Linda_pp
7825f7b3e3 fix: fix clippy warnings (#131)
Signed-off-by: rhysd <lin90162@yahoo.co.jp>
2023-10-17 18:39:13 +03:00
Linda_pp
3672a0c663 feat(macOS): Add 'Bring All to Front' predefined menu item on macOS (#130)
* feat(macOS): Add 'Bring All to Front' predefined menu item on macOS

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* Rename `front` to `bring_all_to_front`

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* Apply suggestions from code review

---------

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-10-16 18:59:38 +03:00