adjust opacity on disabled toggle background

This commit is contained in:
laserpants 2016-05-29 22:25:43 +03:00
parent 4a56c3229b
commit 76817345c1
1 changed files with 7 additions and 1 deletions

View File

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