diff --git a/func/Module_SA_label.py b/func/Module_SA_label.py index 5b03bec..dd449ab 100644 --- a/func/Module_SA_label.py +++ b/func/Module_SA_label.py @@ -322,6 +322,8 @@ class MainWindow_SA_label(QMainWindow): self.figToolbar = None self.gs = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + # 设定事件和其对应颜色 # event_code color event # 0 黑色 背景 @@ -626,11 +628,10 @@ class MainWindow_SA_label(QMainWindow): if str(remark) != "" and str(remark) != "nan" and row.get("isLabeled", None) == 1: for col in range(self.ui.tableWidget_label.columnCount()): item = self.ui.tableWidget_label.item(index, col) - item.setBackground(QColor(255, 200, 200)) + item.setBackground(QColor(255, 200, 200, 128)) else: for col in range(self.ui.tableWidget_label.columnCount()): item = self.ui.tableWidget_label.item(index, col) - item.setBackground(QColor(255, 255, 255)) if self.data.df_addNew is not None: self.ui.tableWidget_label_add.setRowCount(len(self.data.df_addNew)) @@ -673,11 +674,10 @@ class MainWindow_SA_label(QMainWindow): if str(remark) != Constants.STRING_IS_EMPTY and str(remark) != Constants.STRING_IS_NAN and row.get("isLabeled", None) == 1: for col in range(self.ui.tableWidget_label_add.columnCount()): item = self.ui.tableWidget_label_add.item(index, col) - item.setBackground(QColor(255, 200, 200)) + item.setBackground(QColor(255, 200, 200, 128)) else: for col in range(self.ui.tableWidget_label_add.columnCount()): item = self.ui.tableWidget_label_add.item(index, col) - item.setBackground(QColor(255, 255, 255)) except Exception as e: return Result().failure(info=Constants.UPDATE_FAILURE + Constants.FAILURE_REASON["Update_tableWidget_Exception"] + "\n" + format_exc()) diff --git a/func/Module_approximately_align.py b/func/Module_approximately_align.py index 902dcc3..4ac8166 100644 --- a/func/Module_approximately_align.py +++ b/func/Module_approximately_align.py @@ -251,6 +251,8 @@ class MainWindow_approximately_align(QMainWindow): self.fig = None self.canvas = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) diff --git a/func/Module_artifact_label.py b/func/Module_artifact_label.py index 684106a..a492cbc 100644 --- a/func/Module_artifact_label.py +++ b/func/Module_artifact_label.py @@ -228,6 +228,8 @@ class MainWindow_artifact_label(QMainWindow): } }) + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) @@ -265,6 +267,8 @@ class MainWindow_artifact_label(QMainWindow): self.ax1.grid(True) self.ax1.xaxis.set_major_formatter(Params.FORMATTER) + self.reset_labelBtn_color() + PublicFunc.__resetAllButton__(self, ButtonState) self.ui.spinBox_moveLength.setValue(Config["CustomAutoplayArgs"]["MoveLength"]) @@ -396,74 +400,74 @@ class MainWindow_artifact_label(QMainWindow): # 绘制体动 for i in range(0, len(self.data.df_Artifact_a)): if self.data.df_Artifact_a.iloc[i][1] == 1: - # 橙色,剧烈体动 + # 橙色orange,剧烈体动 rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_DEEP_YELLOW) + color="#ffa500") self.rectangles_ax0_patches.append(rectangle) rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_DEEP_YELLOW) + color="#ffa500") self.rectangles_ax1_patches.append(rectangle) elif self.data.df_Artifact_a.iloc[i][1] == 2: - # 黄色,脉冲体动 + # 黄色yellow,脉冲体动 rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_YELLOW) + color="#ffff00") self.rectangles_ax0_patches.append(rectangle) rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_YELLOW) + color="#ffff00") self.rectangles_ax1_patches.append(rectangle) elif self.data.df_Artifact_a.iloc[i][1] == 3: - # 青色,常规体动 + # 草绿色limegreen,常规体动 rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_AQUA) + color="#32cd32") self.rectangles_ax0_patches.append(rectangle) rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_AQUA) + color="#32cd32") self.rectangles_ax1_patches.append(rectangle) elif self.data.df_Artifact_a.iloc[i][1] == 4: - # 紫色,疑似鼾声 + # 青色cyan,疑似鼾声 rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_PURPLE_PINK) + color="#00ffff") self.rectangles_ax0_patches.append(rectangle) rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_PURPLE_PINK) + color="#00ffff") self.rectangles_ax1_patches.append(rectangle) elif self.data.df_Artifact_a.iloc[i][1] == 5: - # 灰色,离床 + # 品红色magenta,离床 rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_DEEP_GREY) + color="#ff00ff") self.rectangles_ax0_patches.append(rectangle) rectangle = patches.Rectangle((self.data.df_Artifact_a.iloc[i][2], self.rect_down), width=(self.data.df_Artifact_a.iloc[i][3] - self.data.df_Artifact_a.iloc[i][2]), height=self.rect_up - self.rect_down, fill=True, alpha=Params.ARTIFACT_LABEL_LABEL_TRANSPARENCY, - color=Constants.PLOT_COLOR_DEEP_GREY) + color="#ff00ff") self.rectangles_ax1_patches.append(rectangle) for patch in self.rectangles_ax0_patches: self.ax0.add_patch(patch) @@ -948,6 +952,7 @@ class MainWindow_artifact_label(QMainWindow): self.update_tableWidget() self.update_Info() self.__plot_artifact__() + self.reset_labelBtn_color() target_row = self.data.df_Artifact_a[self.data.df_Artifact_a.eq(start_time).any(axis=1)] if not target_row.empty: @@ -1191,45 +1196,45 @@ class MainWindow_artifact_label(QMainWindow): if type == 1: self.ui.pushButton_type_1.setStyleSheet( Constants.ARTIFACT_LABEL_LABELBTN_STYLE_1) - self.ui.pushButton_type_2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_3.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_4.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_5.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_3.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_4.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_5.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif type == 2: - self.ui.pushButton_type_1.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_type_2.setStyleSheet( Constants.ARTIFACT_LABEL_LABELBTN_STYLE_2) - self.ui.pushButton_type_3.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_4.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_5.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_3.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_4.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_5.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif type == 3: - self.ui.pushButton_type_1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_2.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_type_3.setStyleSheet( Constants.ARTIFACT_LABEL_LABELBTN_STYLE_3) - self.ui.pushButton_type_4.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_5.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_4.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_5.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif type == 4: - self.ui.pushButton_type_1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_3.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_3.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_type_4.setStyleSheet( Constants.ARTIFACT_LABEL_LABELBTN_STYLE_4) - self.ui.pushButton_type_5.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_5.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif type == 5: - self.ui.pushButton_type_1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_3.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_4.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_3.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_4.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_type_5.setStyleSheet( Constants.ARTIFACT_LABEL_LABELBTN_STYLE_5) def reset_labelBtn_color(self): - self.ui.pushButton_type_1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_3.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_4.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_type_5.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_type_1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_3.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_4.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_type_5.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) def toggle_home(self): if Config["AutoplayArgs"]["AutoplayMode"] != "pause": diff --git a/func/Module_bcg_quality_label.py b/func/Module_bcg_quality_label.py index 50a2958..b19046c 100644 --- a/func/Module_bcg_quality_label.py +++ b/func/Module_bcg_quality_label.py @@ -194,6 +194,8 @@ class MainWindow_bcg_quality_label(QMainWindow): self.line_data = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) @@ -837,10 +839,9 @@ class MainWindow_bcg_quality_label(QMainWindow): value - 1]) != Constants.STRING_IS_EMPTY and str(self.data.df_label[Constants.BCG_QUALITY_LABEL_COLUMN_REMARK][value - 1]) != Constants.STRING_IS_NAN): item = tableWidget.item(row, 0) - item.setBackground(QColor(255, 200, 200)) + item.setBackground(QColor(255, 200, 200, 128)) else: item = tableWidget.item(row, 0) - item.setBackground(QColor(255, 255, 255)) self.ui.tableWidget_a1.verticalScrollBar().setValue(self.ui.tableWidget_a1.verticalScrollBar().maximum()) self.ui.tableWidget_a2.verticalScrollBar().setValue(self.ui.tableWidget_a2.verticalScrollBar().maximum()) self.ui.tableWidget_b1.verticalScrollBar().setValue(self.ui.tableWidget_b2.verticalScrollBar().maximum()) @@ -875,10 +876,9 @@ class MainWindow_bcg_quality_label(QMainWindow): value - 1]) != Constants.STRING_IS_EMPTY and str(self.data.df_label[Constants.BCG_QUALITY_LABEL_COLUMN_REMARK][value - 1]) != Constants.STRING_IS_NAN): item = tableWidget.item(row, 0) - item.setBackground(QColor(255, 200, 200)) + item.setBackground(QColor(255, 200, 200, 128)) else: item = tableWidget.item(row, 0) - item.setBackground(QColor(255, 255, 255)) self.ui.tableWidget_a1.verticalScrollBar().setValue(self.ui.tableWidget_a1.verticalScrollBar().maximum()) self.ui.tableWidget_b1.verticalScrollBar().setValue(self.ui.tableWidget_b1.verticalScrollBar().maximum()) self.ui.tableWidget_c.verticalScrollBar().setValue(self.ui.tableWidget_c.verticalScrollBar().maximum()) @@ -949,40 +949,40 @@ class MainWindow_bcg_quality_label(QMainWindow): def change_labelBtn_color(self): if self.data.df_label.at[Config["CurrentPartNum"] - 1, Constants.BCG_QUALITY_LABEL_COLUMN_LABEL] == "a1": self.ui.pushButton_a1.setStyleSheet(Constants.BCG_QUALITY_LABEL_LABELBTN_STYLE) - self.ui.pushButton_a2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_c.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_a2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_c.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif self.data.df_label.at[Config["CurrentPartNum"] - 1, Constants.BCG_QUALITY_LABEL_COLUMN_LABEL] == "a2": - self.ui.pushButton_a1.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_a1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_a2.setStyleSheet(Constants.BCG_QUALITY_LABEL_LABELBTN_STYLE) - self.ui.pushButton_b1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_c.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_b1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_c.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif self.data.df_label.at[Config["CurrentPartNum"] - 1, Constants.BCG_QUALITY_LABEL_COLUMN_LABEL] == "b1": - self.ui.pushButton_a1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_a2.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_a1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_a2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_b1.setStyleSheet(Constants.BCG_QUALITY_LABEL_LABELBTN_STYLE) - self.ui.pushButton_b2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_c.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_b2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_c.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif self.data.df_label.at[Config["CurrentPartNum"] - 1, Constants.BCG_QUALITY_LABEL_COLUMN_LABEL] == "b2": - self.ui.pushButton_a1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_a2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b1.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_a1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_a2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_b2.setStyleSheet(Constants.BCG_QUALITY_LABEL_LABELBTN_STYLE) - self.ui.pushButton_c.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_c.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) elif self.data.df_label.at[Config["CurrentPartNum"] - 1, Constants.BCG_QUALITY_LABEL_COLUMN_LABEL] == "c1": - self.ui.pushButton_a1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_a2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b2.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_a1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_a2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) self.ui.pushButton_c.setStyleSheet(Constants.BCG_QUALITY_LABEL_LABELBTN_STYLE) elif self.data.df_label.at[Config["CurrentPartNum"] - 1, Constants.BCG_QUALITY_LABEL_COLUMN_LABEL] == "f1": - self.ui.pushButton_a1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_a2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b1.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_b2.setStyleSheet(Constants.STRING_IS_EMPTY) - self.ui.pushButton_c.setStyleSheet(Constants.STRING_IS_EMPTY) + self.ui.pushButton_a1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_a2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b1.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_b2.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) + self.ui.pushButton_c.setStyleSheet(Constants.LABELBTN_STYLE_NORMAL) class Data(): diff --git a/func/Module_cut_PSG.py b/func/Module_cut_PSG.py index 6b2ff69..ea54b8b 100644 --- a/func/Module_cut_PSG.py +++ b/func/Module_cut_PSG.py @@ -46,6 +46,8 @@ class MainWindow_cut_PSG(QMainWindow): self.data = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + # 初始化进度条 self.ui.progressbar.setStyleSheet(Constants.PROGRESSBAR_STYLE) self.progressbar = self.ui.progressbar diff --git a/func/Module_detect_Jpeak.py b/func/Module_detect_Jpeak.py index cea128c..08aae69 100644 --- a/func/Module_detect_Jpeak.py +++ b/func/Module_detect_Jpeak.py @@ -156,6 +156,8 @@ class MainWindow_detect_Jpeak(QMainWindow): self.gs = None self.ax0 = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) diff --git a/func/Module_detect_Rpeak.py b/func/Module_detect_Rpeak.py index 4e9b91f..35dc6e7 100644 --- a/func/Module_detect_Rpeak.py +++ b/func/Module_detect_Rpeak.py @@ -154,6 +154,8 @@ class MainWindow_detect_Rpeak(QMainWindow): self.ax0 = None self.ax1 = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) diff --git a/func/Module_label_check.py b/func/Module_label_check.py index 1670e47..f434040 100644 --- a/func/Module_label_check.py +++ b/func/Module_label_check.py @@ -249,6 +249,8 @@ class MainWindow_label_check(QMainWindow): self.point_peak_corrected = None self.annotation_tableWidget = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + # 初始化自动播放定时器 self.autoplay_xlim_start = None self.autoplay_xlim_end = None diff --git a/func/Module_precisely_align.py b/func/Module_precisely_align.py index 1d7c043..56b35b4 100644 --- a/func/Module_precisely_align.py +++ b/func/Module_precisely_align.py @@ -346,6 +346,8 @@ class MainWindow_precisely_align(QMainWindow): self.ax4_xlime = None self.ax4_ylime = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) diff --git a/func/Module_preprocess.py b/func/Module_preprocess.py index c22d4ab..1dc48ac 100644 --- a/func/Module_preprocess.py +++ b/func/Module_preprocess.py @@ -191,6 +191,8 @@ class MainWindow_preprocess(QMainWindow): self.gs = None self.ax0 = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) diff --git a/func/Module_resp_quality_label.py b/func/Module_resp_quality_label.py index b37018c..b46b471 100644 --- a/func/Module_resp_quality_label.py +++ b/func/Module_resp_quality_label.py @@ -225,6 +225,8 @@ class MainWindow_resp_quality_label(QMainWindow): self.cid1 = None self.cid2 = None + self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }") + self.msgBox = QMessageBox() self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE) diff --git a/func/utils/Constants.py b/func/utils/Constants.py index a6f5371..05126ce 100644 --- a/func/utils/Constants.py +++ b/func/utils/Constants.py @@ -70,11 +70,6 @@ class Constants: PLOT_COLOR_PINK: str = "#ff00ff" PLOT_COLOR_PURPLE: str = "m" PLOT_COLOR_GRAY: str = "gray" - PLOT_COLOR_DEEP_YELLOW: str = "#ffa500" - PLOT_COLOR_YELLOW: str = "#ffff00" - PLOT_COLOR_AQUA: str = "#00ffff" - PLOT_COLOR_PURPLE_PINK: str = "#ee82ee" - PLOT_COLOR_DEEP_GREY: str = "#808080" PROGRESSBAR_STYLE: str = """ QProgressBar { @@ -92,6 +87,11 @@ class Constants: } """ + LABELBTN_STYLE_NORMAL: str = """ + QPushButton:hover { + background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */ + }""" + FAILURE_REASON: dict = { "Path_Not_Exist": "(路径不存在)", "File_Not_Exist": "(数据文件不存在)", @@ -358,55 +358,60 @@ class Constants: ARTIFACT_LABEL_DELETE_ARTIFACT_FAILURE: str = "需要被删除的体动不存在" ARTIFACT_LABEL_ACTION_LABEL: str = f"标注体动({Params.ARTIFACT_LABEL_ACTION_LABEL_ARTIFACT_SHORTCUT_KEY})" + # 橙色orange ARTIFACT_LABEL_LABELBTN_STYLE_1: str = """ QPushButton { - background-color: #ffa500; /* 设置背景颜色 */ + background-color: rgba(255, 165, 0, 128); /* 设置背景颜色 */ padding: 10px; /* 设置内边距 */ border: 2px solid darkblue; /* 设置边框 */ border-radius: 10px; /* 设置圆角 */ } QPushButton:hover { - background-color: #00ff00; /* 鼠标悬停时的背景颜色 */ + background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */ }""" + # 黄色yellow ARTIFACT_LABEL_LABELBTN_STYLE_2: str = """ QPushButton { - background-color: #ffff00; /* 设置背景颜色 */ + background-color: rgba(255, 255, 0, 128); /* 设置背景颜色 */ padding: 10px; /* 设置内边距 */ border: 2px solid darkblue; /* 设置边框 */ border-radius: 10px; /* 设置圆角 */ } QPushButton:hover { - background-color: #00ff00; /* 鼠标悬停时的背景颜色 */ + background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */ }""" + # 草绿色limegreen ARTIFACT_LABEL_LABELBTN_STYLE_3: str = """ QPushButton { - background-color: #00ffff; /* 设置背景颜色 */ + background-color: rgba(50, 205, 50, 128); /* 设置背景颜色 */ padding: 10px; /* 设置内边距 */ border: 2px solid darkblue; /* 设置边框 */ border-radius: 10px; /* 设置圆角 */ } QPushButton:hover { - background-color: #00ff00; /* 鼠标悬停时的背景颜色 */ + background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */ }""" + # 青色cyan ARTIFACT_LABEL_LABELBTN_STYLE_4: str = """ QPushButton { - background-color: #ee82ee; /* 设置背景颜色 */ + background-color: rgba(0, 255, 255, 128); /* 设置背景颜色 */ padding: 10px; /* 设置内边距 */ border: 2px solid darkblue; /* 设置边框 */ border-radius: 10px; /* 设置圆角 */ } QPushButton:hover { - background-color: #00ff00; /* 鼠标悬停时的背景颜色 */ + background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */ }""" + # 品红色magenta ARTIFACT_LABEL_LABELBTN_STYLE_5: str = """ QPushButton { - background-color: #808080; /* 设置背景颜色 */ + background-color: rgba(255, 0, 255, 128); /* 设置背景颜色 */ padding: 10px; /* 设置内边距 */ border: 2px solid darkblue; /* 设置边框 */ border-radius: 10px; /* 设置圆角 */ } QPushButton:hover { - background-color: #00ff00; /* 鼠标悬停时的背景颜色 */ + background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */ }""" # BCG的质量标注 @@ -435,13 +440,13 @@ class Constants: BCG_QUALITY_LABEL_LABEL_ARTIFACT_TO_TYPE_C_QUESTION_CONTENT: str = "你确定要将所有带有体动的片段标记为类型C" BCG_QUALITY_LABEL_LABELBTN_STYLE: str = """ QPushButton { - background-color: orange; /* 设置背景颜色 */ + background-color: rgba(255, 165, 0, 128); /* 设置背景颜色 */ padding: 10px; /* 设置内边距 */ border: 2px solid darkblue; /* 设置边框 */ border-radius: 10px; /* 设置圆角 */ } QPushButton:hover { - background-color: yellow; /* 鼠标悬停时的背景颜色 */ + background-color: rgba(255, 0, 0, 128); /* 鼠标悬停时的背景颜色 */ }""" diff --git a/run.py b/run.py index 46daed5..496db60 100644 --- a/run.py +++ b/run.py @@ -39,7 +39,8 @@ if __name__ == '__main__': QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough) app = QApplication(argv) - app.styleHints().setColorScheme(Qt.ColorScheme.Light) # 强制使用浅色模式 + # app.styleHints().setColorScheme(Qt.ColorScheme.Light) # 强制使用浅色模式 + app.setStyle("Fusion") mainWindow = MainWindow() mainWindow.show() exit(app.exec()) \ No newline at end of file