refactor(theme): 工作台内联色(对象树/数据详情工具条/停靠分隔)迁移到令牌(规范§4.2/§6.1/§6.12)
This commit is contained in:
parent
b728631477
commit
824e8bdf62
|
|
@ -295,9 +295,9 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re
|
||||||
auto applyDockSplitter = [dockManager, dockBaseQss]() {
|
auto applyDockSplitter = [dockManager, dockBaseQss]() {
|
||||||
dockManager->setStyleSheet(
|
dockManager->setStyleSheet(
|
||||||
dockBaseQss +
|
dockBaseQss +
|
||||||
geopro::app::themed(QStringLiteral(
|
geopro::app::fillTokens(QStringLiteral(
|
||||||
"ads--CDockContainerWidget ads--CDockSplitter::handle { background: #EAEEF4; }"
|
"ads--CDockContainerWidget ads--CDockSplitter::handle { background: {{divider}}; }"
|
||||||
"ads--CDockContainerWidget ads--CDockSplitter::handle:hover { background: #C7D2E0; }")));
|
"ads--CDockContainerWidget ads--CDockSplitter::handle:hover { background: {{accent/primary}}; }")));
|
||||||
};
|
};
|
||||||
applyDockSplitter();
|
applyDockSplitter();
|
||||||
QObject::connect(&geopro::app::ThemeManager::instance(), &geopro::app::ThemeManager::changed,
|
QObject::connect(&geopro::app::ThemeManager::instance(), &geopro::app::ThemeManager::changed,
|
||||||
|
|
@ -326,11 +326,11 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re
|
||||||
// ElaToolButton 选中只画极淡 BasicHover、且不可经 QSS 改,故这类需清晰选中态的用 QToolButton。
|
// ElaToolButton 选中只画极淡 BasicHover、且不可经 QSS 改,故这类需清晰选中态的用 QToolButton。
|
||||||
const QString kBarBtnQss =
|
const QString kBarBtnQss =
|
||||||
QStringLiteral(
|
QStringLiteral(
|
||||||
"QToolButton{ border:none; border-radius:6px; padding:6px 12px; color:#1F2A3D;"
|
"QToolButton{ border:none; border-radius:6px; padding:6px 12px; color:{{text/primary}};"
|
||||||
" font-size:%1px; }"
|
" font-size:%1px; }"
|
||||||
"QToolButton:hover{ background:#EEF3FB; }"
|
"QToolButton:hover{ background:{{bg/hover}}; }"
|
||||||
"QToolButton:checked{ color:#2D6CB5; font-weight:%2;"
|
"QToolButton:checked{ color:{{accent/primary}}; font-weight:%2;"
|
||||||
" border-bottom:2px solid #2D6CB5; }")
|
" border-bottom:2px solid {{accent/primary}}; }")
|
||||||
.arg(geopro::app::scaledPx(geopro::app::type::kBody))
|
.arg(geopro::app::scaledPx(geopro::app::type::kBody))
|
||||||
.arg(geopro::app::type::kWeightSemibold);
|
.arg(geopro::app::type::kWeightSemibold);
|
||||||
|
|
||||||
|
|
@ -503,7 +503,7 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re
|
||||||
detailBarLay->addWidget(actShowElectrodes);
|
detailBarLay->addWidget(actShowElectrodes);
|
||||||
detailBarLay->addWidget(actShowContour);
|
detailBarLay->addWidget(actShowContour);
|
||||||
detailBarLay->addStretch();
|
detailBarLay->addStretch();
|
||||||
geopro::app::applyThemedStyleSheet(detailToolBar, kBarBtnQss);
|
geopro::app::applyTokenizedStyleSheet(detailToolBar, kBarBtnQss);
|
||||||
detailLayout->addWidget(detailToolBar);
|
detailLayout->addWidget(detailToolBar);
|
||||||
detailLayout->addWidget(detailWidget, 1);
|
detailLayout->addWidget(detailWidget, 1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,15 +44,15 @@ ObjectTreePanel::ObjectTreePanel(QWidget* parent) : QWidget(parent) {
|
||||||
// 规避 Fusion 原生复选框在浅底下边框过淡、看不清的问题。
|
// 规避 Fusion 原生复选框在浅底下边框过淡、看不清的问题。
|
||||||
auto applyCheckboxStyle = [this]() {
|
auto applyCheckboxStyle = [this]() {
|
||||||
const bool dark = geopro::app::isDarkTheme();
|
const bool dark = geopro::app::isDarkTheme();
|
||||||
const QColor border = dark ? QColor(0x8A, 0x92, 0x9C) : QColor(0x8A, 0x93, 0xA3);
|
const QColor border = geopro::app::tokenColor("border/strong"); // 未选复选框描边(规范§6.12)
|
||||||
const QColor boxBg = dark ? QColor(0x2B, 0x2D, 0x30) : QColor(0xFF, 0xFF, 0xFF);
|
const QColor boxBg = geopro::app::tokenColor("bg/panel");
|
||||||
const QColor accent = dark ? QColor(0x5E, 0x9B, 0xD6) : QColor(0x2D, 0x6C, 0xB5); // 强调明/暗
|
const QColor accent = geopro::app::tokenColor("accent/primary"); // 选中填充
|
||||||
const QString tag = dark ? QStringLiteral("d") : QStringLiteral("l");
|
const QString tag = dark ? QStringLiteral("d") : QStringLiteral("l");
|
||||||
const QString off = geopro::app::writeCheckboxIcon(false, border, boxBg, Qt::white, tag);
|
const QString off = geopro::app::writeCheckboxIcon(false, border, boxBg, Qt::white, tag);
|
||||||
const QString on = geopro::app::writeCheckboxIcon(true, accent, accent, Qt::white, tag);
|
const QString on = geopro::app::writeCheckboxIcon(true, accent, accent, Qt::white, tag);
|
||||||
// 选中底色与 Ela 列表(BasicSelectedAlpha)保持一致:明=浅蓝、暗=中深蓝;:!active 防失焦变淡。
|
// 选中底/字取语义令牌,与全局树/列表选中一致(规范§6.1/§10)。
|
||||||
const QString selBg = dark ? QStringLiteral("#33527A") : QStringLiteral("#C2D9F2");
|
const QString selBg = geopro::app::token("bg/selected");
|
||||||
const QString selFg = dark ? QStringLiteral("#E8F1FB") : QStringLiteral("#14385F");
|
const QString selFg = geopro::app::token("text/primary");
|
||||||
tree_->setStyleSheet(QStringLiteral("QTreeView::indicator{ width:16px; height:16px; }"
|
tree_->setStyleSheet(QStringLiteral("QTreeView::indicator{ width:16px; height:16px; }"
|
||||||
"QTreeView::indicator:unchecked{ image:url(%1); }"
|
"QTreeView::indicator:unchecked{ image:url(%1); }"
|
||||||
"QTreeView::indicator:checked{ image:url(%2); }"
|
"QTreeView::indicator:checked{ image:url(%2); }"
|
||||||
|
|
@ -68,7 +68,7 @@ ObjectTreePanel::ObjectTreePanel(QWidget* parent) : QWidget(parent) {
|
||||||
|
|
||||||
hint_ = new QLabel(QStringLiteral("正在加载对象…"), this);
|
hint_ = new QLabel(QStringLiteral("正在加载对象…"), this);
|
||||||
hint_->setAlignment(Qt::AlignCenter);
|
hint_->setAlignment(Qt::AlignCenter);
|
||||||
geopro::app::applyThemedStyleSheet(hint_, QStringLiteral("color:#9AA6B6; padding:16px;"));
|
geopro::app::applyTokenizedStyleSheet(hint_, QStringLiteral("color:{{text/disabled}}; padding:16px;"));
|
||||||
hint_->setVisible(false);
|
hint_->setVisible(false);
|
||||||
lay->addWidget(hint_);
|
lay->addWidget(hint_);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue