summaryrefslogtreecommitdiff
path: root/gtk/gtklabel.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-04-19 20:43:19 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-04-19 20:43:19 -0400
commitde4a8f8ddcc292f1cfa1a1e4cf96e993eaf71181 (patch)
tree9cbae45200cee4ec0fb140857ba84b9e7a7785d9 /gtk/gtklabel.c
parentee8db39393fe0246461d06d88515446b057dcc54 (diff)
downloadgtk+-de4a8f8ddcc292f1cfa1a1e4cf96e993eaf71181.tar.gz
Unconditionally return the height for the minimum width when doing get_desired_height()
This is the correct support for the opposing orientation for widgets that support height-for-width, in an interface that was realized as width-for-height, a height-for-width supporting widget should return the minimum height for the minimum width when the initial get_desired_height() is run.
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r--gtk/gtklabel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 592821b3bf..0e292207b3 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3417,15 +3417,15 @@ gtk_label_get_desired_size (GtkExtendedLayout *layout,
}
else
{
- /* When wrapping, just return a height contextual to the minimum width
- * (minimum widths can only be specified by explicitly setting width-chars).
- */
- if (label->wrap && !label->have_transform)
- get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL,
- (required_rect.width + label->misc.xpad * 2), minimum_size, natural_size);
+ if (!label->have_transform)
+ {
+ /* 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 + label->misc.xpad * 2), minimum_size, natural_size);
+ }
else
{
- /* If there is no wrapping, the height is either static or rotated and ellipsized */
+ /* Rotated labels already setup the required height here */
*minimum_size = required_rect.height + label->misc.ypad * 2;
*natural_size = natural_rect.height + label->misc.ypad * 2;
}