adjust opacity on disabled toggle background
This commit is contained in:
parent
4a56c3229b
commit
76817345c1
|
@ -117,7 +117,13 @@ void ToggleTrack::paintEvent(QPaintEvent *event)
|
|||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
QBrush brush;
|
||||
brush.setColor(_trackColor);
|
||||
if (_toggle->isEnabled()) {
|
||||
brush.setColor(_trackColor);
|
||||
} else {
|
||||
QColor disabledColor = _trackColor;
|
||||
disabledColor.setAlpha(80);
|
||||
brush.setColor(disabledColor);
|
||||
}
|
||||
brush.setStyle(Qt::SolidPattern);
|
||||
painter.setBrush(brush);
|
||||
|
||||
|
|
Loading…
Reference in New Issue