mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
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.
This commit is contained in:
parent
2b2a6db081
commit
8b20fa0425
9 changed files with 117 additions and 11 deletions
|
|
@ -821,6 +821,10 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
connect(&annotateTokensCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
&SettingsCache::setAnnotateTokens);
|
||||
|
||||
showDragSelectionCountCheckBox.setChecked(SettingsCache::instance().getShowDragSelectionCount());
|
||||
connect(&showDragSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
&SettingsCache::setShowDragSelectionCount);
|
||||
|
||||
useTearOffMenusCheckBox.setChecked(SettingsCache::instance().getUseTearOffMenus());
|
||||
connect(&useTearOffMenusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance(),
|
||||
[](const QT_STATE_CHANGED_T state) { SettingsCache::instance().setUseTearOffMenus(state == Qt::Checked); });
|
||||
|
|
@ -833,7 +837,8 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
generalGrid->addWidget(&closeEmptyCardViewCheckBox, 4, 0);
|
||||
generalGrid->addWidget(&focusCardViewSearchBarCheckBox, 5, 0);
|
||||
generalGrid->addWidget(&annotateTokensCheckBox, 6, 0);
|
||||
generalGrid->addWidget(&useTearOffMenusCheckBox, 7, 0);
|
||||
generalGrid->addWidget(&showDragSelectionCountCheckBox, 7, 0);
|
||||
generalGrid->addWidget(&useTearOffMenusCheckBox, 8, 0);
|
||||
|
||||
generalGroupBox = new QGroupBox;
|
||||
generalGroupBox->setLayout(generalGrid);
|
||||
|
|
@ -955,6 +960,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
|||
closeEmptyCardViewCheckBox.setText(tr("Close card view window when last card is removed"));
|
||||
focusCardViewSearchBarCheckBox.setText(tr("Auto focus search bar when card view window is opened"));
|
||||
annotateTokensCheckBox.setText(tr("Annotate card text on tokens"));
|
||||
showDragSelectionCountCheckBox.setText(tr("Show selection counter during drag selection"));
|
||||
useTearOffMenusCheckBox.setText(tr("Use tear-off menus, allowing right click menus to persist on screen"));
|
||||
notificationsGroupBox->setTitle(tr("Notifications settings"));
|
||||
notificationsEnabledCheckBox.setText(tr("Enable notifications in taskbar"));
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ private:
|
|||
QCheckBox closeEmptyCardViewCheckBox;
|
||||
QCheckBox focusCardViewSearchBarCheckBox;
|
||||
QCheckBox annotateTokensCheckBox;
|
||||
QCheckBox showDragSelectionCountCheckBox;
|
||||
QCheckBox useTearOffMenusCheckBox;
|
||||
QCheckBox tapAnimationCheckBox;
|
||||
QCheckBox openDeckInNewTabCheckBox;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue