[gtk+/gtk-3-0] toolbar: Handle the fact that size_allocate() != get_allocation()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-0] toolbar: Handle the fact that size_allocate() != get_allocation()
- Date: Wed, 15 Jun 2011 18:16:42 +0000 (UTC)
commit 2c7846f63d7651f9595224e65cc92d182306c632
Author: Benjamin Otte <otte redhat com>
Date: Wed Jun 15 19:59:45 2011 +0200
toolbar: Handle the fact that size_allocate() != get_allocation()
size_allocate() allocates the available space for the margin box,
get_allocation() returns the actual space of the content box and those
can be different. And then animations never stop.
If that makes you go "huh?", you might want to read
http://www.w3.org/TR/CSS21/box.html
and the docs for gtk_widget_compute_align().
gtk/gtktoolbar.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 5fea923..050b13f 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -3510,8 +3510,20 @@ static void
toolbar_content_size_allocate (ToolbarContent *content,
GtkAllocation *allocation)
{
+ GtkAllocation goal;
+
gtk_widget_size_allocate (GTK_WIDGET (content->item),
allocation);
+
+ toolbar_content_get_goal_allocation (content, &goal);
+ if (goal.x == allocation->x &&
+ goal.y == allocation->y &&
+ goal.width == allocation->width &&
+ goal.height == allocation->height)
+ {
+ gtk_widget_get_allocation (GTK_WIDGET (content->item), &goal);
+ toolbar_content_set_goal_allocation (content, &goal);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]