23 Commits

Author SHA1 Message Date
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
Simon Laux
f67371e4f5 docs: readme typo (#285) 2025-03-10 13:19:29 +01: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
Linda_pp
f3b7d54224 chore: fix links in API document and add document link to README.md (#118)
* chore: fix links in API document and add document link to README.md

* Update README.md
2023-09-07 17:40:49 +03:00
Amr Bashir
e5324b7684 chore: update docs 2023-07-28 04:38:38 +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
Amr Bashir
13d1aa66d4 chore: fix linx to init_for_hwnd 2023-07-20 15:04:02 +03:00
Amr Bashir
ac14222934 feat: add common-controls-v6 (#69) 2023-06-19 21:58:45 +03:00
Amr Bashir
7af4477896 feat: add libxdo feature flag (#67)
* feat: add `libxdo` feature flag

* Update .changes/linux-libxdo-feature-flag.md
2023-06-19 20:59:10 +03:00
amrbashir
4b2ebc247c docs: update docs 2023-02-08 21:00:29 +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
amrbashir
e587421c64 chore: add license 2022-12-08 20:50:24 +02:00
Amr Bashir
b3d06ff9d8 chore: update typo in README.md 2022-11-23 18:41:26 +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
Amr Bashir
0201895d74 feat: add menu hide, show and remove (#8) 2022-06-07 18:32:10 +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
7021b6c585 update crate metadata 2022-05-07 01:02:52 +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