-
Notifications
You must be signed in to change notification settings - Fork 28
fix: update battery icon colors and API call #388
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
Changed battery icon fill colors from green (#3ACB00) to black/white for better visual consistency Modified PowerStatusWidget::refreshIcon() to pass only the icon path instead of icon name and path Updated all battery level icons (40%-100%) for both light and dark themes Removed redundant icon name parameter from setIcon() call to simplify API usage Log: Updated battery icon colors for better visual consistency Influence: 1. Test battery level display in system dock with different charge levels 2. Verify battery icons appear correctly in both light and dark themes 3. Check charging state icons when plugged in 4. Test battery percentage display accuracy 5. Verify icon updates when battery level changes fix: 更新电池图标颜色和API调用 将电池图标填充颜色从绿色(#3ACB00)改为黑色/白色,以获得更好的视觉一致性 修改PowerStatusWidget::refreshIcon()方法,仅传递图标路径而非图标名称和 路径 更新所有电池电量级别图标(40%-100%),适用于浅色和深色主题 从setIcon()调用中移除冗余的图标名称参数,简化API使用 Log: 更新电池图标颜色以获得更好的视觉一致性 Influence: 1. 测试系统托盘中不同电量级别的电池显示 2. 验证浅色和深色主题下的电池图标显示正确 3. 检查插入电源时的充电状态图标 4. 测试电池百分比显示的准确性 5. 验证电池电量变化时图标更新正常 PMS: BUG-342033
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the battery dock widget to use a simplified icon-setting API while replacing the green-filled battery SVGs with black/white variants across 40–100% levels for both light and dark, plugged and unplugged states. Sequence diagram for updated battery icon refresh flowsequenceDiagram
participant PowerStatusWidget
participant IconWidget
participant DockApplet
PowerStatusWidget->>PowerStatusWidget: refreshIcon(percentage, plugged)
PowerStatusWidget->>PowerStatusWidget: compute percentageStr
PowerStatusWidget->>PowerStatusWidget: build iconStr
PowerStatusWidget->>IconWidget: setIcon(iconPath)
PowerStatusWidget->>DockApplet: refreshBatteryIcon(iconStr)
Class diagram for PowerStatusWidget icon update changesclassDiagram
class PowerStatusWidget {
- IconWidget m_iconWidget
- DockApplet m_applet
+ refreshIcon(int percentage, bool plugged) void
}
class IconWidget {
+ setIcon(string iconPath) void
}
class DockApplet {
+ refreshBatteryIcon(string iconStr) void
}
PowerStatusWidget --> IconWidget : uses
PowerStatusWidget --> DockApplet : uses
Flow diagram for selecting and applying battery iconsflowchart TD
A_Start["Start refreshIcon"] --> B_GetStatus["Get current battery percentage and plugged state"]
B_GetStatus --> C_PercentageStr["Compute percentageStr from percentage"]
C_PercentageStr --> D_BuildIconStr["Build iconStr based on percentageStr and plugged state"]
D_BuildIconStr --> E_BuildIconPath["Build iconPath = :/batteryicons/batteryicons/ + iconStr + .svg"]
E_BuildIconPath --> F_SetIcon["IconWidget setIcon(iconPath)"]
F_SetIcon --> G_NotifyApplet["DockApplet refreshBatteryIcon(iconStr)"]
G_NotifyApplet --> H_End["End refreshIcon"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来对这个diff进行代码审查:
总结: |
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:
- Now that setIcon() only takes a path, consider renaming the parameter or adding a brief comment at the call site to clarify that iconStr is still used as a logical icon identifier only by refreshBatteryIcon(), while the widget receives a full resource path.
- You’ve updated the 40%–100% battery icons to the new color scheme; if intentional, it might still be worth double‑checking whether the 0%–30% icons should also follow the same black/white style for visual consistency across all levels.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that setIcon() only takes a path, consider renaming the parameter or adding a brief comment at the call site to clarify that iconStr is still used as a logical icon identifier only by refreshBatteryIcon(), while the widget receives a full resource path.
- You’ve updated the 40%–100% battery icons to the new color scheme; if intentional, it might still be worth double‑checking whether the 0%–30% icons should also follow the same black/white style for visual consistency across all levels.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Changed battery icon fill colors from green (#3ACB00) to black/white for better visual consistency
Modified PowerStatusWidget::refreshIcon() to pass only the icon path instead of icon name and path
Updated all battery level icons (40%-100%) for both light and dark themes
Removed redundant icon name parameter from setIcon() call to simplify API usage
Log: Updated battery icon colors for better visual consistency
Influence:
fix: 更新电池图标颜色和API调用
将电池图标填充颜色从绿色(#3ACB00)改为黑色/白色,以获得更好的视觉一致性
修改PowerStatusWidget::refreshIcon()方法,仅传递图标路径而非图标名称和 路径
更新所有电池电量级别图标(40%-100%),适用于浅色和深色主题
从setIcon()调用中移除冗余的图标名称参数,简化API使用
Log: 更新电池图标颜色以获得更好的视觉一致性
Influence:
PMS: BUG-342033
Summary by Sourcery
Align battery status dock icons with updated artwork and simplify the icon setting API usage.
Bug Fixes:
Enhancements: