提交 b25ecf90 编写于 作者: 之一Yo's avatar 之一Yo

修复单选按钮禁用时的样式问题 (#276)

上级 fd1b2443
......@@ -200,7 +200,7 @@ RadioButton::indicator:checked:pressed {
}
RadioButton:disabled {
color: rgb(150, 150, 150);
color: rgba(255, 255, 255, 0.3628);
}
RadioButton::indicator:disabled {
......@@ -208,6 +208,15 @@ RadioButton::indicator:disabled {
background-color: transparent;
}
RadioButton::indicator:disabled:checked {
border: none;
background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5,
stop:0 rgb(0, 0, 0),
stop:0.5 rgb(0, 0, 0),
stop:0.6 rgba(255, 255, 255, 0.158),
stop:1 rgba(255, 255, 255, 0.158));
}
TransparentToolButton {
background-color: transparent;
border: none;
......
......@@ -205,7 +205,16 @@ RadioButton:disabled {
RadioButton::indicator:disabled {
border: 2px solid #bbbbbb;
background-color: rgba(0, 0, 0, 0);
background-color: transparent;
}
RadioButton::indicator:disabled:checked {
border: none;
background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5,
stop:0 rgb(255, 255, 255),
stop:0.5 rgb(255, 255, 255),
stop:0.6 rgba(0, 0, 0, 0.2169),
stop:1 rgba(0, 0, 0, 0.2169));
}
TransparentToolButton {
......
此差异已折叠。
......@@ -303,7 +303,7 @@ class ScrollBar(QWidget):
else:
value = e.pos().x() - self._padding
self.setValue(int(value / self._slideLength() * self.maximum()))
self.setValue(int(value / max(self._slideLength(), 1) * self.maximum()))
self.sliderPressed.emit()
def mouseReleaseEvent(self, e):
......@@ -318,7 +318,7 @@ class ScrollBar(QWidget):
dv = e.pos().x() - self._pressedPos.x()
# don't use `self.setValue()`, because it could be reimplemented
dv = int(dv / self._slideLength() * (self.maximum() - self.minimum()))
dv = int(dv / max(self._slideLength(), 1) * (self.maximum() - self.minimum()))
ScrollBar.setValue(self, self.value() + dv)
self._pressedPos = e.pos()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册