修改深色模式下结果图片显示异常

This commit is contained in:
xinzhu.yin
2026-06-05 16:58:46 +08:00
parent 49d82da8b9
commit e9a591bf6e
11 changed files with 385 additions and 140 deletions

View File

@@ -4,6 +4,7 @@ Step 2 重构:从 pqAutomationApp.PQAutomationApp.plot_contrast 原样搬迁
"""
from matplotlib.patches import Rectangle
from app.views.modern_styles import get_theme_palette
from typing import TYPE_CHECKING
@@ -14,9 +15,12 @@ if TYPE_CHECKING:
def plot_contrast(self: "PQAutomationApp", contrast_data, test_type):
"""绘制对比度测试结果 - 固定布局版本"""
palette = get_theme_palette()
# 清空并重置
self.contrast_ax.clear()
self.contrast_fig.patch.set_facecolor(palette["bg"])
self.contrast_ax.set_facecolor(palette["card_bg"])
self.contrast_ax.set_xlim(0, 1)
self.contrast_ax.set_ylim(0, 1)
self.contrast_ax.axis("off")
@@ -51,6 +55,7 @@ def plot_contrast(self: "PQAutomationApp", contrast_data, test_type):
fontsize=12,
y=0.98,
fontweight="bold",
color=palette["fg"],
)
# ========== 中央大对比度卡片 ==========
@@ -107,16 +112,16 @@ def plot_contrast(self: "PQAutomationApp", contrast_data, test_type):
"title": "白场亮度",
"value": f"{max_lum:.2f}",
"unit": "cd/m²",
"color": "#E3F2FD",
"edge_color": "#2196F3",
"color": palette["surface_alt_bg"],
"edge_color": palette["primary"],
},
{
"x": start_x + card_width + gap,
"title": "黑场亮度",
"value": f"{min_lum:.4f}",
"unit": "cd/m²",
"color": "#F3E5F5",
"edge_color": "#9C27B0",
"color": palette["card_bg"],
"edge_color": palette["secondary"],
},
]
@@ -142,6 +147,7 @@ def plot_contrast(self: "PQAutomationApp", contrast_data, test_type):
va="top",
fontsize=10,
fontweight="bold",
color=palette["fg"],
transform=self.contrast_ax.transAxes,
)
@@ -154,6 +160,7 @@ def plot_contrast(self: "PQAutomationApp", contrast_data, test_type):
va="center",
fontsize=16,
fontweight="bold",
color=palette["fg"],
transform=self.contrast_ax.transAxes,
)
@@ -165,7 +172,7 @@ def plot_contrast(self: "PQAutomationApp", contrast_data, test_type):
ha="center",
va="bottom",
fontsize=9,
color="gray",
color=palette["muted_fg"],
transform=self.contrast_ax.transAxes,
)