-
Notifications
You must be signed in to change notification settings - Fork 42
fix: adjust search box placeholder text color #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Updated placeholder text color palette in FlowStyle.qml to improve visibility and contrast. Changed normal mode from semi-transparent dark gray to more opaque black, and dark mode from semi-transparent white to more opaque white. This addresses the search box text color issue where placeholder text was not clearly visible. Added objectName property to TitleBar.qml to support special handling in color selector logic. Modified DQuickControlColorSelector to check for special object names when finding control parent, ensuring proper color inheritance for components with specific object names. Enhanced signal connection safety in DQuickControlColorSelector by checking if signals exist before connecting to them, preventing potential runtime errors when signals are not available on certain control items. Log: Improved search box placeholder text visibility Influence: 1. Test search box placeholder text visibility in both light and dark themes 2. Verify color consistency across different UI components 3. Test color inheritance for components with special object names 4. Verify no runtime errors occur during palette updates 5. Check hover and press state changes work correctly fix: 调整搜索框占位符文字颜色 更新了 FlowStyle.qml 中的占位符文字颜色调色板以提高可见性和对比度。将普 通模式从半透明深灰色改为更不透明的黑色,暗黑模式从半透明白色改为更不透明 的白色。这解决了搜索框文字颜色问题,之前占位符文字不够清晰可见。 在 TitleBar.qml 中添加了 objectName 属性以支持颜色选择器逻辑中的特殊处 理。修改了 DQuickControlColorSelector 在查找控件父级时检查特殊对象名称, 确保具有特定对象名称的组件能够正确继承颜色。 增强了 DQuickControlColorSelector 中的信号连接安全性,在连接信号前检查信 号是否存在,防止在某些控件项上信号不可用时出现运行时错误。 Log: 改进了搜索框占位符文字的可见性 Influence: 1. 测试浅色和深色主题下搜索框占位符文字的可见性 2. 验证不同UI组件间的颜色一致性 3. 测试具有特殊对象名称的组件的颜色继承 4. 验证调色板更新时不会出现运行时错误 5. 检查悬停和按下状态变化是否正常工作 PMS: BUG-271269
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#529
There was a problem hiding this 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 - here's some feedback:
- Consider centralizing the list of special object names (e.g. “ColorSelectorMaster”) into a constant or enum to avoid hard-coded strings and make future updates easier.
- Instead of manually checking signals with metaObject->indexOfSignal, evaluate using QMetaObject::connectSlotsByName or QOverload to simplify and catch missing signal issues at compile time.
- Verify that the new placeholder text colors meet WCAG contrast ratios in both light and dark themes to ensure accessibility standards are maintained.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider centralizing the list of special object names (e.g. “ColorSelectorMaster”) into a constant or enum to avoid hard-coded strings and make future updates easier.
- Instead of manually checking signals with metaObject->indexOfSignal, evaluate using QMetaObject::connectSlotsByName or QOverload to simplify and catch missing signal issues at compile time.
- Verify that the new placeholder text colors meet WCAG contrast ratios in both light and dark themes to ensure accessibility standards are maintained.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Reviewer's guide (collapsed on small PRs)Reviewer's GuidePlaceholder text colors updated for better contrast, TitleBar assigned an objectName for targeted color logic, and DQuickControlColorSelector refined to handle special object names and safely connect signals. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来对这段代码进行审查,并提出改进意见:
normal: Qt.rgba(0, 0, 0, 0.7)
normalDark: Qt.rgba(1, 1, 1, 0.7)
objectName: "ColorSelectorMaster"
if (needUpdateControl && (_d_isControlItem(parentItem) || specialObjectNameItems().contains(parentItem->objectName()))) {
if (m_control->metaObject()->indexOfSignal("paletteChanged()") != -1) {
connect(m_control, SIGNAL(paletteChanged()), this, SLOT(updateControlTheme()));
}
总体而言,这些修改提高了代码的健壮性和灵活性,但在颜色选择、命名规范和代码组织方面还有改进空间。建议根据具体的使用场景和需求进一步优化这些改动。 |
|
[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 |
1 similar comment
|
[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 |
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#529
Updated placeholder text color palette in FlowStyle.qml to improve
visibility and contrast. Changed normal mode from semi-transparent dark
gray to more opaque black, and dark mode from semi-transparent white to
more opaque white. This addresses the search box text color issue where
placeholder text was not clearly visible.
Added objectName property to TitleBar.qml to support special handling in
color selector logic. Modified DQuickControlColorSelector to check for
special object names when finding control parent, ensuring proper color
inheritance for components with specific object names.
Enhanced signal connection safety in DQuickControlColorSelector
by checking if signals exist before connecting to them, preventing
potential runtime errors when signals are not available on certain
control items.
Log: Improved search box placeholder text visibility
Influence:
themes
fix: 调整搜索框占位符文字颜色
更新了 FlowStyle.qml 中的占位符文字颜色调色板以提高可见性和对比度。将普
通模式从半透明深灰色改为更不透明的黑色,暗黑模式从半透明白色改为更不透明
的白色。这解决了搜索框文字颜色问题,之前占位符文字不够清晰可见。
在 TitleBar.qml 中添加了 objectName 属性以支持颜色选择器逻辑中的特殊处
理。修改了 DQuickControlColorSelector 在查找控件父级时检查特殊对象名称,
确保具有特定对象名称的组件能够正确继承颜色。
增强了 DQuickControlColorSelector 中的信号连接安全性,在连接信号前检查信
号是否存在,防止在某些控件项上信号不可用时出现运行时错误。
Log: 改进了搜索框占位符文字的可见性
Influence:
PMS: BUG-271269
Summary by Sourcery
Improve placeholder text contrast and reinforce color selector logic by handling special object names and ensuring safe signal connections
Bug Fixes:
Enhancements: