Make the shortcut list browsable and searchable

Replace the flat QTableWidget with a QTreeWidget that groups actions under
one collapsible top-level node per category. Fix the search box so it also
matches the current key sequence (exactly), accepts multi-keyword queries
(AND, any word order) and is accent-insensitive, auto-expands matching
groups and shows an "N actions" count. Add a quick filter (all / bound /
unbound / conflicts) that combines with the text query. Conflict detection,
per-row reset, reset-all and persistence are preserved.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-08-17 12:30:23 +12:00
parent 7307a59c10
commit e9ee8b600b
2 changed files with 195 additions and 43 deletions
+20 -2
View File
@@ -22,9 +22,12 @@
#include <QKeySequence>
class QComboBox;
class QKeySequenceEdit;
class QLabel;
class QLineEdit;
class QTableWidget;
class QTreeWidget;
class QTreeWidgetItem;
/**
@brief The ShortcutsConfigPage class
@@ -47,21 +50,36 @@ class ShortcutsConfigPage : public ConfigPage
private slots:
void filterRows(const QString &filter_text);
void quickFilterChanged(int index);
void checkConflicts();
void resetAllRows();
private:
enum QuickFilter {
ShowAll = 0,
BoundOnly,
UnboundOnly,
ConflictsOnly
};
struct Row {
QString id;
QString category;
QString description;
QKeySequence default_sequence;
QKeySequenceEdit *edit;
QTreeWidgetItem *item;
bool conflicted;
};
void populateTable();
void applyFilter();
void resetRow(int row_index);
QLineEdit *m_filter_edit;
QTableWidget *m_table;
QComboBox *m_quick_filter;
QLabel *m_count_label;
QTreeWidget *m_tree;
QList<Row> m_rows;
};