Skip to content

Conversation

@mhduiy
Copy link
Contributor

@mhduiy mhduiy commented Oct 21, 2025

Added leftPadding and rightPadding properties to DialogWindow component to allow flexible content spacing customization. Previously, content margins were hardcoded using DS.Style.dialogWindow.contentHMargin. Now developers can override these values when needed while maintaining the default behavior.

The changes include:

  1. Added leftPadding and rightPadding properties with default values from DS.Style.dialogWindow.contentHMargin
  2. Updated contentLoader Layout margins to use the new padding properties instead of hardcoded values
  3. This maintains backward compatibility while providing customization flexibility

Log: Added customizable left and right padding properties to DialogWindow

Influence:

  1. Test DialogWindow with default padding values to ensure existing behavior is preserved
  2. Verify custom padding values are properly applied when set
  3. Check that content layout adapts correctly to different padding values
  4. Test with various content types to ensure proper spacing
  5. Verify that the component still renders correctly in different window sizes

feat: 为 DialogWindow 添加可自定义的内边距属性

为 DialogWindow 组件添加 leftPadding 和 rightPadding 属性,允许灵活自定 义内容间距。之前内容边距是使用 DS.Style.dialogWindow.contentHMargin 硬编 码的。现在开发者可以在需要时覆盖这些值,同时保持默认行为。

变更包括:

  1. 添加 leftPadding 和 rightPadding 属性,默认值来自 DS.Style.dialogWindow.contentHMargin
  2. 更新 contentLoader 的布局边距以使用新的内边距属性而非硬编码值
  3. 这保持了向后兼容性,同时提供了自定义灵活性

Log: 为 DialogWindow 添加可自定义的左右内边距属性

Influence:

  1. 使用默认内边距值测试 DialogWindow,确保现有行为得以保留
  2. 验证设置自定义内边距值时是否正确应用
  3. 检查内容布局是否能正确适应不同的内边距值
  4. 使用不同类型的内容测试,确保间距正确
  5. 验证组件在不同窗口大小下是否仍能正确渲染

pms: BUG-317115

Summary by Sourcery

Introduce customizable left and right padding properties to the DialogWindow component and update its content layout to utilize these properties while preserving existing defaults.

New Features:

  • Add leftPadding and rightPadding properties to DialogWindow with default values derived from DS.Style.dialogWindow.contentHMargin

Enhancements:

  • Update contentLoader Layout margins to use the new padding properties instead of hardcoded values

Added leftPadding and rightPadding properties to DialogWindow component
to allow flexible content spacing customization. Previously, content
margins were hardcoded using DS.Style.dialogWindow.contentHMargin. Now
developers can override these values when needed while maintaining the
default behavior.

The changes include:
1. Added leftPadding and rightPadding properties with default values
from DS.Style.dialogWindow.contentHMargin
2. Updated contentLoader Layout margins to use the new padding
properties instead of hardcoded values
3. This maintains backward compatibility while providing customization
flexibility

Log: Added customizable left and right padding properties to
DialogWindow

Influence:
1. Test DialogWindow with default padding values to ensure existing
behavior is preserved
2. Verify custom padding values are properly applied when set
3. Check that content layout adapts correctly to different padding
values
4. Test with various content types to ensure proper spacing
5. Verify that the component still renders correctly in different window
sizes

feat: 为 DialogWindow 添加可自定义的内边距属性

为 DialogWindow 组件添加 leftPadding 和 rightPadding 属性,允许灵活自定
义内容间距。之前内容边距是使用 DS.Style.dialogWindow.contentHMargin 硬编
码的。现在开发者可以在需要时覆盖这些值,同时保持默认行为。

变更包括:
1. 添加 leftPadding 和 rightPadding 属性,默认值来自
DS.Style.dialogWindow.contentHMargin
2. 更新 contentLoader 的布局边距以使用新的内边距属性而非硬编码值
3. 这保持了向后兼容性,同时提供了自定义灵活性

Log: 为 DialogWindow 添加可自定义的左右内边距属性

Influence:
1. 使用默认内边距值测试 DialogWindow,确保现有行为得以保留
2. 验证设置自定义内边距值时是否正确应用
3. 检查内容布局是否能正确适应不同的内边距值
4. 使用不同类型的内容测试,确保间距正确
5. 验证组件在不同窗口大小下是否仍能正确渲染

pms: BUG-317115
@mhduiy mhduiy requested a review from 18202781743 October 21, 2025 05:28
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 21, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#542
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 21, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds leftPadding and rightPadding properties to the DialogWindow component, defaulting to the existing style margin, and refactors the internal content loader to use these properties instead of hardcoded values.

Class diagram for updated DialogWindow properties

classDiagram
    class DialogWindow {
        +real leftPadding
        +real rightPadding
        icon: string
        palette
        content
    }
    DialogWindow --> ContentLoader
    class ContentLoader {
        +Layout.leftMargin
        +Layout.rightMargin
        +Layout.fillWidth
        +Layout.preferredHeight
    }
    DialogWindow : leftPadding = DS.Style.dialogWindow.contentHMargin
    DialogWindow : rightPadding = DS.Style.dialogWindow.contentHMargin
    ContentLoader : Layout.leftMargin = DialogWindow.leftPadding
    ContentLoader : Layout.rightMargin = DialogWindow.rightPadding
Loading

File-Level Changes

Change Details Files
Introduced customizable horizontal padding properties
  • Added leftPadding property with default from DS.Style.dialogWindow.contentHMargin
  • Added rightPadding property with default from DS.Style.dialogWindow.contentHMargin
qt6/src/qml/DialogWindow.qml
Replaced hardcoded content margins with new padding properties
  • Updated Layout.leftMargin to use control.leftPadding
  • Updated Layout.rightMargin to use control.rightPadding
qt6/src/qml/DialogWindow.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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

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

@mhduiy mhduiy merged commit 22f8682 into linuxdeepin:master Oct 21, 2025
19 of 20 checks passed
mhduiy pushed a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 21, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#542
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