File tree 1 file changed +10
-1
lines changed
cosmic-settings/src/pages/power/backend
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,10 @@ impl Battery {
308
308
309
309
let is_charging = matches ! ( battery_state, BatteryState :: Charging ) ;
310
310
311
+ let charged = matches ! ( battery_state, BatteryState :: FullyCharged )
312
+ || matches ! ( battery_state, BatteryState :: Charging )
313
+ && ( percent - 100.0_f64 ) . abs ( ) < f64:: EPSILON ;
314
+
311
315
if !is_charging {
312
316
if let Ok ( time) = proxy. time_to_empty ( ) . await {
313
317
if let Ok ( dur) = Duration :: from_std ( std:: time:: Duration :: from_secs ( time as u64 ) ) {
@@ -339,7 +343,12 @@ impl Battery {
339
343
} else {
340
344
0
341
345
} ;
342
- let charging = if is_charging { "charging-" } else { "" } ;
346
+ // Due to not having a specific icon for charged we use the charging one
347
+ let charging = if is_charging || charged {
348
+ "charging-"
349
+ } else {
350
+ ""
351
+ } ;
343
352
344
353
let icon_name =
345
354
format ! ( "cosmic-applet-battery-level-{battery_percent}-{charging}symbolic" , ) ;
You can’t perform that action at this time.
0 commit comments