Cockatrice/cockatrice/src/interface/widgets/playmat/playmat_settings_dialog.h
BruebachL 9eafd90a91
[Game] Playmats (#7101)
* [Game] Playmats

Took 19 seconds

Took 1 minute

* [Playmats] Add fixed override and configurable fallbacks to settings.

Took 29 minutes

Took 43 seconds

* Add main to test.

Took 1 minute

Took 29 seconds

* Move settings to own group

Took 11 minutes

* Some attempts to refresh macOS compositor

Took 2 minutes

* Try something else

Took 17 minutes

* Don't manipulate live list

Took 11 minutes

* Change things about resolution, address comments.

Took 45 minutes

Took 12 minutes

* Comments.

Took 14 minutes

Took 8 seconds

* Re-order settings menu location

Took 2 minutes

* Rename PlaymatResolution to Info and add enums

Took 8 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-08-21 10:40:49 +02:00

85 lines
2.3 KiB
C++

#ifndef COCKATRICE_PLAYMAT_SETTINGS_DIALOG_H
#define COCKATRICE_PLAYMAT_SETTINGS_DIALOG_H
#include <QDialog>
#include <QPixmap>
#include <libcockatrice/deck_list/deck_list.h>
class QComboBox;
class QCompleter;
class QDoubleSpinBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class CardDatabaseModel;
class CardDatabaseDisplayModel;
class CardSearchModel;
class CardCompleterProxyModel;
class PlaymatPreviewWidget;
/**
* @brief Dialog for configuring the playmat card art for a deck.
*
* Allows the user to select a card from the database and adjust
* positioning parameters (margins, zoom, vertical offset) for how
* the card art appears as a playmat background across the
* combined table + stack play area.
*/
class PlaymatSettingsDialog : public QDialog
{
Q_OBJECT
public:
explicit PlaymatSettingsDialog(const CardRef &initialCard = {},
const PlaymatParams &initialParams = {},
QWidget *parent = nullptr);
CardRef card() const;
PlaymatParams params() const;
private slots:
void onCardNameChanged(const QString &name);
void reloadPreview();
void onParamChanged();
private:
void setupUi();
void populateProviderCombo(const QString &cardName);
void initializeSearchBar();
void retranslateUi();
QDoubleSpinBox *makeSpinBox(double min, double max, double value, double step);
QLineEdit *searchBar;
QCompleter *completer;
CardDatabaseModel *cardDatabaseModel;
CardDatabaseDisplayModel *cardDatabaseDisplayModel;
CardSearchModel *searchModel;
CardCompleterProxyModel *proxyModel;
QComboBox *providerComboBox;
QMetaObject::Connection pixmapUpdatedConnection;
QLabel *cardNameLabel;
QLabel *printingLabel;
QLabel *leftMarginLabel;
QLabel *rightMarginLabel;
QLabel *verticalOffsetLabel;
QLabel *zoomLabel;
QGroupBox *controlsGroup;
QGroupBox *previewGroup;
QPushButton *removeButton;
QDoubleSpinBox *marginLSpin;
QDoubleSpinBox *marginRSpin;
QDoubleSpinBox *verticalOffsetSpin;
QDoubleSpinBox *zoomSpin;
PlaymatPreviewWidget *preview;
QPixmap currentPixmap;
CardRef currentCard;
PlaymatParams currentParams;
};
#endif // COCKATRICE_PLAYMAT_SETTINGS_DIALOG_H