[gtk+/native-layout-incubator] Make testellipsize work for rotating non-ellipsized labels
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout-incubator] Make testellipsize work for rotating non-ellipsized labels
- Date: Mon, 26 Apr 2010 01:00:35 +0000 (UTC)
commit a0b61a5a72a12159d6d61e8f62c3374fd63b462d
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 25 20:58:36 2010 -0400
Make testellipsize work for rotating non-ellipsized labels
gtk/gtklabel.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 4552240..4590b26 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3450,17 +3450,17 @@ gtk_label_get_desired_size (GtkExtendedLayout *layout,
{
/* Note, we cant use get_size_for_allocation() when rotating ellipsize labels.
*/
- if (angle == 90 || angle == 270 || (label->ellipsize && label->have_transform))
+ if (!(label->ellipsize && label->have_transform) && (angle == 0 || angle == 180))
{
- /* A vertically rotated label does w4h, so return the base desired height (text length) */
- *minimum_size = required_rect.height;
- *natural_size = natural_rect.height;
+ /* Doing a w4h request on a label here, return the required height for the minimum width. */
+ get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL,
+ required_rect.width, minimum_size, natural_size);
}
else
{
- /* Doing a w4h request on a label here, return the required height for the minimum width. */
- get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL,
- required_rect.width, minimum_size, natural_size);
+ /* A vertically rotated label does w4h, so return the base desired height (text length) */
+ *minimum_size = required_rect.height;
+ *natural_size = natural_rect.height;
}
*minimum_size += label->misc.ypad * 2;
*natural_size += label->misc.ypad * 2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]