summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-11-30 15:38:45 +0000
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-12-01 21:52:17 +0000
commit9cd05cd5c6cbb8cd4e7f7fa31e9a1b6da9628959 (patch)
tree9ce6fef8e6128a81d703937caf593f4cd95ef3db
parent5cceef6e7aaaa41ca4c4e122f995318363ea974a (diff)
downloadepiphany-9cd05cd5c6cbb8cd4e7f7fa31e9a1b6da9628959.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 (cherry picked from commit 42c2385b62d9b75292574b05009d4f6925f613c4)
-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 fb0e6aeaa..c68974149 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 ();