aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-commands.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-03-24 00:43:28 +0800
committerChristian Persch <chpe@src.gnome.org>2006-03-24 00:43:28 +0800
commit459706710945ea711d80311308916d77c3cb0cf3 (patch)
tree45963b81e1cba9dc51a6483dd156a166e90eded5 /src/window-commands.c
parent3d7aff9704dee40cf5bbdbf11687f382ffe05072 (diff)
downloadgsoc2013-epiphany-459706710945ea711d80311308916d77c3cb0cf3.tar
gsoc2013-epiphany-459706710945ea711d80311308916d77c3cb0cf3.tar.gz
gsoc2013-epiphany-459706710945ea711d80311308916d77c3cb0cf3.tar.bz2
gsoc2013-epiphany-459706710945ea711d80311308916d77c3cb0cf3.tar.lz
gsoc2013-epiphany-459706710945ea711d80311308916d77c3cb0cf3.tar.xz
gsoc2013-epiphany-459706710945ea711d80311308916d77c3cb0cf3.tar.zst
gsoc2013-epiphany-459706710945ea711d80311308916d77c3cb0cf3.zip
Port notebook DND to gtk+ 2.9.
2006-03-23 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * data/ui/epiphany-ui.xml: * src/ephy-lockdown.c: (update_window): * src/ephy-notebook.c: (ephy_notebook_class_init), (button_press_cb), (ephy_notebook_init), (tab_label_weak_notify_cb), (build_tab_label): * src/ephy-notebook.h: * src/ephy-session.c: (notebook_page_added_cb), (notebook_page_removed_cb), (notebook_page_reordered_cb), (impl_attach_window): * src/ephy-tabs-menu.c: (notebook_page_added_cb), (notebook_page_removed_cb), (notebook_page_reordered_cb), (ephy_tabs_menu_set_window): * src/ephy-window.c: (update_tabs_menu_sensitivity), (idle_tab_remove_cb), (notebook_page_added_cb), (notebook_page_removed_cb), (notebook_page_reordered_cb), (notebook_page_close_request_cb), (setup_notebook), (ephy_window_remove_tab), (notebook_switch_page_cb): * src/epiphany.defs: * src/window-commands.c: (window_cmd_tabs_move_left), (window_cmd_tabs_move_right): Port notebook DND to gtk+ 2.9.
Diffstat (limited to 'src/window-commands.c')
-rw-r--r--src/window-commands.c61
1 files changed, 16 insertions, 45 deletions
diff --git a/src/window-commands.c b/src/window-commands.c
index f0f6b04e8..fa36cfc9b 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -833,61 +833,32 @@ void
window_cmd_tabs_move_left (GtkAction *action,
EphyWindow *window)
{
- GtkWidget *notebook;
+ GtkWidget *child;
+ GtkNotebook *notebook;
int page;
- notebook = ephy_window_get_notebook (window);
- page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
-
- if (page > 0)
- {
- GtkWidget *child;
+ notebook = GTK_NOTEBOOK (ephy_window_get_notebook (window));
+ page = gtk_notebook_get_current_page (notebook);
+ if (page < 1) return;
- child = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page);
- ephy_notebook_move_tab (EPHY_NOTEBOOK (notebook), NULL,
- EPHY_TAB (child), page - 1);
- }
+ child = gtk_notebook_get_nth_page (notebook, page);
+ gtk_notebook_reorder_child (notebook, child, page - 1);
}
void window_cmd_tabs_move_right (GtkAction *action,
EphyWindow *window)
{
- GtkWidget *notebook;
- int page;
- int last_page;
-
- notebook = ephy_window_get_notebook (window);
- page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
- last_page = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) - 1;
-
- if (page != last_page)
- {
- GtkWidget *child;
-
- child = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page);
- ephy_notebook_move_tab (EPHY_NOTEBOOK (notebook), NULL,
- EPHY_TAB (child), page + 1);
- }
-}
-
-void
-window_cmd_tabs_detach (GtkAction *action,
- EphyWindow *window)
-{
- EphyTab *tab;
- GtkWidget *nb;
- EphyWindow *new_win;
+ GtkWidget *child;
+ GtkNotebook *notebook;
+ int page, n_pages;
- nb = ephy_window_get_notebook (window);
- if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)) <= 1) return;
-
- tab = ephy_window_get_active_tab (window);
+ notebook = GTK_NOTEBOOK (ephy_window_get_notebook (window));
+ page = gtk_notebook_get_current_page (notebook);
+ n_pages = gtk_notebook_get_n_pages (notebook) - 1;
+ if (page > n_pages - 1) return;
- new_win = ephy_window_new ();
- ephy_notebook_move_tab (EPHY_NOTEBOOK (ephy_window_get_notebook (window)),
- EPHY_NOTEBOOK (ephy_window_get_notebook (new_win)),
- tab, 0);
- gtk_widget_show (GTK_WIDGET (new_win));
+ child = gtk_notebook_get_nth_page (notebook, page);
+ gtk_notebook_reorder_child (notebook, child, page + 1);
}
void