mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 01:24:46 -07:00
Reintroduce unused color identity opacity (#5733)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
37382dea44
commit
bd28e04635
1 changed files with 10 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
#include "mana_symbol_widget.h"
|
#include "mana_symbol_widget.h"
|
||||||
|
|
||||||
|
#include "../../../../../settings/cache_settings.h"
|
||||||
|
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
|
||||||
ManaSymbolWidget::ManaSymbolWidget(QWidget *parent, QString _symbol, bool _isActive, bool _mayBeToggled)
|
ManaSymbolWidget::ManaSymbolWidget(QWidget *parent, QString _symbol, bool _isActive, bool _mayBeToggled)
|
||||||
|
|
@ -26,7 +28,14 @@ void ManaSymbolWidget::setColorActive(bool active)
|
||||||
|
|
||||||
void ManaSymbolWidget::updateOpacity()
|
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);
|
opacityEffect->setOpacity(opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue