1
0
Fork 0
mirror of https://github.com/italicsjenga/muda.git synced 2025-02-03 22:56:33 +11:00
Commit graph

65 commits

Author SHA1 Message Date
Amr Bashir
4701bb836e
fix(windows): attach subclass for context menu if window doesn't have a menu bar () 2023-08-29 20:06:58 +03:00
Amr Bashir
33168fa0a0
feat(windows): draw dark menubar if necessary ()
* feat(windows): draw dark menubar if necessary

closes 

* Update Cargo.toml
2023-08-15 16:50:14 +03:00
Amr Bashir
32be0c5884
feat: add MenuId::new () 2023-08-09 02:28:14 +03:00
Amr Bashir
662e17d0ec
refactor: impl drop for inner types ()
* refactor: impl drop for inner types

* macos

* impl todos in macos .remove()

* remove code

* fix gtk accelerator not working after creating the context menu
2023-08-08 19:32:27 +03:00
Amr Bashir
c777f6606a
refactor: add MenuId type and related functions ()
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-08-04 16:17:58 -03:00
Lucas Fernandes Nogueira
7ca4b11564
fix(linux): menu must be the container's first child ()
* fix(linux): menu must be the container's first child

* check if gtk box instead

* Revert "check if gtk box instead"

* update change file
2023-08-03 21:54:08 +03:00
Amr Bashir
bb92b5667e
refactor: change submenu set_as functions 2023-08-03 21:48:55 +03:00
Lucas Fernandes Nogueira
22956ec724
fix(macos): properly remove menu () 2023-08-03 19:55:25 +03:00
Lucas Fernandes Nogueira
0bad3aca96
fix(macos): manually retain/release NSMenu reference ()
* fix(macos): manually retain/release NSMenu reference

* Update src/platform_impl/macos/mod.rs

* retain submenu nsmenu

* remove unused
2023-08-03 16:32:43 +03:00
Amr Bashir
7a3bc5505f
fix(windows): don't drop Menu or MenuChild inside menu proc ()
`Menu` or `MenuChild`  are not owned by the menu proc and so it shouldn't drop it, previously this was okay because the `Menu` or `MenuChild` used to be a wrapper around `Rc<RefCell>` but that was changed in the last release.
2023-08-01 19:43:04 +03:00
Amr Bashir
20c05ceae6
refactor!: add MenuItemKind enum ()
* refactor!: add `MenuItemKind` enum

* remove as_any
2023-07-27 19:58:51 +03:00
Amr Bashir
22f2405bb9
chore: typo 2023-07-27 19:45:44 +03:00
Amr Bashir
c7ec320738
refactor!: use optional Position type and fallback to cursor pos ()
* 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
98701d0b32
refactor(gtk): accept a container param instead of creating it ()
* refactor(gtk): accept a container param instead of creating it

* fix build

* fix clippy
2023-07-25 22:01:35 +03:00
Lucas Fernandes Nogueira
f4275fb157
fix(macos): adjust key_modifier_mask for SUPER modifier () 2023-07-20 14:55:31 +03:00
Amr Bashir
ee30bf8d29
feat: add builders () 2023-07-18 04:59:47 +03:00
Amr Bashir
0000e56974
refactor: move Rc<RefCell<MenuChild>> out of platform_impl ()
* refactor: move `Rc<RefCell<MenuChild>>` out of platform_impl

* fix doc test
2023-07-18 03:44:52 +03:00
Max Stoumen
fabbbacb4b
support AboutMetadata on macos ()
* support `AboutMetadata` on macos

* cleaner syntax

* incorrect docstring

* support linux

* move "Copyright" to constant

* append short_version to version in win, gtk

* narrower unsafe scope

* more accurate docs

* consistent periods in docs

* use `logo` instead for gtk

* clippy autofix

* fmt and clippy

* Create macos-about-metadata.md
2023-06-19 22:34:07 +03:00
Amr Bashir
ac14222934
feat: add common-controls-v6 () 2023-06-19 21:58:45 +03:00
Amr Bashir
7af4477896
feat: add libxdo feature flag ()
* feat: add `libxdo` feature flag

* Update .changes/linux-libxdo-feature-flag.md
2023-06-19 20:59:10 +03:00
Amr Bashir
47ba0b47ed
feat: add set_accelerator ()
* feat: add `set_accelerator`

closes 

* unsafe
2023-05-04 14:40:58 +03:00
renovate[bot]
dfd7b9e437
fix(deps): update rust crate windows-sys to 0.48 ()
* fix(deps): update rust crate windows-sys to 0.48

* fix compilation

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2023-04-17 13:25:40 +02:00
Amr Bashir
f3883ee2d4
fix(windows): run the about dialog in its own thread, closes () 2023-03-27 21:08:43 +02:00
Amr Bashir
059fceb130
fix(windows): downcast check menu item correctly () 2023-03-27 20:47:21 +02:00
Amr Bashir
f322ad454d
fix(Windows): send WM_CLOSE instead of DestroyWindow () 2023-03-06 15:21:50 +02:00
Amr Bashir
88d352033b
fix(Windows): dispatch menu event for icon menu item ()
* fix(Windows): dispatch menu event for icon menu item

* default dispatch to true and improve about dialog
2023-03-06 15:21:36 +02:00
Amr Bashir
d2bd85bf7e
docs: add docs for PredefinedMenuItem () 2023-02-28 18:16:20 +02:00
Amr Bashir
923af09abf
fix(linux): fix multiple borrow panic ()
* fix(linux): fix multiple borrow panic, fixes 

* chore: update example

* update docs
2023-02-14 14:45:35 +02:00
Amr Bashir
f871c68e81
refactor: allow changing the menu event sender ()
* 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 ()
* feat: add `IconMenuItem`

* Linux

* macOS
2022-12-30 14:23:40 +02:00
amrbashir
82220ab7e8
chore: clippy 2022-12-13 00:21:11 +02:00
amrbashir
e80c113d8c
feat: derive Copy for Accelerator 2022-12-12 23:35:41 +02:00
amrbashir
e587421c64
chore: add license 2022-12-08 20:50:24 +02:00
Amr Bashir
7de46e4b5a
refactor: rewrite gtk backend from scratch () 2022-12-05 13:32:34 +02:00
amrbashir
35912d699d
add dedicated ns_menu for context menus and such 2022-11-26 15:13:30 +02:00
amrbashir
37153b826f
feat: expose macOS NSMenu 2022-11-24 18:07:11 +02:00
Amr Bashir
812ff0d37a
refactor: rewrite ()
* 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 ()

* 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 ()
* 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
amrbashir
5c1b220cbb
refactor: change EnterFullScreen to ToggleFullScreen 2022-06-19 11:52:14 +02:00
Jason Tsai
a125e8a58c
feat(macos): implement CheckMenuItem, NativeMenuItem ()
* feat(macos): implement `CheckMenuItem`

* feat(macos): implement `NativeMenuItem`

* Update src/platform_impl/macos/mod.rs

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <wusyong9104@gmail.com>

* Fix enum variant

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <wusyong9104@gmail.com>
2022-06-19 11:47:48 +02:00
amrbashir
00a0270b8f
refactor: rename TextMenuItem to just MeuItem 2022-06-14 14:00:00 +02:00
Amr Bashir
ccf548d199
feat: implement CheckMenuItem ()
* feat: implement `CheckMenuItem`

* linux
2022-06-12 15:42:50 +02:00
Jason Tsai
01e7a2a848
feat(macos): add accelerator ()
* feat(macos): add accelerator

* chore(macos): todo add_native_item

to make compile works

* Update src/platform_impl/macos/accelerator.rs

Should just remove an ampersand here

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* fix: save original label for later use

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2022-06-12 10:25:15 +02:00
Amr Bashir
8f11761dee
feat: implement NativeMenuItem::About for windows and linux ()
* feat: implement NativeMenuItem::About

* linux
2022-06-11 18:17:39 +02:00
Ngo Iok Ui (Wu Yu Wei)
421b00f597
refactor(linux): combine r#type and native_* into sum type 2022-06-11 14:35:33 +02:00
amrbashir
7520e19645
fix(linux): add submenus, text items, native items at runtime 2022-06-10 15:11:02 +02:00
Amr Bashir
943beda6df
feat: implement NativeMenuItem ()
* 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
amrbashir
6f1c8cc9c9
fix(windows): draw menubar for window after changes 2022-06-07 18:53:42 +02:00
Amr Bashir
0201895d74
feat: add menu hide, show and remove () 2022-06-07 18:32:10 +02:00
Amr Bashir
6b98160e49
feat: accelerators ()
* feat: accelerators

* add accelerators on windows
2022-06-07 13:05:20 +02:00