From 464911dc57c359336f666d11509bcdbc31aefb16 Mon Sep 17 00:00:00 2001 From: gaozheng Date: Wed, 10 Jun 2026 11:51:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(ela):=20=E9=A1=B5=E7=AD=BE=E4=B8=8E?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=9D=A1=E7=BB=9F=E4=B8=80=E4=B8=BA=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E5=A5=97=E5=88=87=E6=8D=A2=E6=A0=B7=E5=BC=8F(?= =?UTF-8?q?=E6=B6=88=E9=99=A4=E4=B8=89=E5=A5=97=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PanelHeader 页签(数据/文件, 异常列表/对象属性)从 ElaToolButton 退回 QToolButton, headerQss 恢复 tabBtn 下划线规则: 选中 = 强调色文字 + 2px 强调色下划线 — 与视图/详情工具条完全一致。 至此全 UI 的切换控件(页签 + 分段工具条)是同一种视觉语言。 --- src/app/PanelHeader.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/PanelHeader.cpp b/src/app/PanelHeader.cpp index 1969565..832555c 100644 --- a/src/app/PanelHeader.cpp +++ b/src/app/PanelHeader.cpp @@ -30,8 +30,8 @@ constexpr int kTabIcon = 19; // Tab 图标 // 面板标题=title(15)、徽标=caption(12)、Tab 文本=body(13),加粗统一 semibold。 // #panelBadge 为中性计数徽标;#panelBadgeWarn 为“需注意”变体(语义 warning 色), // 供异常计数等承载“待复查”含义的徽标使用(调用方改 objectName 即切换)。 -// 表头底/标题/徽标样式。Tab(ElaToolButton)与操作按钮(ElaIconButton)自绘 Fluent, -// 不再写它们的 QSS(选中态由 Ela 的 checked 高亮表达,而非自定义下划线)。 +// 表头底/标题/徽标 + 页签样式。页签选中态 = 强调色文字 + 2px 强调色下划线, +// 与视图/详情工具条完全一致(全 UI 切换控件统一这一套)。操作按钮(ElaIconButton)自绘 Fluent。 QString headerQss() { return QStringLiteral( @@ -40,12 +40,18 @@ QString headerQss() "#panelBadge { background:#EAEEF5; color:#5A6B85; border-radius:9px;" " padding:1px 7px; font-size:%2px; font-weight:%3; }" "#panelBadgeWarn { background:%4; color:%5; border-radius:9px;" - " padding:1px 7px; font-size:%2px; font-weight:%3; }") + " padding:1px 7px; font-size:%2px; font-weight:%3; }" + "QToolButton#tabBtn { border:none; border-bottom:2px solid transparent; color:#5A6B85;" + " padding:8px 6px; font-size:%6px; }" + "QToolButton#tabBtn:hover { color:#1F2A3D; }" + "QToolButton#tabBtn:checked { color:#2D6CB5; font-weight:%3;" + " border-bottom:2px solid #2D6CB5; }") .arg(type::kTitle) .arg(type::kCaption) .arg(type::kWeightSemibold) .arg(QString::fromUtf8(semantic::kWarningFill)) - .arg(QString::fromUtf8(semantic::kWarning)); + .arg(QString::fromUtf8(semantic::kWarning)) + .arg(type::kBody); } // 数量徽标(默认隐藏,调用方 setText+setVisible 显示)。 @@ -135,7 +141,7 @@ TabbedPanel buildTabbedPanel(const QVector& tabs, const QVector
setObjectName(QStringLiteral("tabBtn")); btn->setText(t.title); setThemedGlyph(btn, t.icon, kTabIcon); // 随主题着色