From c5393e8ac3d5825590b0dc565b4aa3b388bcd957 Mon Sep 17 00:00:00 2001 From: gaozheng Date: Wed, 10 Jun 2026 10:51:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(ela):=20=E6=A0=87=E9=A2=98=E6=A0=8F?= =?UTF-8?q?=E6=94=B6=E7=B4=A7=20+=20=E5=88=87=E6=8D=A2=E5=99=A8=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E9=87=8D=E5=A4=8D=E4=B8=8B=E6=8B=89=E7=AE=AD=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ElaWindow AppBarHeight 45→38(默认偏大, 更接近原生标题栏高度)(点1 过大) - 切换器去掉文字里手加的 '▾'(ElaToolButton 给带菜单按钮自绘展开箭头, 原来与文字▾重复)(点2) - 注: 显示为 100% 缩放, 无 DPI 模糊; 若 Ela 自带标题栏图标仍觉软, 属其 Fluent 渲染风格 --- src/app/TopBar.cpp | 12 +++++------- src/app/main.cpp | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/TopBar.cpp b/src/app/TopBar.cpp index 9d3d1d4..9903acf 100644 --- a/src/app/TopBar.cpp +++ b/src/app/TopBar.cpp @@ -233,7 +233,7 @@ void TopBar::setWorkspaces(const std::vector& list, const QStri group->addAction(a); if (id == currentId) currentName = name; QObject::connect(a, &QAction::triggered, this, [this, id, name]() { - wsBtn_->setText(name + QStringLiteral(" ▾")); // 立即反馈 + wsBtn_->setText(name); // 立即反馈(下拉箭头由 ElaToolButton 自绘) emit workspaceSwitchRequested(id); }); } @@ -242,8 +242,7 @@ void TopBar::setWorkspaces(const std::vector& list, const QStri none->setEnabled(false); } wsBtn_->setMenu(menu); - wsBtn_->setText((currentName.isEmpty() ? QStringLiteral("选择空间") : currentName) + - QStringLiteral(" ▾")); + wsBtn_->setText(currentName.isEmpty() ? QStringLiteral("选择空间") : currentName); } void TopBar::setProjects(const std::vector& list, const QString& currentId, @@ -264,7 +263,7 @@ void TopBar::setProjects(const std::vector& list, const QS group->addAction(a); if (id == currentId) currentName = name; QObject::connect(a, &QAction::triggered, this, [this, id, name]() { - projBtn_->setText(name + QStringLiteral(" ▾")); + projBtn_->setText(name); emit projectSwitchRequested(id); }); } @@ -278,12 +277,11 @@ void TopBar::setProjects(const std::vector& list, const QS QObject::connect(all, &QAction::triggered, this, [this]() { emit allProjectsRequested(); }); } projBtn_->setMenu(menu); - projBtn_->setText((currentName.isEmpty() ? QStringLiteral("选择项目") : currentName) + - QStringLiteral(" ▾")); + projBtn_->setText(currentName.isEmpty() ? QStringLiteral("选择项目") : currentName); } void TopBar::setProjectButtonText(const QString& name) { - projBtn_->setText(name + QStringLiteral(" ▾")); + projBtn_->setText(name); } } // namespace geopro::app diff --git a/src/app/main.cpp b/src/app/main.cpp index 7bc58b6..7b3dd98 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -1095,6 +1095,7 @@ int main(int argc, char* argv[]) ela->resize(1280, 800); ela->setMinimumSize(1024, 680); ela->setIsNavigationBarEnable(false); // 纯中心内容,不显示左侧导航栏 + ela->setAppBarHeight(38); // 默认 45 偏大,收紧标题栏更接近原生 auto* inner = new QMainWindow(ela); // 以 ela 为父,避免无父期调色板/DPI 抖动(review H3) buildWorkbench(*inner, repo, projectRepo, nav); // 用 addPageNode 把工作台作为唯一页面放进中心页栈(填满到底边)。