优化了所有按钮的点击体验

This commit is contained in:
Yorusora
2025-06-10 19:45:08 +08:00
parent af1a0ec531
commit 15bccb2da1
14 changed files with 66 additions and 1 deletions

View File

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

View File

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