From fa7c1813bfdbece14a52f0fc0675eceb388e4000 Mon Sep 17 00:00:00 2001 From: Harald Judt Date: Fri, 18 May 2012 18:56:33 +0200 Subject: Fix progress bar size after panel orientation change. When the panel orientation changes (e.g. from horizontal to vertical), the progress bars have a wrong size, and the plugin looks pretty much messed up. To avoid this, issue a size request after the panel orientation changes. --- panel-plugin/netload.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c index 998447f..bb2c46e 100644 --- a/panel-plugin/netload.c +++ b/panel-plugin/netload.c @@ -35,6 +35,7 @@ #define BORDER 8 +#define PROGRESS_BAR_SIZE 8 /* Defaults */ #define DEFAULT_TEXT "Net" @@ -333,6 +334,7 @@ static void monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation ori { gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(global->monitor->status[i]), GTK_PROGRESS_BOTTOM_TO_TOP); + gtk_widget_set_size_request(global->monitor->status[i], PROGRESS_BAR_SIZE, -1); } gtk_misc_set_alignment(GTK_MISC(global->monitor->sent_label), 0.0f, 0.5f); } @@ -343,6 +345,7 @@ static void monitor_set_orientation (XfcePanelPlugin *plugin, GtkOrientation ori { gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(global->monitor->status[i]), GTK_PROGRESS_LEFT_TO_RIGHT); + gtk_widget_set_size_request(global->monitor->status[i], -1, PROGRESS_BAR_SIZE); } gtk_misc_set_alignment(GTK_MISC(global->monitor->sent_label), 1.0f, 0.5f); } -- 1.7.8.6