优化了部分代码结构;
修改了复选框的样式
This commit is contained in:
@ -94,6 +94,30 @@ class Constants:
|
||||
background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */
|
||||
}"""
|
||||
|
||||
CHECKBOX_STYLE_NORMAL: str = '''
|
||||
QCheckBox {
|
||||
border: 2px solid rgb(128, 128, 128);
|
||||
border-radius: 11px;
|
||||
}
|
||||
QCheckBox::indicator{
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
QCheckBox::indicator:checked {
|
||||
background-color: rgba(0, 255, 0, 192);
|
||||
image: url(./image/correct.svg);
|
||||
}
|
||||
|
||||
QCheckBox::indicator:unchecked {
|
||||
background-color: rgba(255, 0, 0, 128);
|
||||
}
|
||||
|
||||
QCheckBox::indicator:disabled {
|
||||
background-color: rgba(119, 136, 153, 128);
|
||||
}'''
|
||||
|
||||
FAILURE_REASON: dict = {
|
||||
"Path_Not_Exist": "(路径不存在)",
|
||||
"File_Not_Exist": "(数据文件不存在)",
|
||||
|
||||
@ -2,7 +2,7 @@ from datetime import datetime
|
||||
from logging import error, info
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtWidgets import QMessageBox, QWidget, QPushButton, QProgressBar, QApplication, QRadioButton
|
||||
from PySide6.QtWidgets import QMessageBox, QWidget, QPushButton, QProgressBar, QApplication, QRadioButton, QCheckBox
|
||||
|
||||
from func.utils.Constants import Constants
|
||||
from func.utils.CustomException import TipsTypeValueNotExistError, MsgBoxTypeValueNotExistError
|
||||
@ -152,6 +152,8 @@ class PublicFunc:
|
||||
if isinstance(widget, QPushButton):
|
||||
if widget.objectName() in buttonState["Default"].keys():
|
||||
widget.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL)
|
||||
if isinstance(widget, QCheckBox):
|
||||
widget.setStyleSheet(Constants.CHECKBOX_STYLE_NORMAL)
|
||||
|
||||
@staticmethod
|
||||
def add_progressbar(mainWindow):
|
||||
|
||||
Reference in New Issue
Block a user