From 8eb0c7413d94db3beb0801dfad97285fe22ecbf1 Mon Sep 17 00:00:00 2001 From: gaozheng Date: Wed, 10 Jun 2026 16:03:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(canvas):=20=E7=A9=BA=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8E=BB=E4=B8=8D=E9=80=8F=E6=98=8E=E5=8D=A1=E7=89=87(?= =?UTF-8?q?=E7=A7=BB=E9=99=A4OpacityEffect)=20+=20=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E8=BD=AC=E6=B7=B1=E8=89=B2=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E6=B5=AE=E5=B1=82=EF=BC=88=E8=A7=84=E8=8C=83=C2=A76.5/=C2=A77.?= =?UTF-8?q?11=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/main.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 4270dea..c83497f 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -349,19 +349,19 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re // 仅三维视图显示;含 帘面 / 体素 勾选(体素=两交叉测线散点配准 IDW 的派生层,正确归宿)。 auto* layerPanel = new QFrame(centerWidget); layerPanel->setFrameShape(QFrame::StyledPanel); - geopro::app::applyThemedStyleSheet( + geopro::app::applyTokenizedStyleSheet( layerPanel, - QStringLiteral("QFrame{background:#FFFFFF;border:1px solid #D5DBE5;border-radius:8px;}" - "QCheckBox{padding:2px 1px;color:#1F2A3D;}" - "QCheckBox:disabled{color:#9AA6B6;}")); + QStringLiteral("QFrame{background:{{canvas/bg-soft}};border:1px solid {{canvas/grid}};border-radius:8px;}" + "QCheckBox{padding:2px 1px;color:{{canvas/text}};}" + "QCheckBox:disabled{color:{{canvas/text-dim}};}")); auto* layerLayout = new QVBoxLayout(layerPanel); // 浮层内边距取间距令牌:左右 lg(12)、上下 ml(10),对称(原 13/10/15/11 是手调奇数)。 layerLayout->setContentsMargins(geopro::app::space::kLg, geopro::app::space::kMl, geopro::app::space::kLg, geopro::app::space::kMl); layerLayout->setSpacing(geopro::app::space::kSm); auto* layerTitle = new QLabel(QStringLiteral("视图详情")); - geopro::app::applyThemedStyleSheet( - layerTitle, QStringLiteral("font-weight:%1;color:#2D6CB5;border:none;background:transparent;" + geopro::app::applyTokenizedStyleSheet( + layerTitle, QStringLiteral("font-weight:%1;color:{{canvas/text}};border:none;background:transparent;" "padding-bottom:3px;font-size:%2px;") .arg(geopro::app::type::kWeightSemibold) .arg(geopro::app::scaledPx(geopro::app::type::kTitle))); @@ -397,6 +397,7 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re auto* emptyState = new QFrame(centerWidget); emptyState->setObjectName(QStringLiteral("centralEmpty")); emptyState->setAttribute(Qt::WA_TransparentForMouseEvents); + emptyState->setAttribute(Qt::WA_TranslucentBackground); // 透明浮于深色画布(不让控件填充不透明底) emptyState->setStyleSheet(QStringLiteral( "#centralEmpty { background: transparent; }" "#centralEmpty QLabel { background: transparent; }")); @@ -435,16 +436,6 @@ void buildWorkbench(QMainWindow& window, geopro::data::LocalSampleRepository& re auto* emptyCentering = new CenterOverlay(emptyState, vtkWidget); emptyCentering->reposition(); - // 引导层淡入(350ms,仅透明度,OutCubic):首屏空态出现的克制过渡,不阻塞任务。 - auto* esFx = new QGraphicsOpacityEffect(emptyState); - emptyState->setGraphicsEffect(esFx); - auto* esAnim = new QPropertyAnimation(esFx, "opacity", emptyState); - esAnim->setDuration(350); - esAnim->setStartValue(0.0); - esAnim->setEndValue(1.0); - esAnim->setEasingCurve(QEasingCurve::OutCubic); - esAnim->start(QAbstractAnimation::DeleteWhenStopped); - auto* vtkDock = new ads::CDockWidget(QStringLiteral("二维地图/三维视图")); vtkDock->setWidget(centerWidget); auto* centerDockArea = dockManager->addDockWidget(ads::CenterDockWidgetArea, vtkDock);