diff options
author | Jan-Michael Brummer <jan.brummer@tabos.org> | 2020-09-27 16:02:33 +0200 |
---|---|---|
committer | Jan-Michael Brummer <jan.brummer@tabos.org> | 2020-09-28 17:22:54 +0000 |
commit | cc9535c7cb59eaaf1003e4cdd254fc082ccdb752 (patch) | |
tree | 5e8c4d7d701f88e23b7eeac08c3c048214fde825 /src/ephy-notebook.c | |
parent | a44738a048cac53ccdfc32fcc93c94129e97ea44 (diff) | |
download | epiphany-cc9535c7cb59eaaf1003e4cdd254fc082ccdb752.tar.gz |
Add Alt+0 hotkey to toggle between last tabs
Fixes: https://gitlab.gnome.org/GNOME/epiphany/-/issues/1050
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r-- | src/ephy-notebook.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index fb0e6aeaa..3526e4205 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -1162,3 +1162,24 @@ ephy_notebook_tab_is_pinned (EphyNotebook *notebook, return ephy_tab_label_is_pinned (tab_label); } + +void +ephy_notebook_switch_to_last_tab (EphyNotebook *notebook) +{ + GList *l; + GtkWidget *child; + int page_num; + + if (!notebook->focused_pages) + return; + + l = g_list_last (notebook->focused_pages); + if (!l->prev) + return; + + child = GTK_WIDGET (l->prev->data); + page_num = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), + child); + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), + page_num); +} |