Skip to content

feat(edit): replace file selection icon and adjust button layout - #730

Merged
18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
iCancely:fix/file-selection-icon
Oct 21, 2026
Merged

18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
iCancely:fix/file-selection-icon

Conversation

@iCancely

@iCancely iCancely commented Oct 21, 2026 •

Copy link
Copy Markdown

Summary / 概述

Replace the built-in entry_loadfile DCI icon with a new 16x16 version, and adjust the file selection button layout in the Qt6 exhibition example: icon size 16px, rightmost position, 8px spacing, consistent with clear and echo button layout.

直接替换内置的 entry_loadfile DCI 图标为新的 16x16 版本,并调整 Qt6 exhibition 示例中文件选择按钮的布局:图标尺寸 16px、移至最右侧、间距 8px,与清除按钮和密码显示按钮布局保持一致。

Changes / 变更内容

  1. Replace src/icons/bloom/entry_loadfile.dci with the new 16x16 icon (955 bytes -> 810 bytes)

  2. Update examples/exhibition/qt6/EditControl.qml:

    • Set file button icon size to 16px (matching clear and echo buttons)
    • Move file button to the rightmost position (swap with clear button)
    • Use 8px right margin and 8px gap between buttons (matching PasswordEdit spacing)
  3. 替换 src/icons/bloom/entry_loadfile.dci 为新的 16x16 图标(955 字节 -> 810 字节)

  4. 更新 examples/exhibition/qt6/EditControl.qml:

    • 文件按钮图标尺寸设为 16px(与清除和密码按钮一致)
    • 将文件按钮移至最右侧(与清除按钮交换位置)
    • 右边距和按钮间距均设为 8px(与 PasswordEdit 一致)

Test / 测试

  • Rebuilt dtk6-exhibition and verified the new icon renders correctly

  • Confirmed the icon is embedded in the binary (no runtime dependency on local files)

  • Verified button layout: file button rightmost, clear button to its left, both 8px spacing

  • 重新构建 dtk6-exhibition,验证新图标正常显示

  • 确认图标已嵌入二进制文件(运行时不依赖本地文件)

  • 验证按钮布局:文件按钮在最右侧,清除按钮在其左侧,间距均为 8px

@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR adds a Qt6-only embedded 16×16 file-selection icon and selects its resource bundle during Qt6 builds, while updating all Qt6 edit-control examples so the file button is right-aligned with consistent 16px sizing and 8px spacing relative to the clear button; Qt5 resources remain unchanged.

File-Level Changes

Change Details Files
Adds a Qt6-specific embedded file-selection icon resource while preserving the existing Qt5 resource path.
  • Adds the 16×16 entry_loadfile.dci asset.
  • Introduces a Qt6 .qrc containing the Qt6 assets.
  • Selects the Qt6 or Qt5 resource collection based on QT_VERSION_MAJOR before invoking qt_add_resources.
  • Retains an existence check before resource compilation.
src/icons/qt6/bloom/entry_loadfile.dci
src/dtkdeclarative_assets_qt6.qrc
src/targets.cmake
Reworks Qt6 edit-control file-selection buttons to match the established clear/password-button sizing and spacing.
  • Sets each file button to a square layout with a 16×16 icon.
  • Anchors the file button to the input’s right edge and places the clear button to its left via an 8px margin.
  • Applies the layout consistently to the key, normal, and alert line-edit examples.
examples/exhibition/qt6/EditControl.qml
Updates the Qt6 example file’s copyright range.
  • Extends the SPDX copyright year through 2026.
examples/exhibition/qt6/EditControl.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

Copy link
Copy Markdown
Author

@18202781743

Comment thread src/dtkdeclarative_assets_qt6.qrc Outdated
Comment thread examples/exhibition/qt6/EditControl.qml
1. Replace built-in entry_loadfile DCI with a new 16x16 icon
2. Set file selection button icon size to 16px in Qt6 exhibition example
3. Move file selection button to rightmost position with 8px spacing

Log: Replace file selection icon and adjust button layout in exhibition example
Influence: File selection shows new icon with consistent size and spacing

feat(edit): 替换文件选择图标并调整按钮布局

1. 替换内置 entry_loadfile DCI 为新的 16x16 图标
2. 在 Qt6 exhibition 示例中设置文件选择按钮图标尺寸为 16px
3. 将文件选择按钮移至最右侧,间距为 8px

Log: 替换文件选择图标并调整 exhibition 示例中的按钮布局
Influence: 文件选择显示新图标,尺寸和间距保持一致
@iCancely
iCancely force-pushed the fix/file-selection-icon branch from 44bd6e2 to bcaa58e Compare October 21, 2026 01:44
@iCancely iCancely changed the title feat(edit): update file selection icon and layout for Qt6 feat(edit): replace file selection icon and adjust button layout Oct 21, 2026
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交替换文件选择图标并调整按钮布局,变更集中在 QML 示例文件和二进制图标资源,语法正确、逻辑清晰,无安全漏洞,代码质量和性能均良好。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

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

建议: 无


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

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

建议: 无


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

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

建议: 无


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: 无


💡 改进建议代码示例

本次变更无需修复,代码已符合规范。以下为当前实现的正确写法参考:
```qml LineEdit {
    id: keyLineEdit
    width: Math.max(implicitWidth, editInputMinWidth)
    text: "~/.ssh/ssh_keygen.key"
    clearButton.anchors.rightMargin: fileBtn1.width + 8
    ActionButton {
        id: fileBtn1
        anchors {
            right: parent.right
            rightMargin: 8
            verticalCenter: parent.verticalCenter
        }
        width: height
        icon.name: "entry_loadfile"
        icon.width: 16
        icon.height: 16
        onClicked: {
            keyFileDialog.open()
        }
    }
} ```

本报告由 AI 代码审查工具自动生成

@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 81df4a4 into linuxdeepin:v25-flowstyle Oct 21, 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