Reintroduce unused color identity opacity (#5733)

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-03-17 00:05:38 +01:00 committed by GitHub
parent 37382dea44
commit bd28e04635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,7 @@
#include "mana_symbol_widget.h"
#include "../../../../../settings/cache_settings.h"
#include <QResizeEvent>
ManaSymbolWidget::ManaSymbolWidget(QWidget *parent, QString _symbol, bool _isActive, bool _mayBeToggled)
@ -26,7 +28,14 @@ void ManaSymbolWidget::setColorActive(bool active)
void ManaSymbolWidget::updateOpacity()
{
qreal opacity = isActive ? 1.0 : 0.5;
qreal opacity;
if (mayBeToggled) {
// UI elements that users can click on shouldn't be transparent.
opacity = isActive ? 1.0 : 0.5;
} else {
// It's just for display, they can do whatever they want.
opacity = isActive ? 1.0 : SettingsCache::instance().getVisualDeckStorageUnusedColorIdentitiesOpacity() / 100.0;
}
opacityEffect->setOpacity(opacity);
}