Updating branch refs/heads/master
to bbe956fe557730fcb2f1a2f0bc54838a55f70aab (commit)
from a6733f8e823cac1bce0142e6ac685028cb825e75 (commit)
commit bbe956fe557730fcb2f1a2f0bc54838a55f70aab
Author: Mike Massonnet <[email protected]>
Date: Sun Jan 8 14:55:13 2012 +0100
Reduce size of labels in panel
- Don't show the decimals
- Don't show per second suffix
panel-plugin/netload.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c
index a725539..b9633e1 100644
--- a/panel-plugin/netload.c
+++ b/panel-plugin/netload.c
@@ -146,6 +146,7 @@ typedef struct
static gboolean update_monitors(t_global_monitor *global)
{
char buffer[SUM+1][BUFSIZ];
+ char buffer_panel[SUM][BUFSIZ];
gchar caption[BUFSIZ];
gchar received[BUFSIZ];
gchar sent[BUFSIZ];
@@ -237,6 +238,7 @@ static gboolean update_monitors(t_global_monitor *global)
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(global->monitor->status[i]),
temp);
format_byte_humanreadable( buffer[i], BUFSIZ, display[i], 2 );
+ format_byte_humanreadable( buffer_panel[i], BUFSIZ, display[i], 0 );
}
format_byte_humanreadable( buffer[TOT], BUFSIZ,
(display[IN]+display[OUT]), 2 );
@@ -252,10 +254,10 @@ static gboolean update_monitors(t_global_monitor *global)
if (global->monitor->options.show_values)
{
- g_snprintf(received, sizeof(received), "%s/s", buffer[IN]);
+ g_snprintf(received, sizeof(received), "%s", buffer_panel[IN]);
gtk_label_set_text(GTK_LABEL(global->monitor->rcv_label),
received);
- g_snprintf(sent, sizeof(sent), _("%s/s"), buffer[OUT]);
+ g_snprintf(sent, sizeof(sent), _("%s"), buffer_panel[OUT]);
gtk_label_set_text(GTK_LABEL(global->monitor->sent_label), sent);
}
}
_______________________________________________
Xfce4-commits mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-commits