Commit b7d8fbf
feat: improve battery icon loading strategy
1. Modified battery icon loading to first try system theme icons before
falling back to built-in resources
2. Added proper handling for dark theme variants by appending "-dark"
suffix
3. Improved SVG renderer fallback logic when theme icons are not
available
4. Fixed resource path inconsistency in PowerStatusWidget
5. Added proper error handling for invalid SVG files
The changes improve icon loading reliability and maintainability by:
- Supporting system theme icons which allows for better customization
- Providing proper fallback mechanisms when theme icons are missing
- Ensuring consistent behavior across light/dark themes
- Fixing resource path inconsistencies between components
feat: 改进电池图标加载策略
1. 修改电池图标加载逻辑,优先尝试系统主题图标,再回退到内置资源
2. 添加了对暗色主题变体的正确处理,通过添加"-dark"后缀
3. 改进了当主题图标不可用时的SVG渲染器回退逻辑
4. 修复了PowerStatusWidget中的资源路径不一致问题
5. 为无效SVG文件添加了适当的错误处理
这些改进通过以下方式提高了图标加载的可靠性和可维护性:
- 支持系统主题图标,允许更好的自定义
- 当主题图标缺失时提供适当的回退机制
- 确保在亮/暗主题下行为一致
- 修复组件间的资源路径不一致问题
Pms: BUG-3237671 parent 1e14dbd commit b7d8fbf
File tree
2 files changed
+22
-6
lines changed- plugins/dde-dock/power
2 files changed
+22
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
236 | 238 | | |
237 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
238 | 257 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | 258 | | |
243 | 259 | | |
244 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
0 commit comments