[PATCH] Make the device name in a MountpointSelector less wide (#1048583).

Chris Lumens clumens at redhat.com
Mon Jan 20 15:48:22 UTC 2014


The name could be very long, obscuring the size of the device and making the
accordion hard to use.
---
 widgets/src/MountpointSelector.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/widgets/src/MountpointSelector.c b/widgets/src/MountpointSelector.c
index ea7ce17..6286268 100644
--- a/widgets/src/MountpointSelector.c
+++ b/widgets/src/MountpointSelector.c
@@ -21,6 +21,7 @@
 #include <gdk/gdk.h>
 #include <glib.h>
 #include <glib/gstdio.h>
+#include <pango/pango.h>
 #include <gettext.h>
 
 #include "MountpointSelector.h"
@@ -208,6 +209,8 @@ static void anaconda_mountpoint_selector_init(AnacondaMountpointSelector *mountp
     mountpoint->priv->name_label = gtk_label_new(NULL);
     format_name_label(mountpoint, _(DEFAULT_NAME));
     gtk_misc_set_alignment(GTK_MISC(mountpoint->priv->name_label), 0, 0);
+    gtk_label_set_ellipsize(GTK_LABEL(mountpoint->priv->name_label), PANGO_ELLIPSIZE_MIDDLE);
+    gtk_label_set_max_width_chars(GTK_LABEL(mountpoint->priv->name_label), 25);
     gtk_widget_set_hexpand(GTK_WIDGET(mountpoint->priv->name_label), TRUE);
 
     /* Create the size label. */
-- 
1.8.3.1



More information about the anaconda-patches mailing list