mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-17 16:02:14 -07:00
Performance fixes, hide sets which can't offer any new cards, better dragging indicators.
This commit is contained in:
parent
b11d3e0c55
commit
669e9e42f6
2 changed files with 120 additions and 64 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "../client/ui/widgets/general/layout_containers/flow_widget.h"
|
||||
#include "../deck/deck_list_model.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDialog>
|
||||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
|
|
@ -11,7 +12,6 @@
|
|||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
class QCheckBox;
|
||||
class SetEntryWidget; // Forward declaration
|
||||
|
||||
class DlgSelectSetForCards : public QDialog
|
||||
|
|
@ -20,16 +20,19 @@ class DlgSelectSetForCards : public QDialog
|
|||
|
||||
public:
|
||||
explicit DlgSelectSetForCards(QWidget *parent, DeckListModel *_model);
|
||||
void actOK();
|
||||
void sortSetsByCount();
|
||||
QMap<QString, QStringList> getCardsForSets();
|
||||
QMap<QString, QStringList> getModifiedCards();
|
||||
void updateLayoutOrder();
|
||||
QVBoxLayout *listLayout;
|
||||
QList<SetEntryWidget *> entry_widgets;
|
||||
QMap<QString, QStringList> cardsForSets;
|
||||
|
||||
public slots:
|
||||
void updateCardLists();
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
void actOK();
|
||||
|
||||
private:
|
||||
QVBoxLayout *layout;
|
||||
|
|
@ -52,17 +55,23 @@ class SetEntryWidget : public QWidget
|
|||
|
||||
public:
|
||||
explicit SetEntryWidget(DlgSelectSetForCards *parent, const QString &setName, int count);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void toggleExpansion();
|
||||
void checkVisibility();
|
||||
QStringList getAllCardsForSet();
|
||||
void populateCardList();
|
||||
void updateCardDisplayWidgets();
|
||||
void updateCardState(bool checked);
|
||||
bool isChecked() const;
|
||||
DlgSelectSetForCards *parent;
|
||||
QString setName;
|
||||
bool expanded;
|
||||
|
||||
public slots:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void enterEvent(QEnterEvent *event) override;
|
||||
void leaveEvent(QEvent *event) override;
|
||||
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||
|
||||
private:
|
||||
QVBoxLayout *layout;
|
||||
QCheckBox *checkBox;
|
||||
|
|
@ -73,6 +82,8 @@ private:
|
|||
QLabel *alreadySelectedCardsLabel;
|
||||
FlowWidget *alreadySelectedCardListContainer;
|
||||
QVBoxLayout *cardListLayout;
|
||||
QStringList possibleCards;
|
||||
QStringList unusedCards;
|
||||
};
|
||||
|
||||
#endif // DLG_SELECT_SET_FOR_CARDS_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue