From 029ccefe225a35dc491411357db3888a61632291 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Mon, 15 Jan 2024 14:26:17 -0500 Subject: [PATCH] Only perform group sort when GroupView is focused * Fixes #10195 --- docs/topics/KeyboardShortcuts.adoc | 4 ++++ src/gui/group/GroupView.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/topics/KeyboardShortcuts.adoc b/docs/topics/KeyboardShortcuts.adoc index 8d8ab6ca0..034633659 100644 --- a/docs/topics/KeyboardShortcuts.adoc +++ b/docs/topics/KeyboardShortcuts.adoc @@ -33,6 +33,10 @@ NOTE: On macOS please substitute `Ctrl` with `Cmd` (aka `⌘`). |Trigger AutoType | Ctrl + Shift + V |Add key to SSH Agent | Ctrl + H |Remove key from SSH Agent | Ctrl + Shift + H +|Move entry up (if unsorted) | Ctrl + Alt + Up +|Move entry down (if unsorted) | Ctrl + Alt + Down +|Sort Groups A-Z | Ctrl + Down +|Sort Groups Z-A | Ctrl + Up |Minimize Window | Ctrl + M |Hide Window | Ctrl + Shift + M |Select Next Database Tab | Ctrl + Tab ; Ctrl + PageDn diff --git a/src/gui/group/GroupView.cpp b/src/gui/group/GroupView.cpp index 5ffcc5d94..75c3a972e 100644 --- a/src/gui/group/GroupView.cpp +++ b/src/gui/group/GroupView.cpp @@ -46,10 +46,10 @@ GroupView::GroupView(Database* db, QWidget* parent) new QShortcut(Qt::CTRL + Qt::Key_F10, this, SLOT(contextMenuShortcutPressed()), nullptr, Qt::WidgetShortcut); // keyboard shortcuts to sort children of a group - auto shortcut = new QShortcut(Qt::CTRL + Qt::Key_Down, this); + auto shortcut = new QShortcut(Qt::CTRL + Qt::Key_Down, this, nullptr, nullptr, Qt::WidgetShortcut); connect(shortcut, &QShortcut::activated, this, [this]() { sortGroups(false); }); - shortcut = new QShortcut(Qt::CTRL + Qt::Key_Up, this); + shortcut = new QShortcut(Qt::CTRL + Qt::Key_Up, this, nullptr, nullptr, Qt::WidgetShortcut); connect(shortcut, &QShortcut::activated, this, [this]() { sortGroups(true); }); modelReset();