fix gradients in bar

This commit is contained in:
Talley Lambert
2021-04-26 09:57:34 -04:00
parent 7d323240be
commit b651e2b757
2 changed files with 9 additions and 7 deletions

View File

@@ -9,27 +9,27 @@ QSlider {
QSlider::groove:horizontal {
border: 0px;
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #777, stop:1 #aaa);
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #888, stop:1 #ddd);
height: 20px;
border-radius: 10px;
}
QSlider::handle {
background: qradialgradient(cx:0, cy:0, radius: 1.2, fx:0.5,
fy:0.5, stop:0 #eef, stop:1 #000);
background: qradialgradient(cx:0, cy:0, radius: 1.2, fx:0.35,
fy:0.3, stop:0 #eef, stop:1 #002);
height: 20px;
width: 20px;
border-radius: 10px;
}
QSlider::sub-page:horizontal {
background: #447;
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #227, stop:1 #77a);
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
QRangeSlider {
qproperty-barColor: #447;
qproperty-barColor: "qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #227, stop:1 #77a)";
}
"""

View File

@@ -202,9 +202,11 @@ class QRangeSlider(QSlider):
return self._style.brush_active or QtGui.QColor()
def _setBarColor(self, color):
self._style.brush_active = color
from ._style import parse_color
barColor = Property(QtGui.QColor, _getBarColor, _setBarColor)
self._style.brush_active = parse_color(color)
barColor = Property(str, _getBarColor, _setBarColor)
def _drawBar(self, painter: QStylePainter, opt: QStyleOptionSlider):