From ff0dfb83314f62cefaba3da09ae89afce946826e Mon Sep 17 00:00:00 2001 From: Gaspar Capello Date: Mon, 23 Dec 2024 17:01:43 -0300 Subject: [PATCH] Fix regression: empty Edit > Keyboard Shortcuts > Action Modifiers (fix #4893) --- src/app/commands/cmd_keyboard_shortcuts.cpp | 6 +++--- src/app/ui/key.h | 2 +- src/app/ui/keyboard_shortcuts.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp index 749ea3b8e..9e334989a 100644 --- a/src/app/commands/cmd_keyboard_shortcuts.cpp +++ b/src/app/commands/cmd_keyboard_shortcuts.cpp @@ -582,10 +582,10 @@ private: fillWheelActionsList(); fillDragActionsList(); + // Fill the 'Commands' and 'Action Modifier' lists for (const KeyPtr& key : m_keys) { - if (key->type() == KeyType::Tool || key->type() == KeyType::Quicktool || - key->type() == KeyType::WheelAction || key->type() == KeyType::DragAction || - key->isListed()) { + if ((key->type() == KeyType::Command && !key->isCommandListed()) && + (key->type() != KeyType::Action)) { continue; } diff --git a/src/app/ui/key.h b/src/app/ui/key.h index 99334fe4b..d23507441 100644 --- a/src/app/ui/key.h +++ b/src/app/ui/key.h @@ -131,7 +131,7 @@ public: const KeyboardShortcuts& globalKeys) const; bool isPressed() const; bool isLooselyPressed() const; - bool isListed() const; + bool isCommandListed() const; bool hasAccel(const ui::Accelerator& accel) const; bool hasUserDefinedAccels() const; diff --git a/src/app/ui/keyboard_shortcuts.cpp b/src/app/ui/keyboard_shortcuts.cpp index 52dbb9379..3f6a59a37 100644 --- a/src/app/ui/keyboard_shortcuts.cpp +++ b/src/app/ui/keyboard_shortcuts.cpp @@ -536,9 +536,9 @@ bool Key::isLooselyPressed() const return false; } -bool Key::isListed() const +bool Key::isCommandListed() const { - return type() != KeyType::Command || !command()->isListed(params()); + return type() == KeyType::Command && command()->isListed(params()); } bool Key::hasAccel(const ui::Accelerator& accel) const