File nautilus-bnc948796-pathbar-sizing.patch of Package nautilus.1950
From e1d4d7c61612a3d903417248a24ac870ede77af8 Mon Sep 17 00:00:00 2001
From: Daniel Wyatt <Daniel.Wyatt@gmail.com>
Date: Thu, 13 Feb 2014 10:30:25 -0500
Subject: [PATCH 1/2] Do not modify ellipsize property within a size request
function
Instead, we can use the natural size request which is equivalent to the non-ellipsized size.
See: https://developer.gnome.org/gtk3/stable/GtkLabel.html#label-text-layout
https://bugzilla.gnome.org/show_bug.cgi?id=697198
---
src/nautilus-pathbar.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index b16f7f4..cfaa25b 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -305,21 +305,18 @@ static void
set_label_size_request (ButtonData *button_data)
{
gint width, height;
- GtkRequisition min_req, bold_req;
+ GtkRequisition nat_req, bold_req;
if (button_data->label == NULL) {
return;
}
- gtk_label_set_ellipsize (GTK_LABEL (button_data->label), PANGO_ELLIPSIZE_NONE);
- gtk_widget_get_preferred_size (button_data->label, &min_req, NULL);
- gtk_label_set_ellipsize (GTK_LABEL (button_data->label), PANGO_ELLIPSIZE_MIDDLE);
-
+ gtk_widget_get_preferred_size (button_data->label, NULL, &nat_req);
gtk_widget_get_preferred_size (button_data->bold_label, &bold_req, NULL);
- width = MAX (min_req.width, bold_req.width);
+ width = MAX (nat_req.width, bold_req.width);
width = MIN (width, NAUTILUS_PATH_BAR_BUTTON_MAX_WIDTH);
- height = MAX (min_req.height, bold_req.height);
+ height = MAX (nat_req.height, bold_req.height);
gtk_widget_set_size_request (button_data->label, width, height);
}
--
2.1.4
From c59c83d19e71957e75e7e90496afce51a4db3b1e Mon Sep 17 00:00:00 2001
From: Yosef Or Boczko <yoseforb@gmail.com>
Date: Sun, 19 Jan 2014 14:26:56 +0200
Subject: [PATCH 2/2] path bar: Request enough natural width to fit all buttons
Otherwise, we are at the mercy of the container giving us
more space than we request, which does not always work.
https://bugzilla.gnome.org/show_bug.cgi?id=722542
---
src/nautilus-pathbar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index cfaa25b..7f2c0ed 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -358,7 +358,7 @@ nautilus_path_bar_get_preferred_width (GtkWidget *widget,
}
*minimum = MAX (*minimum, child_min);
- *natural = MAX (*natural, child_nat);
+ *natural = *natural + child_nat;
}
/* Add space for slider, if we have more than one path */
--
2.1.4