diff --git a/src/app/AxesSettingsPanel.cpp b/src/app/AxesSettingsPanel.cpp index 2ba1294..c4844a0 100644 --- a/src/app/AxesSettingsPanel.cpp +++ b/src/app/AxesSettingsPanel.cpp @@ -48,7 +48,7 @@ AxesSettingsPanel::AxesSettingsPanel(QWidget* parent) : QFrame(parent) { setFrameShape(QFrame::StyledPanel); applyTokenizedStyleSheet( this, QStringLiteral("QFrame{background:{{bg/panel}};border:1px solid {{border/default}};" - "border-radius:10px;}")); + "border-radius:8px;}")); // radius/lg=8(规范§3.2 画布浮窗) setFixedWidth(320); auto* v = new QVBoxLayout(this); @@ -63,9 +63,12 @@ AxesSettingsPanel::AxesSettingsPanel(QWidget* parent) : QFrame(parent) { close->setFixedSize(24, 24); close->setCursor(Qt::PointingHandCursor); // 显式覆盖全局 QPushButton 的 padding(6px 14px)/border——否则 24×24 容不下 padding,× 被挤出不可见。 - close->setStyleSheet(QStringLiteral( - "QPushButton{border:none;background:transparent;padding:0;margin:0;font-size:16px;color:#888;}" - "QPushButton:hover{color:#2f6fed;}")); + // 颜色走 token(避免深色模式失效)。 + applyTokenizedStyleSheet( + close, QStringLiteral( + "QPushButton{border:none;background:transparent;padding:0;margin:0;font-size:16px;" + "color:{{text/secondary}};}" + "QPushButton:hover{color:{{accent/primary}};}")); connect(close, &QPushButton::clicked, this, &AxesSettingsPanel::closed); titleRow->addWidget(title); titleRow->addStretch(1); @@ -100,7 +103,8 @@ AxesSettingsPanel::AxesSettingsPanel(QWidget* parent) : QFrame(parent) { scaleSlider_->setSingleStep(1); scaleSlider_->setPageStep(1); // 点击轨道按 1 步移动(默认 pageStep=10 → 点一下直接跳到 10 的 bug) scaleLabel_ = new QLabel(QStringLiteral("1.0×"), this); - scaleLabel_->setStyleSheet(QStringLiteral("border:none;color:#888;min-width:36px;")); + applyTokenizedStyleSheet(scaleLabel_, + QStringLiteral("border:none;color:{{text/secondary}};min-width:36px;")); connect(scaleSlider_, &QSlider::valueChanged, this, [this](int v) { scaleLabel_->setText(QStringLiteral("%1.0×").arg(v)); }); scaleRow->addWidget(scaleSlider_, 1); @@ -111,9 +115,7 @@ AxesSettingsPanel::AxesSettingsPanel(QWidget* parent) : QFrame(parent) { auto* btns = new QHBoxLayout(); auto* cancel = new QPushButton(QStringLiteral("取消"), this); auto* apply = new QPushButton(QStringLiteral("应用"), this); - apply->setStyleSheet(QStringLiteral( - "QPushButton{background:#2f6fed;color:white;border:none;border-radius:6px;padding:6px 18px;}" - "QPushButton:hover{background:#2a63d4;}")); + apply->setDefault(true); // 主按钮:走全局 QPushButton:default 样式(accent/primary,随主题),不再硬编码蓝 connect(cancel, &QPushButton::clicked, this, &AxesSettingsPanel::closed); connect(apply, &QPushButton::clicked, this, [this] { auto rd = [](const Row& r) { @@ -147,7 +149,7 @@ AxesSettingsPanel::Row AxesSettingsPanel::addAxisRow(QVBoxLayout* col, const QSt auto* range = new QHBoxLayout(); auto* loCol = new QVBoxLayout(); auto* loLbl = new QLabel(QStringLiteral("最小值"), this); - loLbl->setStyleSheet(QStringLiteral("border:none;color:#888;")); + applyTokenizedStyleSheet(loLbl, QStringLiteral("border:none;color:{{text/tertiary}};")); loCol->addWidget(loLbl); r.lo = new QDoubleSpinBox(this); r.lo->setRange(-1e6, 1e6); @@ -156,7 +158,7 @@ AxesSettingsPanel::Row AxesSettingsPanel::addAxisRow(QVBoxLayout* col, const QSt range->addLayout(loCol); auto* hiCol = new QVBoxLayout(); auto* hiLbl = new QLabel(QStringLiteral("最大值"), this); - hiLbl->setStyleSheet(QStringLiteral("border:none;color:#888;")); + applyTokenizedStyleSheet(hiLbl, QStringLiteral("border:none;color:{{text/tertiary}};")); hiCol->addWidget(hiLbl); r.hi = new QDoubleSpinBox(this); r.hi->setRange(-1e6, 1e6);