[gtk+/wip/baedert/gtkimageview: 265/279] stack: Don't underallocate the last_child
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/gtkimageview: 265/279] stack: Don't underallocate the last_child
- Date: Fri, 1 Apr 2016 09:36:37 +0000 (UTC)
commit b4062125342967e9c830b693219e7bb3873d4590
Author: Timm Bäder <mail baedert org>
Date: Fri Feb 26 21:58:36 2016 +0100
stack: Don't underallocate the last_child
gtk/gtkstack.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 83c9da4..b691b65 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2254,19 +2254,24 @@ gtk_stack_allocate (GtkCssGadget *gadget,
child_allocation.x = 0;
child_allocation.y = 0;
- child_allocation.width = allocation->width;
- child_allocation.height = allocation->height;
+
if (priv->last_visible_child)
{
int min, nat;
-
+ gtk_widget_get_preferred_width (priv->last_visible_child->widget, &min, &nat);
+ child_allocation.width = MAX (min, allocation->width);
gtk_widget_get_preferred_height_for_width (priv->last_visible_child->widget,
- allocation->width,
+ child_allocation.width,
&min, &nat);
+ child_allocation.height = MAX (min, allocation->height);
+
gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
}
+ child_allocation.width = allocation->width;
+ child_allocation.height = allocation->height;
+
if (priv->visible_child)
{
int min, nat;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]