refactor/pure-qt-ui #3

Merged
gaozheng merged 56 commits from refactor/pure-qt-ui into main 2026-06-10 18:41:53 +08:00
2 changed files with 16 additions and 24 deletions
Showing only changes of commit c8812aa8a6 - Show all commits

View File

@ -20,6 +20,10 @@
#include "AuthService.hpp"
#include "Theme.hpp"
#include <ElaCheckBox.h>
#include <ElaLineEdit.h>
#include <ElaPushButton.h>
namespace geopro::app {
namespace {
@ -95,12 +99,7 @@ LoginWindow::LoginWindow(geopro::net::AuthService& auth, QWidget* parent)
"#brandTitle { color: #FFFFFF; font-size: %1px; font-weight: %2; }"
"#brandSubtitle { color: rgba(255,255,255,0.82); font-size: %3px; }"
"#fieldLabel { color: #5A6B85; font-size: %4px; font-weight: %5; }"
"QLineEdit {"
" background: #FFFFFF; color: #1F2A3D;"
" border: 1px solid #C7D2E0; border-radius: 8px; padding: 0 12px;"
" selection-background-color: #2D6CB5; selection-color: #FFFFFF; }"
"QLineEdit:focus { border: 1px solid #2D6CB5; }"
"QLineEdit:disabled { background: #F0F2F6; color: #8A93A3; }"
// 输入框已 Ela 化(ElaLineEdit 自绘 Fluent + 自动明暗),不再写 QLineEdit QSS。
"#captchaImg { border: 1px solid #C7D2E0; border-radius: 8px; background: #EEF2FB; }")
.arg(type::kDisplay)
.arg(type::kWeightBold)
@ -146,12 +145,12 @@ LoginWindow::LoginWindow(geopro::net::AuthService& auth, QWidget* parent)
form->addSpacing(6);
};
userEdit_ = new QLineEdit(body);
userEdit_ = new ElaLineEdit(body);
userEdit_->setPlaceholderText(QStringLiteral("请输入用户名"));
userEdit_->setClearButtonEnabled(true);
addField(QStringLiteral("用户名"), userEdit_);
pwdEdit_ = new QLineEdit(body);
pwdEdit_ = new ElaLineEdit(body);
pwdEdit_->setEchoMode(QLineEdit::Password);
pwdEdit_->setPlaceholderText(QStringLiteral("请输入密码"));
addField(QStringLiteral("密码"), pwdEdit_);
@ -163,7 +162,7 @@ LoginWindow::LoginWindow(geopro::net::AuthService& auth, QWidget* parent)
auto* captchaRow = new QHBoxLayout();
captchaRow->setSpacing(10);
codeEdit_ = new QLineEdit(body);
codeEdit_ = new ElaLineEdit(body);
codeEdit_->setMinimumHeight(40);
codeEdit_->setPlaceholderText(QStringLiteral("请输入验证码"));
captchaLabel_ = new QLabel(body);
@ -187,10 +186,8 @@ LoginWindow::LoginWindow(geopro::net::AuthService& auth, QWidget* parent)
form->addLayout(refreshRow);
// 记住登录:勾选后成功登录将安全存储 token30 天内免登录。默认不勾(更安全)。
rememberChk_ = new QCheckBox(QStringLiteral("记住登录30 天内免登录)"), body);
rememberChk_->setCursor(Qt::PointingHandCursor);
rememberChk_->setStyleSheet(
QStringLiteral("color:#5A6B85; font-size:%1px;").arg(type::kBody));
rememberChk_ = new ElaCheckBox(QStringLiteral("记住登录30 天内免登录)"), body);
rememberChk_->setCursor(Qt::PointingHandCursor); // ElaCheckBox 自绘 Fluent + 自动明暗
form->addWidget(rememberChk_);
// 错误提示:固定占位高度,避免出现时整体布局跳动。
@ -204,17 +201,9 @@ LoginWindow::LoginWindow(geopro::net::AuthService& auth, QWidget* parent)
form->addStretch();
// 主操作满宽强调主按钮von Restorff唯一高强调元素引导主流程
loginBtn_ = new QPushButton(QStringLiteral("登 录"), body);
loginBtn_ = new ElaPushButton(QStringLiteral("登 录"), body); // Fluent 主按钮(自动明暗)
loginBtn_->setMinimumHeight(44);
loginBtn_->setCursor(Qt::PointingHandCursor);
loginBtn_->setStyleSheet(QStringLiteral(
"QPushButton { background: #2D6CB5; color: #FFFFFF; border: none; border-radius: 8px; "
"font-size: %1px; font-weight: %2; }"
"QPushButton:hover { background: #2862A6; }"
"QPushButton:pressed { background: #234F87; }"
"QPushButton:disabled { background: #9FB4CC; }")
.arg(type::kTitle)
.arg(type::kWeightSemibold));
loginBtn_->setDefault(true);
form->addWidget(loginBtn_);

View File

@ -966,7 +966,11 @@ int main(int argc, char* argv[])
QCoreApplication::setOrganizationName(QStringLiteral("Geomative"));
QCoreApplication::setApplicationName(QStringLiteral("Geopro3"));
// 浅色专业主题Fusion + 调色板 + 全局样式表):仅外观,登录窗与工作台共用。
// ElaApplicationFluent 主题/字体/动画基建。无条件初始化——登录窗与各面板已 Ela 化,
// 两种壳都需要它登录发生在选壳之前。Ela 控件跟随 ElaTheme标准控件仍由下面 QSS 接管。
eApp->init();
// 专业主题Fusion + 调色板 + 全局样式表):标准控件外观,登录窗与工作台共用。
geopro::app::applyTheme(app);
// PROJ 数据(proj.db)定位:体素配准的 CrsTransform 需要。优先已设环境变量;
@ -1022,7 +1026,6 @@ int main(int argc, char* argv[])
const QString kTitle = QStringLiteral("Geopro 3.0 — 项目分析视图 (M1)");
QWidget* topLevel = nullptr;
if (qEnvironmentVariable("GEOPRO_UI_SHELL") == QLatin1String("ela")) {
eApp->init(); // ElaApplicationFluent 主题/字体/动画基建
auto* ela = new ElaWindow;
ela->setWindowTitle(kTitle);
ela->resize(1280, 800);