修改UCD逻辑、添加关闭界面的x

This commit is contained in:
xinzhu.yin
2026-06-22 10:31:19 +08:00
parent 9c15751dd0
commit 22f8b12690
5 changed files with 294 additions and 52 deletions

View File

@@ -774,21 +774,19 @@ def create_test_type_frame(self: "PQAutomationApp"):
).pack(fill=tk.X, padx=16, pady=(16, 6), anchor="w")
panel_buttons = [
("ai_image_btn", "AI 图片", self.toggle_ai_image_panel),
("pantone_baseline_btn", "Pantone 摸底", self.toggle_pantone_baseline_panel),
("gamma_pattern_btn", "Gamma Pattern编辑", self.toggle_gamma_pattern_panel),
("calman_btn", "CALMAN 灰阶", self.toggle_calman_panel),
("ai_image_btn", "ai_image", "AI 图片", self.toggle_ai_image_panel),
("pantone_baseline_btn", "pantone_baseline", "Pantone 摸底", self.toggle_pantone_baseline_panel),
("gamma_pattern_btn", "gamma_pattern", "Gamma Pattern编辑", self.toggle_gamma_pattern_panel),
("calman_btn", "calman", "CALMAN 灰阶", self.toggle_calman_panel),
]
for attr, text, cmd in panel_buttons:
btn = ttk.Button(
self.sidebar_frame,
text=text,
style="Sidebar.TButton",
command=cmd,
takefocus=False,
)
btn.pack(fill=tk.X, padx=0, pady=1)
setattr(self, attr, btn)
for attr, panel_name, text, cmd in panel_buttons:
item = self.create_tool_panel_sidebar_item(self.sidebar_frame, text, cmd)
item["pack"]()
setattr(self, attr, item["row"])
if hasattr(self, "panels") and panel_name in self.panels:
self.panels[panel_name]["button_label"] = text
self.panels[panel_name]["sidebar_item"] = item
self.panels[panel_name]["button"] = item["row"]
# 测试版水印标签(版本 x.x.0.0 时显示)
from app_version import is_beta_version, APP_VERSION
@@ -822,7 +820,7 @@ def create_test_type_frame(self: "PQAutomationApp"):
self.theme_toggle_btn.pack(fill=tk.X, padx=0, pady=(0, 2), side=tk.BOTTOM)
_refresh_theme_toggle_label(self)
# 注册面板按钮
# 注册面板侧栏按钮
if hasattr(self, "panels"):
if "ai_image" in self.panels:
self.panels["ai_image"]["button"] = self.ai_image_btn
@@ -862,6 +860,11 @@ def _on_toggle_theme(self: "PQAutomationApp") -> None:
toggle_theme()
# apply_modern_styles()
_refresh_theme_toggle_label(self)
if hasattr(self, "refresh_tool_panel_sidebar_theme"):
try:
self.refresh_tool_panel_sidebar_theme()
except Exception:
pass
if hasattr(self, "refresh_connection_indicators"):
try:
self.refresh_connection_indicators()