add sort options to card view window (#5206)

* refactor to allow for sorting by property of choice

* implement thing

* prevent overlapping sort properties

* enable/disable pile view checkbox if groupBy is off

* fix compiler warnings

* check to disable pile view checkbox on init

* Fix builds on Qt5

* Fix builds on Qt5

---------

Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
This commit is contained in:
RickyRister 2024-11-29 09:53:06 -08:00 committed by GitHub
parent 37bb1367db
commit 17eabf2004
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 183 additions and 80 deletions

View file

@ -32,7 +32,7 @@ private:
void handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint);
CardZone *origZone;
bool revealZone, writeableRevealZone;
bool sortByName, sortByType;
CardList::SortOption groupBy, sortBy;
bool pileView;
struct GridSize
@ -41,7 +41,7 @@ private:
int cols;
};
GridSize positionCardsForDisplay(CardList &cards, bool groupByType = false);
GridSize positionCardsForDisplay(CardList &cards, CardList::SortOption pileOption = CardList::NoSort);
public:
ZoneViewZone(Player *_p,
@ -75,8 +75,8 @@ public:
}
void setWriteableRevealZone(bool _writeableRevealZone);
public slots:
void setSortByName(int _sortByName);
void setSortByType(int _sortByType);
void setGroupBy(CardList::SortOption _groupBy);
void setSortBy(CardList::SortOption _sortBy);
void setPileView(int _pileView);
private slots:
void zoneDumpReceived(const Response &r);