[Xfce4-commits] <xfce4-systemload-plugin:master> Set progressbar size again in set-orientation, like it's done in set-size

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


Updating branch refs/heads/master
         to 71045d561e33a1484502ec3e552cc6ed22a34566 (commit)
       from ff4955b876f7a948aca2b1c07a5c47ad40ab2d56 (commit)

commit 71045d561e33a1484502ec3e552cc6ed22a34566
Author: Landry Breuil <landry at xfce.org>
Date:   Wed Apr 18 18:15:36 2012 +0200

    Set progressbar size again in set-orientation, like it's done in set-size
    
    That way, avoids ugly super-wide progressbars when switching to vertical mode

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

diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c
index af80575..6c12938 100644
--- a/panel-plugin/systemload.c
+++ b/panel-plugin/systemload.c
@@ -227,7 +227,8 @@ static void
 monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation orientation,
                          t_global_monitor *global)
 {
-    gint count;
+    gint count, size;
+    size = xfce_panel_plugin_get_size(plugin);
 
     gtk_widget_hide(GTK_WIDGET(global->ebox));
 
@@ -256,11 +257,13 @@ monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation orientation,
         {
             global->monitor[count]->box = GTK_WIDGET(gtk_hbox_new(FALSE, 0));
             gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(global->monitor[count]->status), GTK_PROGRESS_BOTTOM_TO_TOP);
+            gtk_widget_set_size_request(GTK_WIDGET(global->monitor[count]->status), BORDER, size - BORDER);
         }
         else
         {
             global->monitor[count]->box = GTK_WIDGET(gtk_vbox_new(FALSE, 0));
             gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(global->monitor[count]->status), GTK_PROGRESS_LEFT_TO_RIGHT);
+            gtk_widget_set_size_request(GTK_WIDGET(global->monitor[count]->status), size - BORDER, BORDER);
         }
 
         gtk_box_pack_start(GTK_BOX(global->monitor[count]->box),


More information about the Xfce4-commits mailing list