[Xfce4-commits] <xfce4-netload-plugin:master> Drop useless container packing

Mike Massonnet noreply at xfce.org
Fri Jun 1 17:10:01 CEST 2012


Updating branch refs/heads/master
         to 32dd79fd875490a2e2194eaa3eb5bf7c2f63c47f (commit)
       from e098eaa220e76ad5ee68fb82591abc78b5614baf (commit)

commit 32dd79fd875490a2e2194eaa3eb5bf7c2f63c47f
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Fri Jun 1 13:57:50 2012 +0200

    Drop useless container packing
    
    global->monitor->box is the only widget packed inside global->box, since
    this is useless monitor->box has been dropped and everything is directly
    packed inside global->box.
    
    Part of bug #8937.

 panel-plugin/netload.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c
index f712a95..343aeff 100644
--- a/panel-plugin/netload.c
+++ b/panel-plugin/netload.c
@@ -82,7 +82,6 @@ typedef struct
 
 typedef struct
 {
-    GtkWidget  *box;
     GtkWidget  *label;
     GtkWidget  *rcv_label;
     GtkWidget  *sent_label;
@@ -295,7 +294,6 @@ static void monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation ori
     }
 
     xfce_hvbox_set_orientation(XFCE_HVBOX(global->box), orientation);
-    xfce_hvbox_set_orientation(XFCE_HVBOX(global->monitor->box), orientation);
     if (orientation == GTK_ORIENTATION_HORIZONTAL)
     {
         gtk_misc_set_alignment(GTK_MISC(global->monitor->rcv_label), 1.0f, 0.5f);
@@ -396,14 +394,12 @@ static t_global_monitor * monitor_new(XfcePanelPlugin *plugin)
 
     /* Create widget containers */
     global->box = xfce_hvbox_new(GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
+    gtk_container_set_border_width(GTK_CONTAINER(global->box), 2);
     gtk_widget_show(GTK_WIDGET(global->box));
-    global->monitor->box = xfce_hvbox_new(GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
-    gtk_container_set_border_width(GTK_CONTAINER(global->monitor->box), BORDER / 2);
-    gtk_widget_show(GTK_WIDGET(global->monitor->box));
 
     /* Create the title label */
     global->monitor->label = gtk_label_new(global->monitor->options.label_text);
-    gtk_box_pack_start(GTK_BOX(global->monitor->box),
+    gtk_box_pack_start(GTK_BOX(global->box),
                        GTK_WIDGET(global->monitor->label),
                        TRUE, FALSE, BORDER / 2);
 
@@ -412,7 +408,7 @@ static t_global_monitor * monitor_new(XfcePanelPlugin *plugin)
     gtk_label_set_width_chars(GTK_LABEL(global->monitor->rcv_label), 7);
     global->monitor->sent_label = gtk_label_new("-");
     gtk_label_set_width_chars(GTK_LABEL(global->monitor->sent_label), 7);
-    gtk_box_pack_start(GTK_BOX(global->monitor->box),
+    gtk_box_pack_start(GTK_BOX(global->box),
                        GTK_WIDGET(global->monitor->rcv_label),
                        TRUE, FALSE, BORDER / 2);
     gtk_misc_set_alignment(GTK_MISC(global->monitor->rcv_label), 1.0f, 0.5f);
@@ -433,16 +429,12 @@ static t_global_monitor * monitor_new(XfcePanelPlugin *plugin)
                                &global->monitor->options.color[i]);
         gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(global->monitor->status[i]),
                                          GTK_PROGRESS_BOTTOM_TO_TOP);
-        gtk_box_pack_start(GTK_BOX(global->monitor->box),
+        gtk_box_pack_start(GTK_BOX(global->box),
                            GTK_WIDGET(global->monitor->status[i]), FALSE, FALSE, 0);
     }
 
-    /* Add the progress bar container */
-    gtk_box_pack_start(GTK_BOX(global->box),
-                       GTK_WIDGET(global->monitor->box), FALSE, FALSE, 0);
-
     /* Append sent label after the progress bars */
-    gtk_box_pack_start(GTK_BOX(global->monitor->box),
+    gtk_box_pack_start(GTK_BOX(global->box),
                        GTK_WIDGET(global->monitor->sent_label),
                        TRUE, FALSE, BORDER / 2);
 


More information about the Xfce4-commits mailing list