[gtk+/gtk-3-2] GtkNotebook: emit child-notify::position on drag 'n drop reorder



commit afa9f1308825314328f178c1cb928bd7feeb7c75
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Tue Feb 14 17:26:03 2012 +0200

    GtkNotebook: emit child-notify::position on drag 'n drop reorder
    
    https://bugzilla.gnome.org/show_bug.cgi?id=669116

 gtk/gtknotebook.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index ecdf3f1..d04ae397 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -3146,7 +3146,7 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
     {
       if (priv->during_reorder)
         {
-          gint old_page_num, page_num;
+          gint old_page_num, page_num, i;
           GList *element;
 
           element = get_drop_position (notebook);
@@ -3155,9 +3155,16 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
           gtk_notebook_child_reordered (notebook, page);
 
           if (priv->has_scrolled || old_page_num != page_num)
-            g_signal_emit (notebook,
-                           notebook_signals[PAGE_REORDERED], 0,
-                           page->child, page_num);
+	    {
+	      for (element = priv->children, i = 0; element; element = element->next)
+		{
+		  if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num))
+		    gtk_widget_child_notify (((GtkNotebookPage *) element->data)->child, "position");
+		}
+	      g_signal_emit (notebook,
+			     notebook_signals[PAGE_REORDERED], 0,
+			     page->child, page_num);
+	    }
 
           priv->has_scrolled = FALSE;
           priv->during_reorder = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]