Skip to content

Commit 1516141

Browse files
Update viewer.py
Remove Day Mode Function. Now we do not need it.
1 parent 0f7ed33 commit 1516141

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

annotation_tool/viewer.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self):
4646

4747
# 4. Setup
4848
self.connect_signals()
49-
self.apply_stylesheet("Night")
49+
self.load_stylesheet()
5050
self.ui.right_panel.manual_box.setEnabled(False)
5151
self.setup_dynamic_ui()
5252

@@ -74,7 +74,7 @@ def connect_signals(self):
7474
self.ui.left_panel.action_tree.currentItemChanged.connect(self.nav_manager.on_item_selected)
7575
self.ui.left_panel.filter_combo.currentIndexChanged.connect(self.nav_manager.apply_action_filter)
7676

77-
# --- Undo/Redo Connections (Moved to Right Panel for Classification) ---
77+
# --- Undo/Redo Connections ---
7878
self.ui.right_panel.undo_btn.clicked.connect(self.history_manager.perform_undo)
7979
self.ui.right_panel.redo_btn.clicked.connect(self.history_manager.perform_redo)
8080

@@ -90,12 +90,12 @@ def connect_signals(self):
9090
self.ui.center_panel.next_action.clicked.connect(self.nav_manager.nav_next_action)
9191

9292
# --- Right Panel (Classification) ---
93-
# [修改] 移除了 save_btn 和 export_btn 的信号连接
94-
9593
self.ui.right_panel.confirm_btn.clicked.connect(self.annot_manager.save_manual_annotation)
9694
self.ui.right_panel.clear_sel_btn.clicked.connect(self.annot_manager.clear_current_manual_annotation)
9795
self.ui.right_panel.add_head_clicked.connect(self.annot_manager.handle_add_label_head)
9896
self.ui.right_panel.remove_head_clicked.connect(self.annot_manager.handle_remove_label_head)
97+
98+
# [修正] 移除了 style_mode_changed 的连接
9999

100100
# --- Localization Connections ---
101101
loc_controls = self.ui.localization_ui.left_panel.project_controls
@@ -180,10 +180,11 @@ def _on_class_clear_clicked(self):
180180
if msg.exec() == QMessageBox.StandardButton.Yes:
181181
self.router.class_fm._clear_workspace(full_reset=True)
182182

183-
def apply_stylesheet(self, mode):
184-
qss = "style.qss" if mode == "Night" else "style_day.qss"
183+
def load_stylesheet(self):
184+
"""Loads the main dark theme stylesheet."""
185+
style_path = resource_path(os.path.join("style", "style.qss"))
185186
try:
186-
with open(resource_path(os.path.join("style", qss)), "r", encoding="utf-8") as f:
187+
with open(style_path, "r", encoding="utf-8") as f:
187188
self.setStyleSheet(f.read())
188189
except Exception as e:
189190
print(f"Style error: {e}")
@@ -258,14 +259,10 @@ def update_save_export_button_state(self):
258259
self.ui.localization_ui.left_panel.project_controls.btn_save.setEnabled(can_save)
259260
self.ui.localization_ui.left_panel.project_controls.btn_export.setEnabled(can_export)
260261

261-
# Classification Right Panel buttons
262-
# self.ui.right_panel.export_btn.setEnabled(can_export)
263-
# self.ui.right_panel.save_btn.setEnabled(can_save)
264-
265262
can_undo = len(self.model.undo_stack) > 0
266263
can_redo = len(self.model.redo_stack) > 0
267264

268-
# Classification now uses Right Panel Undo/Redo
265+
# Classification Right Panel buttons
269266
self.ui.right_panel.undo_btn.setEnabled(can_undo)
270267
self.ui.right_panel.redo_btn.setEnabled(can_redo)
271268

@@ -337,4 +334,4 @@ def refresh_ui_after_undo_redo(self, action_path):
337334

338335
current = self.get_current_action_path()
339336
if current == action_path: self.annot_manager.display_manual_annotation(action_path)
340-
self.update_save_export_button_state()
337+
self.update_save_export_button_state()

0 commit comments

Comments
 (0)