修改Calman灰阶中结果图显示、修改UI主题样式应用

This commit is contained in:
xinzhu.yin
2026-06-04 10:36:15 +08:00
parent 3aa975c4d3
commit 49d82da8b9
16 changed files with 597 additions and 210 deletions

View File

@@ -171,7 +171,7 @@ def create_gamma_pattern_panel(self: "PQAutomationApp"):
ttk.Label(
title_row,
text="Gamma / CCT / 对比度 / EOTF 共用此列表)",
foreground="#888",
style="Muted.TLabel",
).pack(side=tk.LEFT, padx=(8, 0))
# ===== 预设管理行 =====
@@ -207,7 +207,7 @@ def create_gamma_pattern_panel(self: "PQAutomationApp"):
).pack(side=tk.LEFT, padx=2)
self._gamma_active_label = ttk.Label(
preset_row1, text="", foreground="#0a8", font=("微软雅黑", 9, "bold")
preset_row1, text="", style="SuccessState.TLabel", font=("微软雅黑", 9, "bold")
)
self._gamma_active_label.pack(side=tk.LEFT, padx=(10, 0))
@@ -230,7 +230,7 @@ def create_gamma_pattern_panel(self: "PQAutomationApp"):
# 描述行
self._gamma_meta_label = ttk.Label(
preset_box, text="", foreground="#666", font=("微软雅黑", 9)
preset_box, text="", style="Muted.TLabel", font=("微软雅黑", 9)
)
self._gamma_meta_label.pack(anchor=tk.W, pady=(6, 0))
@@ -350,7 +350,7 @@ def create_gamma_pattern_panel(self: "PQAutomationApp"):
paste_frame.pack(fill=tk.X, pady=(10, 0))
ttk.Label(
paste_frame, text="每行R,G,B 或 R G B\n或:灰度% (如 50%)",
foreground="#888", justify=tk.LEFT,
style="Muted.TLabel", justify=tk.LEFT,
).pack(anchor=tk.W)
ttk.Button(
paste_frame, text="从剪贴板导入",
@@ -363,7 +363,7 @@ def create_gamma_pattern_panel(self: "PQAutomationApp"):
bottom.pack(fill=tk.X, pady=(10, 0))
self._gamma_validate_label = ttk.Label(
bottom, text="", foreground="#666", justify=tk.LEFT
bottom, text="", style="Muted.TLabel", justify=tk.LEFT
)
self._gamma_validate_label.pack(anchor=tk.W)
@@ -435,16 +435,16 @@ def _update_active_label(self: "PQAutomationApp"):
current = self._gamma_current_preset
if active and current == active and not self._gamma_dirty:
self._gamma_active_label.config(
text=f"✔ 当前激活:{active}", foreground="#0a8"
text=f"✔ 当前激活:{active}", style="SuccessState.TLabel"
)
elif active:
extra = "(有未保存改动)" if self._gamma_dirty else ""
self._gamma_active_label.config(
text=f"● 激活:{active} 编辑中:{current or '-'}{extra}",
foreground="#a60" if self._gamma_dirty else "#888",
style="WarningState.TLabel" if self._gamma_dirty else "Muted.TLabel",
)
else:
self._gamma_active_label.config(text="● 未激活任何预设", foreground="#888")
self._gamma_active_label.config(text="● 未激活任何预设", style="Muted.TLabel")
def _on_preset_selected(self: "PQAutomationApp"):
@@ -1023,11 +1023,11 @@ def _run_validation(self: "PQAutomationApp"):
if not msgs:
text = f"✔ 校验通过(共 {len(params)} 点)"
color = "#0a8"
style_name = "SuccessState.TLabel"
else:
text = f"{len(params)} 点 | " + " ".join(msgs)
color = "#a60" if any(m.startswith("") for m in msgs) else "#666"
self._gamma_validate_label.config(text=text, foreground=color)
style_name = "WarningState.TLabel" if any(m.startswith("") for m in msgs) else "Muted.TLabel"
self._gamma_validate_label.config(text=text, style=style_name)
# ============================================================