mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
Keep Essence selection and mode inside one fixed-width popup to prevent toolbar clipping
This commit is contained in:
parent
c4b513bb24
commit
08e0eb3dab
1 changed files with 9 additions and 0 deletions
|
|
@ -7,6 +7,8 @@
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
class QMenu;
|
class QMenu;
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QWidget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compact, reusable multi-select Essence picker for the deck and card database
|
* Compact, reusable multi-select Essence picker for the deck and card database
|
||||||
|
|
@ -23,16 +25,23 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] QSet<QChar> activeEssences() const;
|
[[nodiscard]] QSet<QChar> activeEssences() const;
|
||||||
void setEssenceActive(QChar essence, bool active);
|
void setEssenceActive(QChar essence, bool active);
|
||||||
|
// Put the host's filtering mode selector inside this popup too:
|
||||||
|
// neither toolbar should require a separate cramped control.
|
||||||
|
void addPopupControl(QWidget *control);
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void essenceToggled(QChar essence, bool active);
|
void essenceToggled(QChar essence, bool active);
|
||||||
|
// A clear request removes ALL Essence filters, including exclusions,
|
||||||
|
// rather than creating fifteen negative filters in Exact/Exclude mode.
|
||||||
|
void selectionCleared();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateSummary();
|
void updateSummary();
|
||||||
|
|
||||||
QHash<QChar, QToolButton *> buttons;
|
QHash<QChar, QToolButton *> buttons;
|
||||||
QMenu *popupMenu = nullptr;
|
QMenu *popupMenu = nullptr;
|
||||||
|
QVBoxLayout *panelLayout = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONTINUUMATRICE_ESSENCE_FILTER_PICKER_H
|
#endif // CONTINUUMATRICE_ESSENCE_FILTER_PICKER_H
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue