Also reorder menu when reordering tabs by drag & drop

2007-12-30  Johannes Schmid <jhs@gnome.org>

        * gtk/gtknotebook.c: (gtk_notebook_stop_reorder):
        Also reorder menu when reordering tabs by drag & drop

        * tests/testnotebookdnd.c: (create_notebook_with_notebooks):
        Add a menu to one of the notebooks to have a test-case for
        the change mentioned above.


svn path=/branches/gtk-2-12/; revision=19293
This commit is contained in:
Johannes Schmid
2007-12-31 15:26:47 +00:00
committed by Johannes Schmid
parent c098ad9322
commit 7a7b67d9af
5 changed files with 23 additions and 4 deletions

View File

@@ -1,3 +1,12 @@
2007-12-30 Johannes Schmid <jhs@gnome.org>
* gtk/gtknotebook.c: (gtk_notebook_stop_reorder):
Also reorder menu when reordering tabs by drag & drop
* tests/testnotebookdnd.c: (create_notebook_with_notebooks):
Add a menu to one of the notebooks to have a test-case for
the change mentioned above.
2007-12-31 Christian Persch <chpe@gnome.org>
* gtk/gtkprintunixdialog.c: (gtk_print_unix_dialog_get_property):

View File

@@ -1,3 +1,9 @@
2007-12-30 Johannes Schmid <jhs@gnome.org>
* gtk/tmpl/gtknotebook.sgml:
Fix method names (gtk_notebook_popup_enable vs.
gtk_notebook_enable_popup)
2007-12-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.12.3 ===

View File

@@ -16,7 +16,7 @@ things, you can choose on which edge the tabs appear
tabs to fit the noteobook should be made bigger or scrolling
arrows added (see gtk_notebook_set_scrollable), and whether there
will be a popup menu allowing the users to switch pages.
(see gtk_notebook_enable_popup(), gtk_noteobook_disable_popup())
(see gtk_notebook_popup_enable(), gtk_noteobook_popup_disable())
</para>
<refsect2 id="GtkNotebook-BUILDER-UI">

View File

@@ -352,6 +352,8 @@ static GList * gtk_notebook_search_page (GtkNotebook *notebook,
GList *list,
gint direction,
gboolean find_visible);
static void gtk_notebook_child_reordered (GtkNotebook *notebook,
GtkNotebookPage *page);
/*** GtkNotebook Drawing Functions ***/
static void gtk_notebook_paint (GtkWidget *widget,
@@ -2765,7 +2767,8 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
element = get_drop_position (notebook, page->pack);
old_page_num = g_list_position (notebook->children, notebook->focus_tab);
page_num = reorder_tab (notebook, element, notebook->focus_tab);
gtk_notebook_child_reordered (notebook, page);
if (priv->has_scrolled || old_page_num != page_num)
g_signal_emit (notebook,
notebook_signals[PAGE_REORDERED], 0,

View File

@@ -201,13 +201,14 @@ create_notebook_with_notebooks (gchar **labels,
while (*labels)
{
page = create_notebook (labels, group, packing, pos);
gtk_notebook_popup_enable (GTK_NOTEBOOK (page));
title = gtk_label_new (*labels);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, title);
gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (notebook), page, TRUE);
gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (notebook), page, TRUE);
if (packing == PACK_END ||
(packing == PACK_ALTERNATE && count % 2 == 1))
gtk_container_child_set (GTK_CONTAINER (notebook), page, "tab-pack", GTK_PACK_END, NULL);