mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
add function to sort hand by type and name
This commit is contained in:
parent
8ea4490441
commit
eb3ae97ac1
2 changed files with 10 additions and 0 deletions
|
|
@ -127,6 +127,15 @@ void HandZone::reorganizeCards()
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HandZone::sortHand()
|
||||||
|
{
|
||||||
|
if (cards.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cards.sortBy({CardList::SortByType, CardList::SortByName});
|
||||||
|
reorganizeCards();
|
||||||
|
}
|
||||||
|
|
||||||
void HandZone::setWidth(qreal _width)
|
void HandZone::setWidth(qreal _width)
|
||||||
{
|
{
|
||||||
if (SettingsCache::instance().getHorizontalHand()) {
|
if (SettingsCache::instance().getHorizontalHand()) {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ public:
|
||||||
QRectF boundingRect() const override;
|
QRectF boundingRect() const override;
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||||
void reorganizeCards() override;
|
void reorganizeCards() override;
|
||||||
|
void sortHand();
|
||||||
void setWidth(qreal _width);
|
void setWidth(qreal _width);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue