fix: improve theme compatibility for bluetooth label#361
Merged
Conversation
5e5be63 to
dc9c291
Compare
Reviewer's GuideThis PR refactors the BluetoothAdapterItem’s device label to use DLabel with dynamic theme-aware coloring and spacing, and updates the DeviceControlWidget text transparency for improved readability across light and dark themes. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
18202781743
reviewed
Sep 5, 2025
| }); | ||
| connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [this]{ | ||
| QColor textColor; | ||
| if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { |
Contributor
There was a problem hiding this comment.
代码优化一下,提成一个函数,颜色可以取出来,只修改透明度,
Changed QLabel to DLabel for better theme integration and added dynamic text color handling Added DPaletteHelper and DGuiApplicationHelper includes for theme management Implemented theme change handler to update text color when system theme changes Adjusted text alpha values from 0.75 to 0.6 for better readability across themes Modified bottom margin from 2 to 6 for better spacing These changes ensure consistent text appearance in both light and dark themes and improve the overall visual experience in the bluetooth dock plugin fix: 改进蓝牙标签的主题兼容性 将 QLabel 改为 DLabel 以实现更好的主题集成并添加动态文本颜色处理 添加 DPaletteHelper 和 DGuiApplicationHelper 包含以进行主题管理 实现主题变更处理程序,在系统主题更改时更新文本颜色 将文本透明度值从 0.75 调整为 0.6,以在不同主题下获得更好的可读性 将底部边距从 2 修改为 6 以获得更好的间距 这些更改确保在浅色和深色主题下文本外观一致 并改善蓝牙坞站插件的整体视觉体验 Pms: BUG-332553
dc9c291 to
32cab67
Compare
deepin pr auto review根据提供的代码 diff,我来分析一下改进的内容: 代码审查意见1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
5. 其他建议
namespace {
constexpr qreal LABEL_TEXT_ALPHA = 0.6;
constexpr int LABEL_MARGIN_TOP = 6;
// 其他常量...
}
总的来说,这次改进主要围绕主题适配和界面一致性展开,改动合理且符合 DTK 的设计规范。通过使用 DTK 组件和统一透明度,提升了界面的整体美观度和一致性。 |
18202781743
approved these changes
Sep 5, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich 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 |
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.
Changed QLabel to DLabel for better theme integration and added dynamic text color handling
Added DPaletteHelper and DGuiApplicationHelper includes for theme management
Implemented theme change handler to update text color when system theme changes
Adjusted text alpha values from 0.75 to 0.6 for better readability across themes
Modified bottom margin from 2 to 6 for better spacing
These changes ensure consistent text appearance in both light and dark themes
and improve the overall visual experience in the bluetooth dock plugin
fix: 改进蓝牙标签的主题兼容性
将 QLabel 改为 DLabel 以实现更好的主题集成并添加动态文本颜色处理
添加 DPaletteHelper 和 DGuiApplicationHelper 包含以进行主题管理 实现主题变更处理程序,在系统主题更改时更新文本颜色
将文本透明度值从 0.75 调整为 0.6,以在不同主题下获得更好的可读性
将底部边距从 2 修改为 6 以获得更好的间距
这些更改确保在浅色和深色主题下文本外观一致
并改善蓝牙坞站插件的整体视觉体验
Pms: BUG-332553
Summary by Sourcery
Improve theme compatibility and readability of the Bluetooth dock plugin by integrating labels with the system theme, handling dynamic theme changes, and adjusting text opacity and spacing.
Enhancements: