improv(menu): simplify menu construction.

- Added `MenuAction` trait to call the `message` method on button press.
- Added two new methods to construct a MenuTree.
- Added MenuItem enum to represent an action or a separator in a MenuTree.
- Added menu example.
- Moved Modifier enum and KeyBind struct to libcosmic.
- Moved menu_button macro to libcosmic.
This commit is contained in:
Eduardo Flores 2024-03-16 15:38:26 -07:00 committed by Jeremy Soller
parent 9e6d94c7eb
commit 0b47efe1de
6 changed files with 346 additions and 0 deletions

14
examples/menu/Cargo.toml Normal file
View file

@ -0,0 +1,14 @@
[package]
name = "menu"
version = "0.1.0"
edition = "2021"
[dependencies]
tracing = "0.1.37"
tracing-subscriber = "0.3.17"
tracing-log = "0.2.0"
[dependencies.libcosmic]
path = "../../"
default-features = false
features = ["debug", "winit", "tokio", "xdg-portal"]