[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:
BruebachL 2025-04-20 06:15:28 +02:00 committed by GitHub
parent 795149e776
commit acd9a163f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 198 additions and 130 deletions

View file

@ -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();
}
}

View file

@ -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;