[nautilus] query-editor: set a maximum width for the current location button



commit 51958f2a71fd801ead38e9cb06f92f0c2a6b3269
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Nov 12 16:50:36 2012 -0500

    query-editor: set a maximum width for the current location button
    
    Like we do in the pathbar, otherwise it could potentially grow
    unboundedly large.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688186

 src/nautilus-query-editor.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index b9fecd3..05106f2 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -1154,6 +1154,7 @@ static void
 update_location (NautilusQueryEditor *editor)
 {
 	NautilusFile *file;
+	GtkWidget *label;
 
 	file = nautilus_file_get_by_uri (editor->details->current_uri);
 
@@ -1164,10 +1165,14 @@ update_location (NautilusQueryEditor *editor)
 		} else {
 			name = nautilus_file_get_display_name (file);
 		}
-		gtk_button_set_label (GTK_BUTTON (editor->details->search_current_button),
-				      name);
+
+		gtk_button_set_label (GTK_BUTTON (editor->details->search_current_button), name);
 		g_free (name);
 
+		label = gtk_bin_get_child (GTK_BIN (editor->details->search_current_button));
+		gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE);
+		g_object_set (label, "max-width-chars", 30, NULL);
+
 		nautilus_file_unref (file);
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]