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

添加旋转框不透明属性 (#402)

上级 878981f0
......@@ -3,13 +3,16 @@ import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout
from qfluentwidgets import SpinBox, DoubleSpinBox, DateTimeEdit, DateEdit, TimeEdit
from qfluentwidgets import SpinBox, DoubleSpinBox, DateTimeEdit, DateEdit, TimeEdit, setTheme, Theme
class Demo(QWidget):
def __init__(self):
super().__init__()
# setTheme(Theme.DARK)
self.setStyleSheet('Demo{background: rgb(255, 255, 255)}')
self.vBoxLayout = QVBoxLayout(self)
self.spinBox = SpinBox(self)
......@@ -19,7 +22,6 @@ class Demo(QWidget):
self.doubleSpinBox = DoubleSpinBox(self)
self.resize(500, 500)
self.setStyleSheet('Demo{background: white}')
self.vBoxLayout.setContentsMargins(100, 50, 100, 50)
self.vBoxLayout.addWidget(self.spinBox)
......
......@@ -22,11 +22,11 @@ TimeEdit:hover {
background-color: rgba(255, 255, 255, 0.0837);
}
SpinBox:focus,
DoubleSpinBox:focus,
DateEdit:focus,
DateTimeEdit:focus,
TimeEdit:focus{
SpinBox[transparent=true]:focus,
DoubleSpinBox[transparent=true]:focus,
DateEdit[transparent=true]:focus,
DateTimeEdit[transparent=true]:focus,
TimeEdit[transparent=true]:focus{
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
background-color: rgba(30, 30, 30, 0.7);
}
......@@ -41,6 +41,14 @@ TimeEdit:disabled{
border: 1px solid gba(255, 255, 255, 0.0698);
}
SpinBox[transparent=false]:focus,
DoubleSpinBox[transparent=false]:focus,
DateEdit[transparent=false]:focus,
DateTimeEdit[transparent=false]:focus,
TimeEdit[transparent=false]:focus {
background: rgb(31, 31, 31);
}
SpinButton {
background-color: transparent;
border-radius: 4px;
......
此差异已折叠。
......@@ -59,6 +59,7 @@ class SpinBoxBase:
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setProperty('transparent', True)
FluentStyleSheet.SPIN_BOX.apply(self)
self.setButtonSymbols(QSpinBox.NoButtons)
self.setFixedHeight(33)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册