From 4da9ab257e86879bbb57c0cc794f59ff8e3a575a Mon Sep 17 00:00:00 2001 From: arQon Date: Thu, 5 Oct 2023 15:29:35 -0700 Subject: [PATCH] netspeed: fix broken rate display on vertical panels -- netspeed: fix bad padding before icon no idea why it's there in the first place, but it appears to be outright wrong rather than merely redundant, as evidenced by e.g. toggling the 'show icon' option twice giving different results to the original positioning. --- netspeed/src/netspeed.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/netspeed/src/netspeed.c b/netspeed/src/netspeed.c index 73185abd..d9b7f183 100644 --- a/netspeed/src/netspeed.c +++ b/netspeed/src/netspeed.c @@ -466,19 +466,19 @@ format_transfer_rate (gchar *out, if (bytes < IEC_KIBI_DBL) { format = "%.0f %s"; - unit = bits ? /* translators: bits (short) */ N_("bit/s"): /* translators: Bytes (short) */ N_("B/s"); + unit = bits ? /* translators: bits (short) */ N_("b"): /* translators: Bytes (short) */ N_("B"); } else if (bytes < IEC_MEBI_DBL) { format = (bytes < (100.0 * IEC_KIBI_DBL)) ? "%.1f %s" : "%.0f %s"; bytes /= IEC_KIBI_DBL; - unit = bits ? /* translators: kibibits (short) */ N_("Kibit/s") : /* translators: Kibibytes (short) */ N_("KiB/s"); + unit = bits ? /* translators: kibibits (short) */ N_("k") : /* translators: Kibibytes (short) */ N_("K"); } else if (bytes < IEC_GIBI_DBL) { format = "%.1f %s"; bytes /= IEC_MEBI_DBL; - unit = bits ? /* translators: Mebibit (short) */ N_("Mibit/s") : /* translators: Mebibyte (short) */ N_("MiB/s"); + unit = bits ? /* translators: Mebibit (short) */ N_("m") : /* translators: Mebibyte (short) */ N_("M"); } else { format = "%.1f %s"; bytes /= IEC_GIBI_DBL; - unit = bits ? /* translators: Gibibit (short) */ N_("Gibit/s") : /* translators: Gibibyte (short) */ N_("GiB/s"); + unit = bits ? /* translators: Gibibit (short) */ N_("g") : /* translators: Gibibyte (short) */ N_("G"); } g_snprintf (out, MAX_FORMAT_SIZE, format, bytes, gettext (unit)); @@ -1565,7 +1565,7 @@ netspeed_applet_factory (MatePanelApplet *applet, { NetspeedApplet *netspeed; int i; - GtkWidget *spacer, *spacer_box; + GtkWidget *spacer_box; GtkActionGroup *action_group; AtkObject *atk_obj; char *tmp; @@ -1662,10 +1662,6 @@ netspeed_applet_factory (MatePanelApplet *applet, netspeed->qual_pix = gtk_image_new (); netspeed->pix_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - spacer = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (netspeed->pix_box), spacer, TRUE, TRUE, 0); - spacer = gtk_label_new (""); - gtk_box_pack_end (GTK_BOX (netspeed->pix_box), spacer, TRUE, TRUE, 0); spacer_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_box_pack_start (GTK_BOX (netspeed->pix_box), spacer_box, FALSE, FALSE, 0); -- 2.34.1