feat: add support for custom line edit icon margin#696
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Oct 28, 2025
Merged
feat: add support for custom line edit icon margin#69618202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 24, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#696
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 24, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#696
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 24, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#696
BLumia
approved these changes
Oct 28, 2025
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Added PM_LineEditIconMargin pixel metric handling to support custom icon margins in line edit widgets. The implementation checks for a "_d_dtk_lineeditIconMargin" property on the widget and returns the custom margin value if valid. This allows applications to specify precise icon spacing in line edit fields for better UI customization and visual consistency. Influence: 1. Test line edit widgets with custom icon margin property set 2. Verify default behavior when no custom margin is specified 3. Test with various valid margin values (positive integers) 4. Verify behavior with invalid margin values (negative numbers, invalid types) 5. Check UI layout consistency with custom icon margins applied feat: 添加支持自定义行编辑图标边距 添加了 PM_LineEditIconMargin 像素度量处理,以支持在行编辑部件中自定义图 标边距。该实现检查部件上的 "_d_dtk_lineeditIconMargin" 属性,如果有效则 返回自定义边距值。这允许应用程序为行编辑字段指定精确的图标间距,以实现更 好的 UI 定制和视觉一致性。 Influence: 1. 测试设置了自定义图标边距属性的行编辑部件 2. 验证未指定自定义边距时的默认行为 3. 使用各种有效边距值(正整数)进行测试 4. 验证无效边距值(负数、无效类型)时的行为 5. 检查应用自定义图标边距后的 UI 布局一致性 PMS: BUG-334965
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 28, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#696
Contributor
deepin pr auto review我来对这个diff进行审查:
改进建议:
/**
* @brief 设置行编辑框图标的边距
* @param object 目标QObject对象
* @param margin 图标边距值,必须为非负数
*/
static void setLineEditIconMargin(QObject *object, int margin);
void DStyle::setLineEditIconMargin(QObject *object, int margin)
{
if (!object || margin < 0) {
return;
}
object->setProperty("_d_dtk_lineeditIconMargin", margin);
}
static int lineEditIconMargin(const QObject *object);
static const char* const LINE_EDIT_ICON_MARGIN_PROPERTY = "_d_dtk_lineeditIconMargin";
static const int DEFAULT_LINE_EDIT_ICON_MARGIN = 0; // 或其他合适的默认值这些改进建议主要是为了提高代码的可维护性、完整性和健壮性,但现有的实现已经基本满足功能需求。 |
18202781743
pushed a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Oct 28, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#696
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added PM_LineEditIconMargin pixel metric handling to support custom
icon margins in line edit widgets. The implementation checks for a
"_d_dtk_lineeditIconMargin" property on the widget and returns the
custom margin value if valid. This allows applications to specify
precise icon spacing in line edit fields for better UI customization and
visual consistency.
Influence:
types)
feat: 添加支持自定义行编辑图标边距
添加了 PM_LineEditIconMargin 像素度量处理,以支持在行编辑部件中自定义图
标边距。该实现检查部件上的 "_d_dtk_lineeditIconMargin" 属性,如果有效则
返回自定义边距值。这允许应用程序为行编辑字段指定精确的图标间距,以实现更
好的 UI 定制和视觉一致性。
Influence:
PMS: BUG-334965