Re-layout, add instruction label.

This commit is contained in:
Lukas Brübach 2025-03-16 10:21:11 +01:00
parent 4b984113ce
commit 09a6836858
4 changed files with 21 additions and 9 deletions

View file

@ -63,15 +63,12 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
searchBar = new PrintingSelectorCardSearchWidget(this);
sortAndOptionsLayout->addWidget(searchBar);
sortAndOptionsLayout->addWidget(displayOptionsWidget);
searchAndSetLayout->addWidget(searchBar);
selectSetForCardsButton = new QPushButton(this);
connect(selectSetForCardsButton, &QPushButton::clicked, this, &PrintingSelector::selectSetForCards);
searchAndSetLayout->addWidget(selectSetForCardsButton);
layout->addLayout(searchAndSetLayout);
sortAndOptionsLayout->addWidget(searchBar);
sortAndOptionsLayout->addWidget(selectSetForCardsButton);
sortAndOptionsLayout->addWidget(displayOptionsWidget);
layout->addWidget(sortAndOptionsContainer);
@ -91,6 +88,7 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
void PrintingSelector::retranslateUi()
{
navigationCheckBox->setText(tr("Display Navigation Buttons"));
selectSetForCardsButton->setText(tr("Bulk Selection"));
}
void PrintingSelector::printingsInDeckChanged()

View file

@ -49,7 +49,6 @@ private:
QHBoxLayout *sortAndOptionsLayout;
QCheckBox *navigationCheckBox;
PrintingSelectorCardSortingWidget *sortToolBar;
QHBoxLayout *searchAndSetLayout;
PrintingSelectorCardSearchWidget *searchBar;
QPushButton *selectSetForCardsButton;
FlowWidget *flowWidget;

View file

@ -25,12 +25,14 @@ DlgSelectSetForCards::DlgSelectSetForCards(QWidget *parent, DeckListModel *_mode
setMinimumSize(500, 500);
setAcceptDrops(true);
instructionLabel = new QLabel(this);
instructionLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
// Main vertical splitter
QSplitter *splitter = new QSplitter(Qt::Vertical, this);
mainLayout->addWidget(splitter);
// Top scroll area
scrollArea = new QScrollArea(this);
@ -100,7 +102,6 @@ DlgSelectSetForCards::DlgSelectSetForCards(QWidget *parent, DeckListModel *_mode
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOK()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
splitter->addWidget(buttonBox);
// Set stretch factors
splitter->setStretchFactor(0, 6); // Scroll area gets more space
@ -112,6 +113,18 @@ DlgSelectSetForCards::DlgSelectSetForCards(QWidget *parent, DeckListModel *_mode
connect(this, &DlgSelectSetForCards::orderChanged, this, &DlgSelectSetForCards::updateLayoutOrder);
connect(this, &DlgSelectSetForCards::widgetOrderChanged, this, &DlgSelectSetForCards::updateCardLists);
mainLayout->addWidget(instructionLabel);
mainLayout->addWidget(splitter);
mainLayout->addWidget(buttonBox);
retranslateUi();
}
void DlgSelectSetForCards::retranslateUi()
{
instructionLabel->setText(tr("Check Sets to enable them. Drag-and-Drop to reorder them and change their "
"priority. Cards will use the printing of the highest priority enabled set."));
}
void DlgSelectSetForCards::actOK()

View file

@ -20,6 +20,7 @@ class DlgSelectSetForCards : public QDialog
public:
explicit DlgSelectSetForCards(QWidget *parent, DeckListModel *_model);
void retranslateUi();
void sortSetsByCount();
QMap<QString, QStringList> getCardsForSets();
QMap<QString, QStringList> getModifiedCards();
@ -40,6 +41,7 @@ public slots:
private:
QVBoxLayout *layout;
QLabel *instructionLabel;
QScrollArea *scrollArea;
QScrollArea *uneditedCardsArea;
FlowWidget *uneditedCardsFlowWidget;