[Xfce4-commits] [xfce/xfce4-power-manager] 01/01: panel-plugin: Hide label by default on desktop systems

noreply at xfce.org noreply at xfce.org
Thu Nov 23 21:58:59 CET 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 887102604f6596cfce07631d3de701f798205b16
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Thu Nov 23 00:33:38 2017 +0100

    panel-plugin: Hide label by default on desktop systems
    
    The label will only be hidden if the display device, i.e. the one
    showing up in the panel is the desktop itself.
---
 panel-plugins/power-manager-plugin/power-manager-button.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/panel-plugins/power-manager-plugin/power-manager-button.c b/panel-plugins/power-manager-plugin/power-manager-button.c
index d9ced22..d6e2e69 100644
--- a/panel-plugins/power-manager-plugin/power-manager-button.c
+++ b/panel-plugins/power-manager-plugin/power-manager-button.c
@@ -1213,12 +1213,14 @@ 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
-     * or state unknown (no battery available) */
+    /* Hide the label if the battery is fully charged,
+     * if the state is unknown (no battery available)
+       or if it's a desktop system */
     if (state == UP_DEVICE_STATE_CHARGING)
         power_manager_button_set_label (button, percentage, time_to_full);
     else if (state == UP_DEVICE_STATE_FULLY_CHARGED
-		    || state == UP_DEVICE_STATE_UNKNOWN)
+             || state == UP_DEVICE_STATE_UNKNOWN
+             || g_strcmp0 (button->priv->panel_icon_name, "ac-adapter-symbolic") == 0)
         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