Ctrl drag now adds/removes to selection (#5336)

* refactor: clean up to use for-each loop

* track cards in rect so far and toggle isSelected on change

* only clear selection if ctrl isn't held

* fix build errors
This commit is contained in:
RickyRister 2024-12-26 12:08:20 -08:00 committed by GitHub
parent ca486e5ed9
commit d5ae4eed26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 6 deletions

View file

@ -3,6 +3,8 @@
#include "card_zone.h"
#include <QSet>
/**
* A CardZone where the cards are laid out, with each card directly interactable by clicking.
*/
@ -11,6 +13,7 @@ class SelectZone : public CardZone
Q_OBJECT
private:
QPointF selectionOrigin;
QSet<CardItem *> cardsInSelectionRect;
protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);