[gnome-control-center] power: Don't shrink the panel on desktops



commit 4a7190004a7fa02aa8d1461141a136ab2062686f
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Aug 27 13:06:19 2011 +0100

    power: Don't shrink the panel on desktops
    
    During a split second we see some garbage on the screen on
    desktop systems that don't have UPSes. Better to grow than to
    shrink (though we shouldn't do either), so start with the battery
    information hidden.

 panels/power/cc-power-panel.c |   10 +++++++---
 panels/power/power.ui         |    2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index f1ee7e0..6ff3e4c 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -205,19 +205,23 @@ get_primary_device_cb (GObject *source_object, GAsyncResult *res, gpointer user_
   UpDeviceKind kind;
   UpDeviceState state;
   GIcon *icon;
+  GtkWidget *status_box;
   CcPowerPanelPrivate *priv = CC_POWER_PANEL (user_data)->priv;
 
+  status_box = GTK_WIDGET (gtk_builder_get_object (priv->builder,
+                                                   "hbox_status"));
+
   result = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error);
   if (result == NULL)
     {
       g_printerr ("Error getting primary device: %s\n", error->message);
       g_error_free (error);
-      widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
-                                                   "hbox_status"));
-      gtk_widget_hide (widget);
+      gtk_widget_hide (status_box);
       return;
     }
 
+  gtk_widget_show (status_box);
+
   /* set the icon and text */
   g_variant_get (result,
                  "((susdut))",
diff --git a/panels/power/power.ui b/panels/power/power.ui
index 1370e9f..6b505ba 100644
--- a/panels/power/power.ui
+++ b/panels/power/power.ui
@@ -342,7 +342,7 @@
         </child>
         <child>
           <object class="GtkHBox" id="hbox_status">
-            <property name="visible">True</property>
+            <property name="visible">False</property>
             <child>
               <object class="GtkHBox" id="hbox2">
                 <property name="visible">True</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]