Rework card menu handling (#6069)

* extract cardMenu from CardItem

* move cardMenu saving to TabGame

* delete TabGame::updateCardMenu

* move checking to updateCardMenu

* unset activeCard when all cards are unselected
This commit is contained in:
RickyRister 2025-08-15 02:13:28 -03:00 committed by GitHub
parent 1649f30389
commit 03bebbe4c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 106 additions and 123 deletions

View file

@ -33,8 +33,6 @@ private:
CardItem *attachedTo;
QList<CardItem *> attachedCards;
QMenu *cardMenu, *ptMenu, *moveMenu;
void prepareDelete();
void handleClickedToPlay(bool shiftHeld);
public slots:
@ -54,7 +52,7 @@ public:
const CardRef &cardRef = {},
int _cardid = -1,
CardZone *_zone = nullptr);
~CardItem() override;
void retranslateUi();
CardZone *getZone() const
{
@ -135,19 +133,6 @@ public:
void resetState(bool keepAnnotations = false);
void processCardInfo(const ServerInfo_Card &_info);
QMenu *getCardMenu() const
{
return cardMenu;
}
QMenu *getPTMenu() const
{
return ptMenu;
}
QMenu *getMoveMenu() const
{
return moveMenu;
}
bool animationEvent();
CardDragItem *createDragItem(int _id, const QPointF &_pos, const QPointF &_scenePos, bool faceDown);
void deleteDragItem();