Skip to content
Snippets Groups Projects
Commit 4d6f5310 authored by Christian Hesse's avatar Christian Hesse Committed by Simon Steinbeiss
Browse files

panel-plugin: Hide label in unknown state (Bug #12851)


DEVICE_STATE_UKNOWN means that there is no battery available.

Signed-off-by: default avatarChristian Hesse <mail@eworm.de>
parent 68968b52
No related branches found
No related tags found
No related merge requests found
......@@ -1231,10 +1231,12 @@ power_manager_button_update_label (PowerManagerButton *button, UpDevice *device)
"time-to-full", &time_to_full,
NULL);
/* Hide the label if the battery is fully charged */
/* Hide the label if the battery is fully charged
* or state unknown (no battery available) */
if (state == UP_DEVICE_STATE_CHARGING)
power_manager_button_set_label (button, percentage, time_to_full);
else if (state == UP_DEVICE_STATE_FULLY_CHARGED)
else if (state == UP_DEVICE_STATE_FULLY_CHARGED
|| state == UP_DEVICE_STATE_UNKNOWN)
gtk_widget_hide (GTK_WIDGET (button->priv->panel_label));
else
power_manager_button_set_label (button, percentage, time_to_empty);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment