refactor/pure-qt-ui #3

Merged
gaozheng merged 56 commits from refactor/pure-qt-ui into main 2026-06-10 18:41:53 +08:00
1 changed files with 11 additions and 5 deletions
Showing only changes of commit 464911dc57 - Show all commits

View File

@ -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<PanelTab>& tabs, const QVector<Header
for (int i = 0; i < tabs.size(); ++i) {
const PanelTab& t = tabs[i];
auto* btn = new ElaToolButton(header); // Fluent tab(选中态由 Ela checked 高亮)
auto* btn = new QToolButton(header); // 页签与工具条统一: QToolButton + 强调色下划线 QSS
btn->setObjectName(QStringLiteral("tabBtn"));
btn->setText(t.title);
setThemedGlyph(btn, t.icon, kTabIcon); // 随主题着色