[Xfce4-commits] [xfce/xfce4-power-manager] 01/01: panel-plugin: Hide label in unknown state (Bug #12851)

noreply at xfce.org noreply at xfce.org
Fri Oct 27 20:06:07 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-power-manager.

commit 4d6f53105b2048fbe5bef3f9ea159c5304d9665a
Author: Christian Hesse <mail at eworm.de>
Date:   Thu Sep 15 16:44:14 2016 +0200

    panel-plugin: Hide label in unknown state (Bug #12851)
    
    DEVICE_STATE_UKNOWN means that there is no battery available.
    
    Signed-off-by: Christian Hesse <mail at eworm.de>
---
 panel-plugins/power-manager-plugin/power-manager-button.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/panel-plugins/power-manager-plugin/power-manager-button.c b/panel-plugins/power-manager-plugin/power-manager-button.c
index e9d04f8..db0699e 100644
--- a/panel-plugins/power-manager-plugin/power-manager-button.c
+++ b/panel-plugins/power-manager-plugin/power-manager-button.c
@@ -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);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list