[gtk+] GtkNotebook: emit child-notify::position on drag 'n drop reorder
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkNotebook: emit child-notify::position on drag 'n drop reorder
- Date: Tue, 14 Feb 2012 23:05:55 +0000 (UTC)
commit 347328adb09ff21f36ccf7608b253ba841742f9e
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 bd5a3c1..8f92211 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -3185,7 +3185,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);
@@ -3194,9 +3194,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]