53 Commits

Author SHA1 Message Date
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
Amr Bashir
66e0df8b66 chore(deps): update winit to 0.30 (#265) 2025-01-22 01:39:24 +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
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
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
Amr Bashir
32bff5610f chore(deps): update window-sys to 0.59 (#210) 2024-08-15 17:20:36 +03: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
renovate[bot]
a77c8ee2e0 chore(deps): update rust crate wry to 0.38 (#169)
* chore(deps): update rust crate wry to 0.38

* fix test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2024-03-26 17:10:11 +02:00
amrbashir
7a841808e9 chore: use tao instead of winit in windows-common-controls example 2024-03-13 16:06:01 +02:00
renovate[bot]
b678815f6e chore(deps): update rust crate wry to 0.37 (#156)
* chore(deps): update rust crate wry to 0.37

* fix build

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-02-22 02:21:46 +02:00
Amr Bashir
9021a06eca chore: fix clippy 2024-02-19 17:29:14 +02:00
amrbashir
86e5f8fa41 chore: fix wry example on gtk 2024-02-19 17:06:30 +02:00
renovate[bot]
305e7a0f1a chore(deps): update rust crate wry to 0.36 (#146)
* chore(deps): update rust crate wry to 0.36

* fix build

* Update wry.rs

* Update wry.rs

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2024-02-07 19:30:18 +02:00
amrbashir
db93bf5900 chore: update windows-common-controls-v6 example 2024-02-02 05:15:01 +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
renovate[bot]
7e0c09bbe7 chore(deps): update rust crate winit to 0.29 (#134)
* chore(deps): update rust crate winit to 0.29

* fix example

* fix macOS

* one more

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2023-10-24 03:00:49 +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
Amr Bashir
e34040e75a fix(windows): draw over white line below menu (#126) 2023-09-20 23:41:59 +03:00
Linda_pp
89154aede0 refactor(example): clean up wry example (#108) 2023-08-30 17:43:06 +03:00
Amr Bashir
33168fa0a0 feat(windows): draw dark menubar if necessary (#98)
* feat(windows): draw dark menubar if necessary

closes #97

* Update Cargo.toml
2023-08-15 16:50:14 +03:00
Amr Bashir
c777f6606a refactor: add MenuId type and related functions (#91)
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-08-04 16:17:58 -03:00
Amr Bashir
dc8e9d41fd fix: fix examples 2023-08-03 21:55:19 +03:00
Amr Bashir
c7ec320738 refactor!: use optional Position type and fallback to cursor pos (#78)
* refactor!: use optional `Position` type and fallback to cursor pos

* impl gtk & change to use screen coords

* impl macos

* revert back to client coordinates

* fix build

* fix macos impl

* enhance examples

* fix serde feature

* fix tests

* lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-07-27 14:56:01 +03:00
amrbashir
5fbe39e995 chore: fix wry example context menu closes immediately 2023-07-26 03:37:19 +03:00
Amr Bashir
98701d0b32 refactor(gtk): accept a container param instead of creating it (#75)
* refactor(gtk): accept a container param instead of creating it

* fix build

* fix clippy
2023-07-25 22:01:35 +03:00
Amr Bashir
0000e56974 refactor: move Rc<RefCell<MenuChild>> out of platform_impl (#71)
* refactor: move `Rc<RefCell<MenuChild>>` out of platform_impl

* fix doc test
2023-07-18 03:44:52 +03:00
Amr Bashir
ac14222934 feat: add common-controls-v6 (#69) 2023-06-19 21:58:45 +03:00
Amr Bashir
47ba0b47ed feat: add set_accelerator (#64)
* feat: add `set_accelerator`

closes #63

* unsafe
2023-05-04 14:40:58 +03:00
Amr Bashir
923af09abf fix(linux): fix multiple borrow panic (#48)
* fix(linux): fix multiple borrow panic, fixes #40

* chore: update example

* update docs
2023-02-14 14:45:35 +02:00
amrbashir
4b2ebc247c docs: update docs 2023-02-08 21:00:29 +02:00
renovate[bot]
d7905d5f22 chore(deps): update rust crate winit to 0.28 (#42)
* chore(deps): update rust crate winit to 0.28

* fix ci

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-02-02 15:42:36 +02:00
Amr Bashir
f871c68e81 refactor: allow changing the menu event sender (#35)
* refactor: allow changing the menu event sender

* readme

* fix docs warning

* readme
2023-01-03 04:07:07 +02:00
Amr Bashir
7fc1b02cac feat: add IconMenuItem, closes #30 (#32)
* feat: add `IconMenuItem`

* Linux

* macOS
2022-12-30 14:23:40 +02:00
amrbashir
e587421c64 chore: add license 2022-12-08 20:50:24 +02:00
Amr Bashir
7de46e4b5a refactor: rewrite gtk backend from scratch (#24) 2022-12-05 13:32:34 +02:00
Amr Bashir
812ff0d37a refactor: rewrite (#18)
* refactor: rewrite

* fix syncing check items and cleanup

* clippy

* Add `append`, `prepend` and `insert`

* accept different menu items in `*_list` methods

* add context menu for gtk

* add `with_items`

* add `items` getter

* chore: unreachable! and typos

* implement remove

* `*_list`  -> `*_items`

* fix winit example

* add `show_context_menu_for_gtk_window` on `Submenu` type

* Add windows implementation

* TextMenuItem -> MenuItem, MenuItem trait -> MenuEntry

* Add `PredfinedMenuItem`

* move internal mod into its own file

* update tao example to latest tao's `muda` branch

* fix build on linux with latest tao changes

* Fix accelerators on Linux

* update examples

* remove recursive removal of submenus

* remvoe gtk menu items recursively

* fix tao example on macos

* On Windows, remove parents hmenu when removing an item

* Add documentation

* update README.md

* use insert_items with postion 0 for prepend_items

* Add menu mnemonics in examples

* Add `ContextMenu` trait

* Add methods to `ContextMenu` trait necessary for tray icon

* fix linux build

* fix context menu on gtk

* Expose gtk::Menu in ContextMenu trait

* Revert context menu to create a gtk::Menu on each call

* clippy lints

* cleanup crate structure

* update docs

* Fix doc tests and links

* more docs fixes

* error handling

* macOS implementation (#19)

* partial macOS implementation

* fix context menu examples

* add accelerator support for macOS

* strip ampersands from titles on macOS

* add CMD_OR_CTRL shorthand for modifiers

* implement actions for predefined menu items on macos

* fix examples

* more predefined items

* implement insert for macos

* refactor macOS implementation

* menu state getters and setters on macOS

* implement remove for macOS

* code tweaks

* add show_context_menu_for_nsview for Submenu on macOS

* docs improvements

* allow adding item to the same menu multiple times on macOS

* implement `items` for macOS

* strip only single ampersands from menu titles

* add support for menu item actions on macOS

* add app name to macOS About, Hide, Quit menu items

* add methods to set app window and help menus on macOS

* fix clickable submenu titles on macOS

* refactor submenu for safe reuse on macOS

* fmt & clippy

* few cleanups

* fix docs

* clippy

* fix docs

* cleanup examples

* fix tests

* fix clippy??

* use cargo action instead

* ???

* Replace popUpContextMenu with popUpMenuPositioningItem

Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: Wu Wayne <yuweiwu@pm.me>
2022-11-23 18:29:52 +02:00
Ngo Iok Ui (Wu Yu Wei)
e33c5f0daf feat: add accelerator module (#17)
* Add accelerator module

* Add Linux port

* Add macOS port

* Add Windows port

* Remove unused types

* Fix doc tests

* Add more variants
2022-07-20 14:34:09 +02:00
Jason Tsai
28ffd206fa fix(example): replace deprecated EventLoopExtMacOS with EventLoopBuilderExtMacOS (#15) 2022-06-21 22:19:42 +08:00
amrbashir
00a0270b8f refactor: rename TextMenuItem to just MeuItem 2022-06-14 14:00:00 +02:00
Amr Bashir
943beda6df feat: implement NativeMenuItem (#9)
* feat: implement `NativeMenuItem`

* windows: refactor native menu item handle in window proc

* native menu items on linux

* change about status to not implemented on windows
2022-06-10 14:09:56 +02:00
Amr Bashir
0201895d74 feat: add menu hide, show and remove (#8) 2022-06-07 18:32:10 +02:00
Amr Bashir
6b98160e49 feat: accelerators (#6)
* feat: accelerators

* add accelerators on windows
2022-06-07 13:05:20 +02:00
Yu-Wei Wu
1e33121a8f Fix winit example 2022-05-08 19:39:00 +08:00
Yu-Wei Wu
413358ed85 Add init_for_nsapp 2022-05-08 14:32:31 +08:00
amrbashir
cadb53087b rename crate to muda 2022-05-07 11:19:58 +02:00
amrbashir
31e2624ada rename crate to minit 2022-05-07 00:52:41 +02:00
amrbashir
17ae5366c7 add documentation 2022-05-06 22:57:58 +02:00
amrbashir
832e4964e7 implement windows 2022-05-06 18:38:39 +02:00
amrbashir
fbef2d8a40 use an event channel instead of callbacks 2022-05-06 16:25:45 +02:00