mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Add a widget explaining the click and drag to sort functionality.
This commit is contained in:
parent
fb20365ea0
commit
c90c453464
2 changed files with 13 additions and 0 deletions
|
|
@ -46,6 +46,8 @@ VisualDeckEditorWidget::VisualDeckEditorWidget(QWidget *parent, DeckListModel *_
|
|||
|
||||
sortCriteriaButton = new SettingsButtonWidget(this);
|
||||
|
||||
sortLabel = new QLabel(sortCriteriaButton);
|
||||
|
||||
QStringList sortProperties = {"colors", "cmc", "name", "maintype"};
|
||||
sortByListWidget = new QListWidget();
|
||||
sortByListWidget->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
|
|
@ -63,6 +65,8 @@ VisualDeckEditorWidget::VisualDeckEditorWidget(QWidget *parent, DeckListModel *_
|
|||
actChangeActiveSortCriteria();
|
||||
|
||||
sortByListWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
|
||||
sortCriteriaButton->addSettingsWidget(sortLabel);
|
||||
sortCriteriaButton->addSettingsWidget(sortByListWidget);
|
||||
|
||||
groupAndSortLayout->addWidget(groupByComboBox);
|
||||
|
|
@ -89,6 +93,13 @@ VisualDeckEditorWidget::VisualDeckEditorWidget(QWidget *parent, DeckListModel *_
|
|||
mainLayout->addWidget(groupAndSortContainer);
|
||||
mainLayout->addWidget(scrollArea);
|
||||
mainLayout->addWidget(overlapControlWidget);
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void VisualDeckEditorWidget::retranslateUi()
|
||||
{
|
||||
sortLabel->setText(tr("Click and drag to change\nthe sort order within the groups"));
|
||||
}
|
||||
|
||||
void VisualDeckEditorWidget::updateZoneWidgets()
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class VisualDeckEditorWidget : public QWidget
|
|||
|
||||
public:
|
||||
explicit VisualDeckEditorWidget(QWidget *parent, DeckListModel *deckListModel);
|
||||
void retranslateUi();
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
void setDeckList(const DeckList &_deckListModel);
|
||||
|
|
@ -48,6 +49,7 @@ private:
|
|||
QComboBox *groupByComboBox;
|
||||
QString activeGroupCriteria = "maintype";
|
||||
SettingsButtonWidget *sortCriteriaButton;
|
||||
QLabel *sortLabel;
|
||||
QListWidget *sortByListWidget;
|
||||
QStringList activeSortCriteria = {"name", "cmc", "colors", "maintype"};
|
||||
QScrollArea *scrollArea;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue