Skip to content

fix(PasswordEdit): use edit.actionIconSize for echo button icon size - #725

Merged
18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
iCancely:fix/password-edit-icon-size
Oct 16, 2026
Merged

18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
iCancely:fix/password-edit-icon-size

Conversation

@iCancely

@iCancely iCancely commented Oct 16, 2026 •

Copy link
Copy Markdown

问题

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:

  • Set the password visibility button icon size explicitly to match the edit field’s configured action icon size.

@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

PasswordEdit 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

Change Details Files
Explicitly align the password visibility icon dimensions with the edit action icon style.
  • Set echoButton icon width and height to DS.Style.edit.actionIconSize.
  • Apply the same implementation to both Qt5 and Qt6 variants.
  • Update the SPDX copyright year range.
src/qml/PasswordEdit.qml
qt6/src/qml/PasswordEdit.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@iCancely iCancely changed the title fix(PasswordEdit): 显式指定密码显示/隐藏按钮图标尺寸为 edit.actionIconSize fix(PasswordEdit): use edit.actionIconSize for echo button icon size Oct 16, 2026
Comment thread src/qml/PasswordEdit.qml
@iCancely
iCancely force-pushed the fix/password-edit-icon-size branch from e44dbca to 423935c Compare October 16, 2026 08:31
@iCancely
iCancely changed the base branch from master to v25-flowstyle October 16, 2026 08:38
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.
@18202781743

Copy link
Copy Markdown
Contributor

从v25-flowstyle这个分支开始修,修的创建的pr也是应该向v25-flowstyle分支合入,

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 95 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 95 分,大于 70 分通过阈值,代码质量符合要求。本次 PR 包含 20 个提交,涉及 65 个代码文件,主要变更包括:PasswordEdit 图标尺寸修复、smooth 属性传播至多个 QML 组件、ArrowListView 弹出尺寸修复、ComboBox 弹出高度计算优化、标题栏分屏菜单功能、SliderTipItem 刻度文本自动对齐、CMake Windows DLL 安装路径修复等。代码结构清晰,无安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 良好 ✅ 通过

潜在问题:

  1. qt6/src/qml/WindowButtonGroup.qml:879 - hideSplitMenu 函数调用 control.__dwindow.hideSplitMenu(delay) 前未做空值检查,潜在运行时 TypeError 风险

建议: 建议在 hideSplitMenu 和 showSplitMenu 函数中增加对 control.__dwindow 的空值检查,如 if (!control.__dwindow) return false; 以增强代码的健壮性。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. qt6/src/qml/ComboBox.qml:412 - 注释中的数字 60 与实际代码 2 * DS.Style.arrowListView.itemHeight 不一致,可能误导维护者

建议: 建议将注释更新为 '// Use a temporary viewport height (2 * itemHeight) so the list can realize one row and be measured.' 以匹配实际代码逻辑。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 性能良好,所有新增计算均为 O(1) 或小规模 O(n) 操作,且仅在用户交互时触发,无性能瓶颈。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无安全风险。代码为 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 代码审查工具自动生成

@iCancely
iCancely force-pushed the fix/password-edit-icon-size branch from 423935c to 8c146aa Compare October 16, 2026 08:50
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743
18202781743 merged commit 71d92b3 into linuxdeepin:v25-flowstyle Oct 16, 2026
17 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants