优化了所有按钮的点击体验
This commit is contained in:
@ -79,7 +79,7 @@ class Constants:
|
||||
color: black;
|
||||
text-align: center;
|
||||
height: 20px;
|
||||
background: #E5E4E4;
|
||||
background: rgba(245, 245, 220, 128);
|
||||
}
|
||||
QProgressBar::chunk {
|
||||
background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #9AFF99, stop:1 #9A9AFE);
|
||||
|
||||
@ -142,6 +142,17 @@ class PublicFunc:
|
||||
if widget.objectName() in buttonState["Default"].keys():
|
||||
widget.setEnabled(buttonState["Default"][widget.objectName()])
|
||||
|
||||
@staticmethod
|
||||
def __styleAllButton__(mainWindow, buttonState):
|
||||
# 启用按钮
|
||||
all_widgets = mainWindow.centralWidget().findChildren(QWidget)
|
||||
|
||||
# 迭代所有部件,查找按钮并启用它们
|
||||
for widget in all_widgets:
|
||||
if isinstance(widget, QPushButton):
|
||||
if widget.objectName() in buttonState["Default"].keys():
|
||||
widget.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL)
|
||||
|
||||
@staticmethod
|
||||
def add_progressbar(mainWindow):
|
||||
mainWindow.progressbar = QProgressBar()
|
||||
|
||||
Reference in New Issue
Block a user