Skip to content

sync: from linuxdeepin/dtkdeclarative#308

Closed
deepin-ci-robot wants to merge 1 commit intomasterfrom
sync-pr-535-nosync
Closed

sync: from linuxdeepin/dtkdeclarative#308
deepin-ci-robot wants to merge 1 commit intomasterfrom
sync-pr-535-nosync

Conversation

@deepin-ci-robot
Copy link
Contributor

@deepin-ci-robot deepin-ci-robot commented Oct 9, 2025

Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#535

Summary by Sourcery

Synchronize flow style metrics from linuxdeepin/dtkdeclarative by adjusting default dimensions for controls

Enhancements:

  • Decrease default corner radius from 8 to 6
  • Reduce button and comboBox heights from 36 to 30
  • Lower dialog window content horizontal margin from 10 to 6

Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#535
@deepin-ci-robot
Copy link
Contributor Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-ci-robot

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

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 9, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR synchronizes UI metric updates from upstream, refining default styling values by uniformly reducing corner radius, component heights, and horizontal margins in FlowStyle.qml.

Class diagram for updated FlowStyle.qml properties

classDiagram
    class FlowStyle {
        +control: QtObject
        +button: QtObject
        +comboBox: QtObject
        +dialogWindow: QtObject
    }
    class control {
        +radius: int = 6
        +spacing: int = 6
        +padding: int = 6
        +borderWidth: int = 1
    }
    class button {
        +width: int = 140
        +height: int = 30
        +hPadding: int = control.radius
        +vPadding: float = control.radius / 2.0
        +iconSize: int = 24
    }
    class comboBox {
        +width: int = 240
        +height: int = 30
        +padding: int = 8
        +spacing: int = 10
        +iconSize: int = 12
    }
    class dialogWindow {
        +width: int = 120
        +height: int = 120
        +contentHMargin: int = 6
        +footerMargin: int = 10
        +titleBarHeight: int = 50
        +iconSize: int = 32
    }
    FlowStyle --> control
    FlowStyle --> button
    FlowStyle --> comboBox
    FlowStyle --> dialogWindow
Loading

File-Level Changes

Change Details Files
Reduced default control corner radius
  • Decreased radius from 8 to 6
qt6/src/qml/FlowStyle.qml
Lowered default heights for interactive components
  • Adjusted button height from 36 to 30
  • Adjusted comboBox height from 36 to 30
qt6/src/qml/FlowStyle.qml
Reduced dialog horizontal margin
  • Lowered contentHMargin from 10 to 6
qt6/src/qml/FlowStyle.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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link
Contributor Author

deepin pr auto review

我对这个git diff进行了审查,以下是关于代码改进的意见:

  1. 语法逻辑:
  • 代码整体语法逻辑正确,没有明显的语法错误
  • 注意到一处浮点数除法:control.radius / 2.0,虽然可以工作,但由于radius是int类型,建议使用整数运算以提高性能
  1. 代码质量:
  • 代码结构清晰,使用了Qt的属性嵌套结构,符合Qt QML的最佳实践
  • 属性命名规范统一,使用驼峰命名法
  • 建议添加注释说明这些样式属性的整体设计理念和用途
  1. 代码性能:
  • 将多处height值从36减小到30,这可能会影响UI布局,需要确保所有相关组件都能适应新的尺寸
  • 将radius从8减小到6,contentHMargin从10减小到6,这些改动可能会使UI看起来更紧凑,需要验证视觉效果
  • 建议对这些尺寸值使用常量定义,便于全局管理和修改
  1. 代码安全:
  • 没有发现明显的安全问题
  • 建议为这些样式属性添加合理的范围检查,确保尺寸值不会出现负数或过大值

改进建议:

  1. 对于浮点数除法问题:
property int vPadding: Math.floor(control.radius / 2)  // 使用整数运算
  1. 建议添加常量定义:
QtObject {
    // 常量定义
    readonly property int DEFAULT_SPACING: 6
    readonly property int DEFAULT_RADIUS: 6
    readonly property int DEFAULT_BUTTON_HEIGHT: 30
    
    property QtObject control: QtObject {
        property int radius: DEFAULT_RADIUS
        property int spacing: DEFAULT_SPACING
        // ...
    }
    
    property QtObject button: QtObject {
        property int height: DEFAULT_BUTTON_HEIGHT
        // ...
    }
}
  1. 建议添加注释:
/*
 * FlowStyle - 定义了Flow组件的基础样式
 * 包含控制元素、按钮、对话框等通用样式定义
 */
QtObject {
    // ...
}
  1. 建议添加属性验证:
property QtObject control: QtObject {
    property int radius: Math.max(0, 6)  // 确保半径不为负
    // ...
}

总结:
这些修改主要是将UI元素尺寸调小,可能会影响整体视觉效果和布局。建议在实际应用中:

  1. 进行充分的UI测试,确保所有组件在新尺寸下仍能正常显示
  2. 考虑使用响应式设计,使界面能够适应不同的屏幕尺寸
  3. 如果这是一个主题系统,建议提供多个尺寸选项供用户选择
  4. 记录这些样式变更,以便后续维护和版本控制

@18202781743 18202781743 closed this Oct 9, 2025
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.

2 participants