svnno****@sourc*****
svnno****@sourc*****
Thu Oct 4 12:22:38 JST 2007
Revision: 3263 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3263 Author: ikezoe Date: 2007-10-04 12:22:37 +0900 (Thu, 04 Oct 2007) Log Message: ----------- 2007-10-04 Hiroyuki Ikezoe <poinc****@ikezo*****> * src/kz-notebook.c: Set detachable and reorderable when page-added signal is caught. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/kz-notebook.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2007-10-04 03:15:26 UTC (rev 3262) +++ kazehakase/trunk/ChangeLog 2007-10-04 03:22:37 UTC (rev 3263) @@ -1,3 +1,8 @@ +2007-10-04 Hiroyuki Ikezoe <poinc****@ikezo*****> + + * src/kz-notebook.c: Set detachable and reorderable when page-added + signal is caught. + 2007-10-04 Kouhei Sutou <kou****@cozmi*****> * ext/ruby/kz-rb-window.c: removed rb_kz_window_reorder_tab(). Modified: kazehakase/trunk/src/kz-notebook.c =================================================================== --- kazehakase/trunk/src/kz-notebook.c 2007-10-04 03:15:26 UTC (rev 3262) +++ kazehakase/trunk/src/kz-notebook.c 2007-10-04 03:22:37 UTC (rev 3263) @@ -91,6 +91,10 @@ guint info, guint time); +static void cb_page_added(GtkNotebook *notebook, + GtkWidget *child, + guint page_num, + gpointer data); static void switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num); @@ -150,6 +154,8 @@ g_signal_connect(notebook, "page-reordered", G_CALLBACK(cb_page_reordered), NULL); + g_signal_connect(notebook, "page-added", + G_CALLBACK(cb_page_added), NULL); gtk_drag_dest_set(GTK_WIDGET(notebook), GTK_DEST_DEFAULT_ALL, @@ -388,6 +394,13 @@ } static void +cb_page_added (GtkNotebook *notebook, GtkWidget *child, guint page_num, gpointer data) +{ + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(notebook), child, TRUE); + gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(notebook), child, TRUE); +} + +static void cb_page_reordered (GtkNotebook *notebook, GtkWidget *child, guint page_num, @@ -479,8 +492,6 @@ GTK_WIDGET(embed), GTK_WIDGET(label), pos); - gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(notebook), GTK_WIDGET(embed), TRUE); - gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(notebook), GTK_WIDGET(embed), TRUE); /* add to this notebook's history */ priv->open_hist = g_list_prepend(priv->open_hist, embed); @@ -632,8 +643,6 @@ gtk_notebook_prepend_page(GTK_NOTEBOOK(dest_notebook), widget, GTK_WIDGET(new_kztab)); - gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(dest_notebook), widget, TRUE); - gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(dest_notebook), widget, TRUE); g_object_unref(widget); src_priv = KZ_NOTEBOOK_GET_PRIVATE(src_notebook);