fix: use active color as fallback for dark active color in treeland#378
Merged
Conversation
Treeland platform does not provide a separate dark active color property. When the system theme is set to dark mode, the dark active color was returning an invalid default value, causing the active color to appear blank or invisible. This fix returns the regular active color as a fallback, ensuring consistent visual appearance in dark themes. Log: Fixed dark active color display issue in treeland platform Influence: 1. Test active color display in light theme mode 2. Test active color display in dark theme mode 3. Verify that active color is visible and correct in both themes 4. Check color consistency when switching between light and dark themes fix: 修复treeland平台暗色主题下活动色无效的问题 Treeland平台没有提供独立的暗色主题活动色属性。当系统主题切换为暗色模式 时,暗色活动色返回了无效的默认值,导致活动色显示为空白或不可见。此修复将 常规活动色作为暗色活动色的回退值,确保在暗色主题下保持一致的视觉表现。 Log: 修复treeland平台暗色主题活动色显示问题 Influence: 1. 测试浅色主题模式下的活动色显示 2. 测试暗色主题模式下的活动色显示 3. 验证两种主题下活动色均可见且正确 4. 检查在切换深浅色主题时颜色的表现一致性 PMS: BUG-344937
BLumia
approved these changes
May 7, 2026
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 |
Contributor
deepin pr auto review这段代码是一个针对 Qt 平台插件(Treeland 平台)的修改,主要是在接口类中新增了一个 以下是对该代码变更的详细审查意见,包括语法逻辑、代码质量、代码性能和代码安全方面: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议这段代码改动简单且功能明确,主要改进点在于文档完善和潜在的健壮性检查。 优化后的代码建议: 头文件: /**
* @brief darkActiveColor 获取深色模式下的高亮色
* @return 返回当前高亮色。注意:Treeland 平台暂不支持独立的深色高亮色,因此此处回退返回普通高亮色。
*/
QColor darkActiveColor() const override;源文件: QColor DTreelandPlatformInterface::darkActiveColor() const
{
// Treeland 后端暂不提供独立的深色高亮色,作为回退策略,返回当前的高亮色。
// 如果 m_activeColor 无效,返回一个默认的蓝色作为保底值。
if (m_activeColor.isValid()) {
return m_activeColor;
}
// 返回一个默认颜色,防止 UI 显示异常
return QColor(0, 120, 215); // 举例:常见的系统高亮蓝
}理由: |
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.
Treeland platform does not provide a separate dark active color
property. When the system theme is set to dark mode, the dark active
color was returning an invalid default value, causing the active color
to appear blank or invisible. This fix returns the regular active color
as a fallback, ensuring consistent visual appearance in dark themes.
Log: Fixed dark active color display issue in treeland platform
Influence:
fix: 修复treeland平台暗色主题下活动色无效的问题
Treeland平台没有提供独立的暗色主题活动色属性。当系统主题切换为暗色模式
时,暗色活动色返回了无效的默认值,导致活动色显示为空白或不可见。此修复将
常规活动色作为暗色活动色的回退值,确保在暗色主题下保持一致的视觉表现。
Log: 修复treeland平台暗色主题活动色显示问题
Influence:
PMS: BUG-344937