Commit graph

55 commits

Author SHA1 Message Date
github-actions[bot] b00c9e283b
Apply Version Updates From Current Changes (#27)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2022-12-06 03:05:44 +02:00
amrbashir cf8d88613f
ci: install ubuntu deps in covector 2022-12-06 03:02:55 +02:00
amrbashir 0309d101b1
chore: prepare for first release 2022-12-05 13:39:05 +02:00
Amr Bashir 7de46e4b5a
refactor: rewrite gtk backend from scratch (#24) 2022-12-05 13:32:34 +02:00
amrbashir 93fcdfbb04
chore: remove trailing comma 2022-11-27 12:49:54 +02:00
amrbashir c09eab7ef2
Merge branch 'feat/macOS-ns-menu' into dev 2022-11-27 12:28:36 +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 385ea393b5
chore: disable renovate dash board 2022-11-24 03:30:50 +02:00
Amr Bashir b3d06ff9d8
chore: update typo in README.md 2022-11-23 18:41:26 +02:00
renovate[bot] 13e76dcf31
Configure Renovate (#20)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-23 18:40:02 +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
amrbashir 1f341d1e4e
ci: run on all platforms, install sys deps 2022-11-06 14:25:20 +02:00
amrbashir c7755a01b9
ci: fmt -> rustfmt 2022-11-06 14:13:18 +02:00
amrbashir 18f5b91106
ci: add test workflow 2022-10-27 20:04:35 +02:00
amrbashir 45af0f8c5c
ci: add covector, audit, clippy and fmt 2022-10-27 20:01:24 +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 5c1b220cbb
refactor: change EnterFullScreen to ToggleFullScreen 2022-06-19 11:52:14 +02:00
Jason Tsai a125e8a58c
feat(macos): implement CheckMenuItem, NativeMenuItem (#14)
* 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 (#13)
* feat: implement `CheckMenuItem`

* linux
2022-06-12 15:42:50 +02:00
Jason Tsai 01e7a2a848
feat(macos): add accelerator (#12)
* 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
amrbashir 166e699c24
chore: update docs 2022-06-11 20:06:56 +02:00
Amr Bashir 8f11761dee
feat: implement NativeMenuItem::About for windows and linux (#11)
* 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 (#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
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 (#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
amrbashir 68f16f15a3
refactor(linux): use Rc<RefCell> instead of Arc<Mutex> 2022-06-06 14:42:35 +02:00
amrbashir 6cb2ce1c7a
feat(linux): document requirements and return gtk::Box 2022-06-06 14:36:22 +02:00
amrbashir c8dcb40d56
chore: rename wchar_ptr_to_string to decode_wide 2022-06-05 15:42:18 +02:00
amrbashir fc7b519b6a
chore: switch to tao branch that disables gtk menu creation 2022-06-05 15:13:56 +02:00
amrbashir f5fb8b1df6
fix(macos): fix returning BOOL instead of bool 2022-06-05 15:05:42 +02:00
Jason Tsai 125628b1ff
Implement macOS Submenu label, enabled (#3)
* fix panic in label better

* implement macos Submenu `enabled` state
2022-05-20 12:22:46 +08:00
Jason Tsai 1ab9c9b9e8
feat: implement label and enabled in macOS TextMenuItem (#2)
* feat: implement label, enabled methods for macos TextMenuItem

* fix: using lossy version of from_utf8 and change the way we convert UTF8String to String
2022-05-16 14:11:19 +02:00
amrbashir a7b7b0cf34
typo 2022-05-08 19:36:39 +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
Ngo Iok Ui (Wu Yu Wei) b5886fe6b1
Merge pull request #1 from wusyong/macos
Add macos port

Co-authored-by: Jason Tsai <jason@pews.dev>
2022-05-07 21:52:52 +08:00
Yu-Wei Wu b2f1a3ab4f
Add macos port
Some configurations haven't implemented yet or just seem not possible.

Co-authored-by: Jason Tsai <jason@pews.dev>
2022-05-07 21:28:11 +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
amrbashir 2ccd400497
use native apis for getters on windows 2022-05-06 19:37:49 +02:00
amrbashir 832e4964e7
implement windows 2022-05-06 18:38:39 +02:00
amrbashir bac4dbd1ab
add title & enabled getters 2022-05-06 17:18:34 +02:00