mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
refactored deck editor UI key shortcuts
The global shortcuts were removed in favor of key events which are only triggered when a widget has focus. This is necessary to allow different widgets to react differently to the 'enter' key. The current key configuration is: search edit focused: * left/right: decrease/increase card count for selected database card * enter: add selected card to deck * ctrl-enter: add selected card to deck sideboard * ctrl-left/right: decrease/increase card count in sideboard for selected card database focused: the same as with search edit. deckview focused: * left/right: decrease/increase card count for selected deckview card * enter: increase count for selected deckview card * delete/backspace: delete selected card from deck
This commit is contained in:
parent
f6e9676c75
commit
2b7ea0c983
9 changed files with 212 additions and 30 deletions
|
|
@ -45,6 +45,8 @@ public:
|
|||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role);
|
||||
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
|
||||
|
||||
QModelIndex findCard(const QString &cardName, const QString &zoneName) const;
|
||||
QModelIndex addCard(const QString &cardName, const QString &zoneName);
|
||||
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
void cleanList();
|
||||
|
|
@ -56,6 +58,7 @@ private:
|
|||
InnerDecklistNode *root;
|
||||
InnerDecklistNode *createNodeIfNeeded(const QString &name, InnerDecklistNode *parent);
|
||||
QModelIndex nodeToIndex(AbstractDecklistNode *node) const;
|
||||
DecklistModelCardNode *findCardNode(const QString &cardName, const QString &zoneName) const;
|
||||
void emitRecursiveUpdates(const QModelIndex &index);
|
||||
void sortHelper(InnerDecklistNode *node, Qt::SortOrder order);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue