Skip to content

Commit

Permalink
desktop: Fix open advanced shortcut
Browse files Browse the repository at this point in the history
egui expects most specific shortcuts to be checked first, previously
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd> would open the normal file dialog.
  • Loading branch information
sleepycatcoding committed Jul 8, 2024
1 parent 62fd898 commit ab9bbd3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions desktop/src/gui/menu_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ impl MenuBar {
egui::TopBottomPanel::top("menu_bar").show(egui_ctx, |ui| {
// TODO(mike): Make some MenuItem struct with shortcut info to handle this more cleanly.
if ui.ctx().input_mut(|input| {
input.consume_shortcut(&KeyboardShortcut::new(Modifiers::COMMAND, Key::O))
input.consume_shortcut(&KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::O))
}) {
self.open_file(ui);
dialogs.open_file_advanced();
}
if ui.ctx().input_mut(|input| {
input.consume_shortcut(&KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::O))
input.consume_shortcut(&KeyboardShortcut::new(Modifiers::COMMAND, Key::O))
}) {
dialogs.open_file_advanced();
self.open_file(ui);
}
if ui.ctx().input_mut(|input| {
input.consume_shortcut(&KeyboardShortcut::new(Modifiers::COMMAND, Key::Q))
Expand Down

0 comments on commit ab9bbd3

Please sign in to comment.