Only perform group sort when GroupView is focused

* Fixes #10195
This commit is contained in:
Jonathan White 2024-01-15 14:26:17 -05:00
parent 994c5b733a
commit bb856f89b9
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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();