Repository navigation
fix(PasswordEdit): use edit.actionIconSize for echo button icon size - #725
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuidePasswordEdit now explicitly sizes the password visibility icon using DS.Style.edit.actionIconSize in both Qt5 and Qt6, matching the clear-button behavior and avoiding reliance on DDciIcon’s implicit size fallback; the touched files also update their copyright year to 2026. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
e44dbca to
423935c
Compare
Explicitly set echo button icon size to DS.Style.edit.actionIconSize, consistent with the clear button in LineEdit. Previously the echo button inherited ActionButton's default iconSize (button.iconSize = 24), which mismatched the DCI file's only available size (16), causing the icon to render at 16x16 via fallback rather than by explicit design.
|
从v25-flowstyle这个分支开始修,修的创建的pr也是应该向v25-flowstyle分支合入, |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 良好 ✅ 通过 潜在问题:
建议: 建议在 hideSplitMenu 和 showSplitMenu 函数中增加对 control.__dwindow 的空值检查,如 if (!control.__dwindow) return false; 以增强代码的健壮性。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议将注释更新为 '// Use a temporary viewport height (2 * itemHeight) so the list can realize one row and be measured.' 以匹配实际代码逻辑。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,所有新增计算均为 O(1) 或小规模 O(n) 操作,且仅在用户交互时触发,无性能瓶颈。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 无安全风险。代码为 UI 库组件,不涉及用户输入处理、网络操作、文件系统操作或数据库操作。dquickwindow.cpp 中的 reinterpret_cast 用于 Qt 平台函数指针转换,函数名为硬编码字符串字面量,不存在注入风险。 💡 改进建议代码示例// WindowButtonGroup.qml - 建议增加空值检查
function hideSplitMenu(delay) {
hoverTimer.stop()
holdTimer.stop()
if (control.__dwindow)
control.__dwindow.hideSplitMenu(delay)
__menuRequested = false
}
function showSplitMenu() {
if (!control.splitScreenEnabled || !visible || !enabled)
return false
if (!control.__dwindow)
return false
if (!__menuRequested)
__menuRequested = control.__dwindow.showSplitMenu(maxOrWindedBtn)
return __menuRequested
}
// ComboBox.qml - 建议更新注释
// Use a temporary viewport height (2 * itemHeight) so the
// list can realize one row and be measured.
implicitHeight: (contentItem.sizedHeight > 0
? contentItem.sizedHeight
: 2 * DS.Style.arrowListView.itemHeight)
+ topPadding + bottomPadding本报告由 AI 代码审查工具自动生成 |
423935c to
8c146aa
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, iCancely The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
71d92b3
into
linuxdeepin:v25-flowstyle
问题
PasswordEdit 中密码显示/隐藏按钮(echoButton)的图标尺寸继承自 ActionButton 的默认值
button.iconSize(24),而 DCI 图标文件entry_password_shown.dci/entry_password_hide.dci内部只提供 16 这一个尺寸。DDciIcon 找不到 24 就回退到 16,图标实际渲染为 16×16,但这是隐式回退的结果,并非显式指定。同一输入框中的清除按钮(clearButton)在 LineEdit.qml 中显式使用了
DS.Style.edit.actionIconSize(Qt5 为 24,Qt6 为 16),两个按钮的图标尺寸来源不一致。修复
在 PasswordEdit.qml 的 echoButton 中显式指定
icon.width和icon.height为DS.Style.edit.actionIconSize,与清除按钮保持一致,使图标尺寸意图明确而非依赖 DCI 回退。变更文件
src/qml/PasswordEdit.qml(Qt5)qt6/src/qml/PasswordEdit.qml(Qt6)Summary by Sourcery
Bug Fixes: