feat: 完善 Face 一级关系编辑和稳定性

This commit is contained in:
2026-08-04 09:35:39 +08:00
parent bb44e3920d
commit 5799d5d813
29 changed files with 6295 additions and 189 deletions
+21 -3
View File
@@ -25,8 +25,17 @@ class InfoPanelMixin:
self.current_info_values = dict(info)
self.current_info_text = _info_to_text(info)
self.info_text.setPlainText(self.current_info_text)
self._populate_info_tree(info)
self.info_tabs.setCurrentWidget(self.info_tree)
diagnostic_content = getattr(self, "diagnostic_info_content", None)
diagnostics_visible = bool(
diagnostic_content is None
or not hasattr(diagnostic_content, "isVisible")
or diagnostic_content.isVisible()
)
if diagnostics_visible:
self._populate_info_tree(info)
self.info_tabs.setCurrentWidget(self.info_tree)
else:
self.info_tree.clear()
if hasattr(self, "_refresh_property_editor"):
self._refresh_property_editor()
if hasattr(self, "_update_selected_object_title"):
@@ -45,6 +54,15 @@ class InfoPanelMixin:
if hasattr(self, "mode_combo"):
self._update_action_states()
def _on_diagnostic_info_toggled(self, checked: bool) -> None:
if hasattr(self, "diagnostic_info_content"):
self.diagnostic_info_content.setVisible(bool(checked))
if checked and self.current_info_values:
self._populate_info_tree(self.current_info_values)
self.info_tabs.setCurrentWidget(self.info_tree)
elif not checked and hasattr(self, "info_tree"):
self.info_tree.clear()
def _populate_info_tree(self, info: dict[str, object]) -> None:
self.info_tree.clear()
emitted: set[str] = set()
@@ -67,7 +85,7 @@ class InfoPanelMixin:
group.setFirstColumnSpanned(True)
self.info_tree.addTopLevelItem(group)
for key, value in items:
child = QTreeWidgetItem([INFO_LABELS.get(key, key), _format_value(value)])
child = QTreeWidgetItem([INFO_LABELS.get(key, key), _format_info_value(key, value)])
child.setData(0, Qt.UserRole, key)
child.setToolTip(0, key)
child.setToolTip(1, _format_value(value))