fix: fix search icon color inconsistency in DSearchEdit#684
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Sep 11, 2025
Merged
fix: fix search icon color inconsistency in DSearchEdit#68418202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
The search icon button in DSearchEdit had inconsistent foreground colors because the action button was drawn by Qt without using the control's palette foreground color. This change replaces QAction with QWidgetAction to ensure the search icon inherits the correct palette colors from the parent widget. Changed QAction to QWidgetAction and created a DIconButton widget as the default widget for the action. This allows the search icon to properly inherit the palette foreground color from DSearchEdit instead of using Qt's default styling. Also updated all visibility control calls to use defaultWidget()->setVisible() instead of action->setVisible(). Log: Fixed search icon color inconsistency in search edit controls Influence: 1. Test search edit control in different themes to verify icon color consistency 2. Verify search icon visibility transitions during focus changes 3. Test search functionality remains unchanged 4. Check accessibility name is preserved for the icon button 5. Verify placeholder text behavior during mode transitions fix: 修复DSearchEdit中搜索图标颜色不一致问题 DSearchEdit中的搜索图标按钮存在前景色不一致的问题,因为操作按钮由Qt绘 制,没有使用控件的调色板前景色。本次修改将QAction替换为QWidgetAction,确 保搜索图标正确继承父部件的调色板颜色。 将QAction改为QWidgetAction,并创建DIconButton小部件作为操作的 默认小部件。这使得搜索图标能够正确从DSearchEdit继承调色板前景 色,而不是使用Qt的默认样式。同时更新了所有可见性控制调用,使用 defaultWidget()->setVisible()代替action->setVisible()。 Log: 修复搜索编辑控件中搜索图标颜色不一致问题 Influence: 1. 在不同主题下测试搜索编辑控件,验证图标颜色一致性 2. 验证焦点变化时搜索图标可见性转换 3. 测试搜索功能保持不变 4. 检查图标按钮的无障碍名称是否保留 5. 验证模式转换时的占位符文本行为 PMS: BUG-315583
deepin-ci-robot
added a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Sep 8, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#684
Contributor
deepin pr auto review这段代码是对DSearchEdit组件的修改,主要改进了搜索按钮的实现方式。以下是我的审查意见: 语法逻辑
代码质量
代码性能
代码安全
其他建议
总体来说,这次修改提高了代码的可维护性和灵活性,是一个积极的改进。建议在后续的开发中继续保持这种良好的编码习惯。 |
BLumia
approved these changes
Sep 8, 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 |
18202781743
pushed a commit
to linuxdeepin/dtk6widget
that referenced
this pull request
Sep 11, 2025
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#684
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.
The search icon button in DSearchEdit had inconsistent foreground
colors because the action button was drawn by Qt without using the
control's palette foreground color. This change replaces QAction with
QWidgetAction to ensure the search icon inherits the correct palette
colors from the parent widget.
Changed QAction to QWidgetAction and created a DIconButton widget as the
default widget for the action. This allows the search icon to properly
inherit the palette foreground color from DSearchEdit instead of using
Qt's default styling. Also updated all visibility control calls to use
defaultWidget()->setVisible() instead of action->setVisible().
Log: Fixed search icon color inconsistency in search edit controls
Influence:
consistency
fix: 修复DSearchEdit中搜索图标颜色不一致问题
DSearchEdit中的搜索图标按钮存在前景色不一致的问题,因为操作按钮由Qt绘
制,没有使用控件的调色板前景色。本次修改将QAction替换为QWidgetAction,确
保搜索图标正确继承父部件的调色板颜色。
将QAction改为QWidgetAction,并创建DIconButton小部件作为操作的
默认小部件。这使得搜索图标能够正确从DSearchEdit继承调色板前景
色,而不是使用Qt的默认样式。同时更新了所有可见性控制调用,使用
defaultWidget()->setVisible()代替action->setVisible()。
Log: 修复搜索编辑控件中搜索图标颜色不一致问题
Influence:
PMS: BUG-315583