From 2ac8e535183da59a531057fd433b9d8e2b28e82c Mon Sep 17 00:00:00 2001 From: zhangkun Date: Tue, 21 Oct 2025 12:27:52 +0800 Subject: [PATCH] feat: add customizable padding properties to DialogWindow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- qt6/src/qml/DialogWindow.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qt6/src/qml/DialogWindow.qml b/qt6/src/qml/DialogWindow.qml index 7bd44968e..1c4f120f3 100644 --- a/qt6/src/qml/DialogWindow.qml +++ b/qt6/src/qml/DialogWindow.qml @@ -30,6 +30,8 @@ Window { property string icon default property alias content: contentLoader.children property alias palette : content.palette + property real leftPadding: DS.Style.dialogWindow.contentHMargin + property real rightPadding: DS.Style.dialogWindow.contentHMargin Item { id: content @@ -52,8 +54,8 @@ Window { id: contentLoader Layout.fillWidth: true Layout.preferredHeight: childrenRect.height - Layout.leftMargin: DS.Style.dialogWindow.contentHMargin - Layout.rightMargin: DS.Style.dialogWindow.contentHMargin + Layout.leftMargin: control.leftPadding + Layout.rightMargin: control.rightPadding } } }