优化了部分代码结构;
修改了复选框的样式
This commit is contained in:
@ -365,6 +365,21 @@ class MainWindow(QMainWindow, Ui_Signal_Label):
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def set_dark_mode_status(self):
|
||||
module_list = [
|
||||
self,
|
||||
self.approximately_align,
|
||||
self.preprocess,
|
||||
self.detect_Jpeak,
|
||||
self.detect_Rpeak,
|
||||
self.label_check,
|
||||
self.precisely_align,
|
||||
self.cut_PSG,
|
||||
self.artifact_label,
|
||||
self.bcg_quality_label,
|
||||
self.resp_quality_label,
|
||||
self.SA_label
|
||||
]
|
||||
|
||||
try:
|
||||
if self.ui.checkBox_darkmode.isChecked():
|
||||
QApplication.styleHints().setColorScheme(Qt.ColorScheme.Dark)
|
||||
@ -374,65 +389,12 @@ class MainWindow(QMainWindow, Ui_Signal_Label):
|
||||
PublicFunc.msgbox_output(self, Constants.MAINWINDOW_DARKMODE_FAILURE + "。" + format_exc(), Constants.MSGBOX_TYPE_ERROR)
|
||||
return
|
||||
|
||||
try:
|
||||
MainWindow.update_widget_style(self)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.approximately_align is not None:
|
||||
MainWindow.update_widget_style(self.approximately_align)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.preprocess is not None:
|
||||
MainWindow.update_widget_style(self.preprocess)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.detect_Jpeak is not None:
|
||||
MainWindow.update_widget_style(self.detect_Jpeak)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.detect_Rpeak is not None:
|
||||
MainWindow.update_widget_style(self.detect_Rpeak)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.label_check is not None:
|
||||
MainWindow.update_widget_style(self.label_check)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.precisely_align is not None:
|
||||
MainWindow.update_widget_style(self.precisely_align)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.cut_PSG is not None:
|
||||
MainWindow.update_widget_style(self.cut_PSG)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.artifact_label is not None:
|
||||
MainWindow.update_widget_style(self.artifact_label)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.bcg_quality_label is not None:
|
||||
MainWindow.update_widget_style(self.bcg_quality_label)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.resp_quality_label is not None:
|
||||
MainWindow.update_widget_style(self.resp_quality_label)
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
if self.SA_label is not None:
|
||||
MainWindow.update_widget_style(self.SA_label)
|
||||
except RuntimeError:
|
||||
pass
|
||||
for module in module_list:
|
||||
try:
|
||||
if module is not None:
|
||||
MainWindow.update_widget_style(module)
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def update_widget_style(mainWindow):
|
||||
|
||||
Reference in New Issue
Block a user