软件界面适配深色模式

修改了<体动标注>中按钮的颜色显示规则
This commit is contained in:
Yorusora
2025-06-10 17:43:36 +08:00
parent bbd043cf58
commit af1a0ec531
13 changed files with 118 additions and 91 deletions

View File

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