Add feature to sort groups using shortcut keys (#6999)

* Register Ctrl + Down to sort A->Z and Ctrl + Up to sort Z->A
This commit is contained in:
Gaurav Pruthi 2021-10-01 20:24:15 +05:30 committed by GitHub
parent 6d1fc31e96
commit 405d3ee1ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,13 @@ GroupView::GroupView(Database* db, QWidget* parent)
new QShortcut(Qt::CTRL + Qt::Key_F10, this, SLOT(contextMenuShortcutPressed()), nullptr, Qt::WidgetShortcut); 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);
connect(shortcut, &QShortcut::activated, this, [this]() { sortGroups(false); });
shortcut = new QShortcut(Qt::CTRL + Qt::Key_Up, this);
connect(shortcut, &QShortcut::activated, this, [this]() { sortGroups(true); });
modelReset(); modelReset();
setDragEnabled(true); setDragEnabled(true);