From cf19717debf6b1c916d9b350ade5b348c8a50f83 Mon Sep 17 00:00:00 2001 From: gongheng Date: Fri, 30 Oct 2026 04:34:18 +0800 Subject: [PATCH] fix: use DSuggestButton for encryption page confirm button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: EncryptionPage used DPushButton (plain gray style) for the confirm button, inconsistent with design spec requiring DSuggestButton (blue accent style); layout minimum height (305px) exceeded available DocSheet height at minimum window size (300px), causing the lock icon top to be clipped 2. Fix: replace DPushButton with DSuggestButton for m_nextbutton, add #include , sync signal type in connect call; add setMinimumHeight(305) to prevent layout overflow 3. Impact: only affects encryption page UI; DSuggestButton inherits DPushButton so API is fully compatible; minimum height constraint is local to EncryptionPage and does not affect other pages Log: fix encryption page button style and lock icon clipping Influence: 1. Test encrypted PDF password input page button appears as blue suggest button style 2. Test lock icon fully visible at minimum window size (680x300) 3. Verify password input and confirm button interaction works fix: 修复加密页面确定按钮样式及锁图标截断问题 1. 根因:EncryptionPage 使用 DPushButton(灰色普通样式)作为确定 按钮,与设计图要求的 DSuggestButton(蓝色强调样式)不符;布局 最小高度(305px)超过最小窗口尺寸(300px)下 DocSheet 可用高度, 导致锁图标顶部被截断 2. 方案:将 m_nextbutton 从 DPushButton 替换为 DSuggestButton, 补充 #include ,同步 connect 信号类型; 添加 setMinimumHeight(305) 防止布局溢出 3. 影响:仅影响加密页面 UI;DSuggestButton 继承 DPushButton, API 完全兼容;最小高度约束仅作用于 EncryptionPage,不影响其他页面 Log: 修复加密页面按钮样式及锁图标截断问题 Influence: 1. 测试加密 PDF 密码输入页面的确定按钮显示为蓝色推荐按钮样式 2. 测试最小窗口尺寸(680x300)下锁图标完整可见 3. 验证密码输入与确定按钮交互功能正常 Bug: #193241 PMS: BUG-193241 --- reader/widgets/EncryptionPage.cpp | 8 +++++--- reader/widgets/EncryptionPage.h | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/reader/widgets/EncryptionPage.cpp b/reader/widgets/EncryptionPage.cpp index 08be3f630..198e058fb 100644 --- a/reader/widgets/EncryptionPage.cpp +++ b/reader/widgets/EncryptionPage.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2019 - 2026 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -14,6 +14,7 @@ #include #include +#include EncryptionPage::EncryptionPage(QWidget *parent) : DWidget(parent) @@ -48,7 +49,7 @@ void EncryptionPage::InitUI() edit->setObjectName("passwdEdit"); edit->setPlaceholderText(tr("Password")); - m_nextbutton = new DPushButton(this); + m_nextbutton = new DSuggestButton(this); m_nextbutton->setObjectName("ensureBtn"); m_nextbutton->setAccessibleName("Nextbutton"); m_nextbutton->setFixedSize(360, 36); @@ -73,6 +74,7 @@ void EncryptionPage::InitUI() mainlayout->addStretch(); setAutoFillBackground(true); + setMinimumHeight(305); onUpdateTheme(); m_password->lineEdit()->setAttribute(Qt::WA_InputMethodEnabled, false); @@ -84,7 +86,7 @@ void EncryptionPage::InitConnection() { qCDebug(appLog) << "Setting up encryption page signal connections"; connect(m_password, &DPasswordEdit::textChanged, this, &EncryptionPage::onPasswordChanged); - connect(m_nextbutton, &DPushButton::clicked, this, &EncryptionPage::nextbuttonClicked); + connect(m_nextbutton, &DSuggestButton::clicked, this, &EncryptionPage::nextbuttonClicked); connect(dApp, SIGNAL(sigSetPasswdFocus()), this, SLOT(onSetPasswdFocus())); } diff --git a/reader/widgets/EncryptionPage.h b/reader/widgets/EncryptionPage.h index ad0bfe9c0..314e9f74b 100644 --- a/reader/widgets/EncryptionPage.h +++ b/reader/widgets/EncryptionPage.h @@ -1,5 +1,5 @@ // Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -77,7 +78,7 @@ private slots: void onUpdateTheme(); private: - DPushButton *m_nextbutton = nullptr; + DSuggestButton *m_nextbutton = nullptr; DPushButton *m_echoBtn = nullptr; DPasswordEdit *m_password = nullptr; };