[gtk+/nth-child: 21/33] box: Only emit pack-type notify if the pack type really changed
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/nth-child: 21/33] box: Only emit pack-type notify if the pack type really changed
- Date: Fri, 27 May 2011 23:05:26 +0000 (UTC)
commit 9d93ed2672de5c1beaa6edb7684702267ec6c36a
Author: Benjamin Otte <otte redhat com>
Date: Fri May 27 18:52:02 2011 +0200
box: Only emit pack-type notify if the pack type really changed
This is not very useful in itself, but the code reorg will be useful
once we do style invalidation.
gtk/gtkbox.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 9a20579..b1d1df9 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -1612,11 +1612,13 @@ gtk_box_set_child_packing (GtkBox *box,
gtk_widget_child_notify (child, "fill");
child_info->padding = padding;
gtk_widget_child_notify (child, "padding");
- if (pack_type == GTK_PACK_END)
- child_info->pack = GTK_PACK_END;
- else
- child_info->pack = GTK_PACK_START;
- gtk_widget_child_notify (child, "pack-type");
+ if (pack_type != GTK_PACK_END)
+ pack_type = GTK_PACK_START;
+ if (child_info->pack_type != pack_type)
+ {
+ child_info->pack = GTK_PACK_END;
+ gtk_widget_child_notify (child, "pack-type");
+ }
if (gtk_widget_get_visible (child)
&& gtk_widget_get_visible (GTK_WIDGET (box)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]