fix: DLineEdit增加Alert文本对齐接口#654
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shao-jun 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 |
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#654
DLineEdit的Alert文本默认是居中对齐,针对多行文本的情况需要控制其对齐方向; 原接口setMessageAlignment是修改Alert弹框的对齐方式,接口名称容易误解成修改文本,将其实现修改成文本对齐方式; 新接口setAlertAlignment,用于修改Alert弹框的对齐方式; Log: Influence: DLineEdit的Alert效果 Change-Id: I251400365fc6fdc29ee1cb1f11efdc81eaf2d939
deepin pr auto review关键摘要:
是否建议立即修改:
|
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#654
|
TAG Bot New tag: 5.7.14 |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces separate APIs for controlling alert popup alignment and text alignment in DLineEdit to resolve ambiguity between the existing setMessageAlignment interface and actual alert alignment functionality.
- Added new API setAlertAlignment and alertAlignment in DLineEdit and DAlertControl.
- Introduced a new private member for text alignment with corresponding getters and setters.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/widgets/private/dalertcontrol_p.h | Added a new messageAlignment property to control text alignment in alerts. |
| src/widgets/dlineedit.cpp | Exposed new APIs for alert alignment and its getter. |
| src/widgets/dalertcontrol.cpp | Renamed setMessageAlignment/getMessageAlignment to separate text alignment from alert alignment and introduced new alert alignment APIs. |
| include/widgets/dlineedit.h | Updated header to declare new alert alignment interfaces. |
| include/widgets/dalertcontrol.h | Updated header to declare new alert alignment interfaces. |
| Qt::Alignment messageAlignment{Qt::AlignLeft}; | ||
| QTimer timer; |
There was a problem hiding this comment.
Default initialization of messageAlignment is set to Qt::AlignLeft, but documentation in dalertcontrol.cpp indicates a default of center alignment. Consider updating the default value to Qt::AlignCenter for consistency.
| Qt::Alignment messageAlignment{Qt::AlignLeft}; | |
| QTimer timer; | |
| Qt::Alignment messageAlignment{Qt::AlignCenter}; |
|
TAG Bot New tag: 5.7.15 |
|
TAG Bot New tag: 5.7.16 |
|
TAG Bot New tag: 5.7.17 |
|
TAG Bot New tag: 5.7.18 |
|
TAG Bot New tag: 5.7.19 |
DLineEdit的Alert文本默认是居中对齐,针对多行文本的情况需要控制其对齐方向;
原接口setMessageAlignment是修改Alert弹框的对齐方式,接口名称容易误解成修改文本,将其实现修改成文本对齐方式;
新接口setAlertAlignment,用于修改Alert弹框的对齐方式;
Log:
Influence: DLineEdit的Alert效果
Change-Id: I251400365fc6fdc29ee1cb1f11efdc81eaf2d939