[Xfce4-commits] <xfce4-systemload-plugin:master> When setting orientation, only show what's enabled

Landry Breuil noreply at xfce.org
Wed Apr 18 18:38:03 CEST 2012


Updating branch refs/heads/master
         to ff4955b876f7a948aca2b1c07a5c47ad40ab2d56 (commit)
       from 0fb772164ed057c4777b8c4f00c58f1f947478ba (commit)

commit ff4955b876f7a948aca2b1c07a5c47ad40ab2d56
Author: Landry Breuil <landry at xfce.org>
Date:   Wed Apr 18 18:02:51 2012 +0200

    When setting orientation, only show what's enabled

 panel-plugin/systemload.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c
index 03b6e04..af80575 100644
--- a/panel-plugin/systemload.c
+++ b/panel-plugin/systemload.c
@@ -249,7 +249,6 @@ monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation orientation,
     {
         global->monitor[count]->label =
             gtk_label_new(global->monitor[count]->options.label_text);
-        gtk_widget_show(global->monitor[count]->label);
 
         global->monitor[count]->status = GTK_WIDGET(gtk_progress_bar_new());
 
@@ -268,8 +267,6 @@ monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation orientation,
                            GTK_WIDGET(global->monitor[count]->label),
                            FALSE, FALSE, 0);
 
-        gtk_widget_show(GTK_WIDGET(global->monitor[count]->box));
-
         global->monitor[count]->ebox = gtk_event_box_new();
         gtk_widget_show(global->monitor[count]->ebox);
         gtk_container_add(GTK_CONTAINER(global->monitor[count]->ebox),
@@ -294,10 +291,21 @@ monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation orientation,
         gtk_box_pack_start(GTK_BOX(global->box),
                            GTK_WIDGET(global->monitor[count]->ebox),
                            FALSE, FALSE, 0);
+
+        if(global->monitor[count]->options.enabled)
+        {
+            gtk_widget_show(GTK_WIDGET(global->monitor[count]->ebox));
+            gtk_widget_show(GTK_WIDGET(global->monitor[count]->box));
+            if (global->monitor[count]->options.use_label)
+                gtk_widget_show(global->monitor[count]->label);
+
+            gtk_widget_show(GTK_WIDGET(global->monitor[count]->status));
+        }
     }
 
     global->uptime->ebox = gtk_event_box_new();
-    gtk_widget_show(global->uptime->ebox);
+    if(global->uptime->enabled)
+        gtk_widget_show(global->uptime->ebox);
     gtk_event_box_set_visible_window(GTK_EVENT_BOX(global->uptime->ebox), FALSE);
 
     gtk_widget_set_has_tooltip(global->monitor[0]->ebox, TRUE);


More information about the Xfce4-commits mailing list