summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-11-30 09:38:45 -0600
committerJan-Michael Brummer <jan.brummer@tabos.org>2020-12-01 18:44:16 +0000
commit42c2385b62d9b75292574b05009d4f6925f613c4 (patch)
tree6653b06bd7bada4f92484d7e1f05296ac238d3f3 /src
parent58a4f8f20077f1833df5992705bb544ac673bf9c (diff)
downloadepiphany-42c2385b62d9b75292574b05009d4f6925f613c4.tar.gz
notebook: add newly-pinned tabs at end, not at start
This is slightly nicer, since tabs that you pinned first appear in the leftmost position. As a side effect, this also prevents pinned tabs from reordering themselves when loading the session. Fixes #1341
Diffstat (limited to 'src')
-rw-r--r--src/ephy-notebook.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 3526e4205..21828657b 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -1137,14 +1137,18 @@ ephy_notebook_tab_set_pinned (EphyNotebook *notebook,
gboolean is_pinned)
{
GtkWidget *tab_label;
+ int last_pinned_tab;
gboolean expanded;
gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (notebook), embed, !is_pinned);
tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (notebook), embed);
+
+ /* We have to compute the last pinned tab *before* we pin/unpin this tab. */
+ last_pinned_tab = get_last_pinned_tab_pos (notebook);
ephy_tab_label_set_pinned (tab_label, is_pinned);
if (is_pinned) {
- gtk_notebook_reorder_child (GTK_NOTEBOOK (notebook), embed, 0);
+ gtk_notebook_reorder_child (GTK_NOTEBOOK (notebook), embed, last_pinned_tab != -1 ? last_pinned_tab + 1 : 0);
expanded = FALSE;
} else {
expanded = expand_tabs_bar ();