From 83581c1ea3ebd50c593d06731c05862bf265fa76 Mon Sep 17 00:00:00 2001
From: sleepycatcoding <131554884+sleepycatcoding@users.noreply.github.com>
Date: Mon, 8 Jul 2024 15:21:38 +0300
Subject: [PATCH] desktop: Fix open advanced shortcut
egui expects most specific shortcuts to be checked first, previously
Ctrl + Shift + O would open the normal file dialog.
---
desktop/src/gui/menu_bar.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/desktop/src/gui/menu_bar.rs b/desktop/src/gui/menu_bar.rs
index 11dbf5625776..70a2d654b2da 100644
--- a/desktop/src/gui/menu_bar.rs
+++ b/desktop/src/gui/menu_bar.rs
@@ -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))