mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 23:53:54 -07:00
Add card selection counter (#6685)
* feat(game): add drag selection counter overlay Display count of selected cards inside the lasso during drag selection. Count appears near cursor, repositioning to stay within selection bounds. Includes SelectionRubberBand subclass to allow label to appear above band. QRubberBand calls raise() in showEvent/changeEvent to stay on top - this subclass suppresses that behavior so dragCountLabel can be visible. Adds user setting to enable/disable the drag count overlay. * feat(game): add persistent selection counter overlay. Display total count of selected cards in bottom-right corner when multiple cards are selected. Updates on selection changes and window resize. The counter connects to QGraphicsScene::selectionChanged to stay up-to-date without requiring manual refresh. Adds user setting to enable/disable the total count overlay. --------- Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
parent
69c046cca4
commit
fc453c68a7
9 changed files with 170 additions and 11 deletions
|
|
@ -340,6 +340,8 @@ private:
|
|||
bool isPortableBuild;
|
||||
bool roundCardCorners;
|
||||
bool showStatusBar;
|
||||
bool showDragSelectionCount;
|
||||
bool showTotalSelectionCount;
|
||||
|
||||
public:
|
||||
SettingsCache();
|
||||
|
|
@ -455,6 +457,14 @@ public:
|
|||
{
|
||||
return showStatusBar;
|
||||
}
|
||||
[[nodiscard]] bool getShowDragSelectionCount() const
|
||||
{
|
||||
return showDragSelectionCount;
|
||||
}
|
||||
[[nodiscard]] bool getShowTotalSelectionCount() const
|
||||
{
|
||||
return showTotalSelectionCount;
|
||||
}
|
||||
[[nodiscard]] bool getNotificationsEnabled() const
|
||||
{
|
||||
return notificationsEnabled;
|
||||
|
|
@ -1120,5 +1130,7 @@ public slots:
|
|||
void setUpdateReleaseChannelIndex(int value);
|
||||
void setMaxFontSize(int _max);
|
||||
void setRoundCardCorners(bool _roundCardCorners);
|
||||
void setShowDragSelectionCount(QT_STATE_CHANGED_T _showDragSelectionCount);
|
||||
void setShowTotalSelectionCount(QT_STATE_CHANGED_T _showTotalSelectionCount);
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue