From a426ae0d9201178bf1c1a346082fe0334d69a0a3 Mon Sep 17 00:00:00 2001 From: Harald Judt Date: Tue, 22 May 2012 13:25:14 +0200 Subject: Make label spacing consistent with other plugins. Other monitor plugins leave a small empty border to the left of the labels. Since it is not trivial to do this for systemload plugin because of the components and variety of possibilities to toggle the components on or off, simply add a box used solely for spacing and toggle this on or off together with the corresponding label. --- panel-plugin/systemload.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c index a35f1a8..ce3ae8a 100644 --- a/panel-plugin/systemload.c +++ b/panel-plugin/systemload.c @@ -78,6 +78,7 @@ typedef struct typedef struct { GtkWidget *box; + GtkWidget *spacing_box; GtkWidget *label; GtkWidget *status; GtkWidget *ebox; @@ -274,6 +275,12 @@ monitor_update_orientation (XfcePanelPlugin *plugin, gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(global->monitor[count]->status), GTK_PROGRESS_LEFT_TO_RIGHT); } + global->monitor[count]->spacing_box = xfce_hvbox_new (orientation, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(global->monitor[count]->spacing_box), BORDER/2); + gtk_box_pack_start(GTK_BOX(global->monitor[count]->box), + GTK_WIDGET(global->monitor[count]->spacing_box), + FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(global->monitor[count]->box), GTK_WIDGET(global->monitor[count]->label), FALSE, FALSE, 0); @@ -481,7 +488,14 @@ setup_monitor(t_global_monitor *global) { gtk_widget_show(GTK_WIDGET(global->monitor[count]->ebox)); if (global->monitor[count]->options.use_label) + { + gtk_widget_show(global->monitor[count]->spacing_box); gtk_widget_show(global->monitor[count]->label); + } + else + { + gtk_widget_hide(global->monitor[count]->spacing_box); + } gtk_widget_show(GTK_WIDGET(global->monitor[count]->status)); } -- 1.7.8.6