mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Re-layout, add instruction label.
This commit is contained in:
parent
4b984113ce
commit
09a6836858
4 changed files with 21 additions and 9 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ private:
|
|||
QHBoxLayout *sortAndOptionsLayout;
|
||||
QCheckBox *navigationCheckBox;
|
||||
PrintingSelectorCardSortingWidget *sortToolBar;
|
||||
QHBoxLayout *searchAndSetLayout;
|
||||
PrintingSelectorCardSearchWidget *searchBar;
|
||||
QPushButton *selectSetForCardsButton;
|
||||
FlowWidget *flowWidget;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue