mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-16 07:22:16 -07:00
[VDD] Saner and more performant color filtering, allow deleting specific filter from filterTree (#5863)
* Saner and more performant color filtering. * Update visual_database_display_color_filter_widget.cpp --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: Zach H <zahalpern+github@gmail.com>
This commit is contained in:
parent
795149e776
commit
acd9a163f0
8 changed files with 198 additions and 130 deletions
|
|
@ -20,12 +20,17 @@ ManaSymbolWidget::ManaSymbolWidget(QWidget *parent, QString _symbol, bool _isAct
|
|||
&ManaSymbolWidget::updateOpacity);
|
||||
}
|
||||
|
||||
void ManaSymbolWidget::toggleSymbol()
|
||||
{
|
||||
setColorActive(!isActive);
|
||||
emit colorToggled(getSymbolChar(), isActive);
|
||||
}
|
||||
|
||||
void ManaSymbolWidget::setColorActive(bool active)
|
||||
{
|
||||
if (isActive != active) {
|
||||
isActive = active;
|
||||
updateOpacity();
|
||||
emit colorToggled(getSymbolChar(), isActive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -46,9 +51,7 @@ void ManaSymbolWidget::mousePressEvent(QMouseEvent *event)
|
|||
{
|
||||
Q_UNUSED(event);
|
||||
if (mayBeToggled) {
|
||||
isActive = !isActive;
|
||||
updateOpacity();
|
||||
emit colorToggled(getSymbolChar(), isActive);
|
||||
toggleSymbol();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,13 @@ class ManaSymbolWidget : public QLabel
|
|||
|
||||
public:
|
||||
ManaSymbolWidget(QWidget *parent, QString symbol, bool isActive = true, bool mayBeToggled = false);
|
||||
void toggleSymbol();
|
||||
void setColorActive(bool active);
|
||||
void updateOpacity();
|
||||
bool isColorActive() const;
|
||||
bool isColorActive() const
|
||||
{
|
||||
return isActive;
|
||||
};
|
||||
QString getSymbol() const
|
||||
{
|
||||
return symbol;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue