diff options
author | 2021-07-12 22:01:57 +0200 | |
---|---|---|
committer | 2021-07-12 22:01:57 +0200 | |
commit | b57d567981bb7ef5f9ff397c210778f211d2de5b (patch) | |
tree | 4b90afbc76cee8df6e3196883d2c55e5691aaf62 /examples | |
parent | 735cfb790813c44852612400e31c0190b9c641a6 (diff) | |
download | iced-b57d567981bb7ef5f9ff397c210778f211d2de5b.tar.gz iced-b57d567981bb7ef5f9ff397c210778f211d2de5b.tar.bz2 iced-b57d567981bb7ef5f9ff397c210778f211d2de5b.zip |
Use `bitflags` for `keyboard::Modifiers`
Diffstat (limited to 'examples')
-rw-r--r-- | examples/menu/src/main.rs | 14 | ||||
-rw-r--r-- | examples/pane_grid/src/main.rs | 2 |
2 files changed, 3 insertions, 13 deletions
diff --git a/examples/menu/src/main.rs b/examples/menu/src/main.rs index 9d4ed71b..7403713c 100644 --- a/examples/menu/src/main.rs +++ b/examples/menu/src/main.rs @@ -43,18 +43,8 @@ impl Application for App { } fn menu(&self) -> Menu<Message> { - let alt = Modifiers { - alt: true, - control: false, - logo: false, - shift: false, - }; - let ctrl_shift = Modifiers { - control: true, - shift: true, - logo: false, - alt: false, - }; + let alt = Modifiers::ALT; + let ctrl_shift = Modifiers::CTRL | Modifiers::SHIFT; Menu::with_entries(vec![ menu::Entry::dropdown( diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 81cf1770..3bd8aa25 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -146,7 +146,7 @@ impl Application for Example { Event::Keyboard(keyboard::Event::KeyPressed { modifiers, key_code, - }) if modifiers.is_command_pressed() => handle_hotkey(key_code), + }) if modifiers.command() => handle_hotkey(key_code), _ => None, } }) |