feat(ela): P1 换壳 — ElaWindow 包裹工作台(GEOPRO_UI_SHELL=ela 开关)

- src/app/CMakeLists: 链接 ElaWidgetTools + 部署 Qt 插件(platforms/imageformats/iconengines/styles)到 exe 旁
- main.cpp: GEOPRO_UI_SHELL=ela 时用 ElaWindow.setCentralCustomWidget 包裹内层 QMainWindow 承载工作台;
  经典壳为默认且行为不变(仅改堆分配); buildWorkbench 零改动; 全程可回退
- build.bat: 还原(撤销上次破坏脚本解析的中文 TEMP 注释); 构建临时目录改由调用方 TEMP->D: 设置
This commit is contained in:
gaozheng 2026-06-09 21:34:27 +08:00
parent c4d76f57b6
commit fc282824b9
3 changed files with 41 additions and 13 deletions

View File

@ -19,12 +19,6 @@ set "ROOT=%~dp0"
set "BUILDDIR=%ROOT%build\release"
set "PRESET=msvc-release"
REM 把临时目录指向 D: 的构建目录,规避 C: 盘满导致链接器写 %TEMP% 失败(LNK1108)。
REM 仅作用于本次构建(setlocal 作用域),不污染用户 shell。注意仍建议尽快清理 C: 盘。
set "TEMP=%BUILDDIR%\tmp"
set "TMP=%BUILDDIR%\tmp"
if not exist "%TEMP%" mkdir "%TEMP%"
REM --- locate Visual Studio (vswhere lives at a fixed path) ---
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%VSWHERE%" (

View File

@ -35,6 +35,7 @@ target_link_libraries(geopro_desktop PRIVATE
Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Svg
${VTK_LIBRARIES}
ads::qt6advanceddocking
ElaWidgetTools # Fluent UI feat/elawidgettoolsElaWindow/ElaTheme/Ela*
qt6keychain
nlohmann_json::nlohmann_json
geopro_core # Phase 1ColorScale
@ -51,4 +52,14 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:geopro_desktop> $<TARGET_FILE_DIR:geopro_desktop>
COMMAND_EXPAND_LISTS)
# Qt platforms imageformats/iconengines ElaWidgetTools SVG
# styles Qt6::Core Qt plugins exe windeployqt
# ADS Qt DLL copy
foreach(_pl platforms styles imageformats iconengines)
add_custom_command(TARGET geopro_desktop POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"$<TARGET_FILE_DIR:Qt6::Core>/../plugins/${_pl}"
"$<TARGET_FILE_DIR:geopro_desktop>/${_pl}")
endforeach()
endif()

View File

@ -58,6 +58,9 @@
#include <DockManager.h>
#include <DockWidget.h>
#include <ElaApplication.h>
#include <ElaWindow.h>
#include "model/ColorScale.hpp"
#include "model/Field.hpp"
#include "repo/LocalSampleRepository.hpp"
@ -1007,13 +1010,33 @@ int main(int argc, char* argv[])
geopro::data::ApiProjectRepository projectRepo(api);
geopro::controller::WorkbenchNavController nav(projectRepo);
QMainWindow window;
window.setWindowTitle(QStringLiteral("Geopro 3.0 — 项目分析视图 (M1)"));
window.resize(1280, 800);
window.setMinimumSize(1024, 680); // 防止停靠面板被压到不可用尺寸
buildWorkbench(window, repo, projectRepo, nav);
window.show();
// ── 外壳选择P1 迁移可回退GEOPRO_UI_SHELL=ela → Fluent ElaWindow 壳;
// 未设/其它 → 经典 QMainWindow 壳。两者都复用同一 buildWorkbench(QMainWindow&)。
// Ela 壳策略ElaWindow 用 setCentralCustomWidget 包裹一个承载工作台的内层 QMainWindow
// buildWorkbench 依赖 QMainWindow 的 setCentralWidget/setMenuWidget/statusBar
// ElaWindow 自身将其设为私有,故用内层 QMainWindow 承接,零改 buildWorkbench
const QString kTitle = QStringLiteral("Geopro 3.0 — 项目分析视图 (M1)");
QWidget* topLevel = nullptr;
if (qEnvironmentVariable("GEOPRO_UI_SHELL") == QLatin1String("ela")) {
eApp->init(); // ElaApplicationFluent 主题/字体/动画基建
auto* inner = new QMainWindow;
buildWorkbench(*inner, repo, projectRepo, nav);
auto* ela = new ElaWindow;
ela->setWindowTitle(kTitle);
ela->resize(1280, 800);
ela->setMinimumSize(1024, 680);
ela->setIsNavigationBarEnable(false); // 纯中心内容,不显示左侧导航栏
ela->setCentralCustomWidget(inner); // 工作台作为 ElaWindow 中心内容
topLevel = ela;
} else {
auto* window = new QMainWindow;
window->setWindowTitle(kTitle);
window->resize(1280, 800);
window->setMinimumSize(1024, 680); // 防止停靠面板被压到不可用尺寸
buildWorkbench(*window, repo, projectRepo, nav);
topLevel = window;
}
topLevel->show();
nav.start(); // 进入工作台后拉真实 空间/项目/结构