aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-04-16 19:41:52 +0800
committerXan Lopez <xan@igalia.com>2012-04-16 19:41:52 +0800
commit954fd17d06fe9453c355223d66207b23f359665b (patch)
tree5ea83a71a01a43ef6fdfbd9c2262992b9ca2ddc6 /src/ephy-notebook.c
parent6ca351051cee2d7528a4c03a5ffb50a230be5327 (diff)
downloadgsoc2013-epiphany-954fd17d06fe9453c355223d66207b23f359665b.tar
gsoc2013-epiphany-954fd17d06fe9453c355223d66207b23f359665b.tar.gz
gsoc2013-epiphany-954fd17d06fe9453c355223d66207b23f359665b.tar.bz2
gsoc2013-epiphany-954fd17d06fe9453c355223d66207b23f359665b.tar.lz
gsoc2013-epiphany-954fd17d06fe9453c355223d66207b23f359665b.tar.xz
gsoc2013-epiphany-954fd17d06fe9453c355223d66207b23f359665b.tar.zst
gsoc2013-epiphany-954fd17d06fe9453c355223d66207b23f359665b.zip
Create a new 'tabs-bar-visibility-policy' setting
We need this to be an enum, since we'll a third option in the future for the Overview (to never show the tabs bar). For now just add the two values we have now and migrate the code and the user data.
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index db07f1ae6..22465ad43 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -400,15 +400,18 @@ update_tabs_visibility (EphyNotebook *nb,
EphyEmbedShellMode mode;
gboolean show_tabs;
guint num;
+ EphyPrefsUITabsBarVisibilityPolicy policy;
mode = ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (ephy_shell_get_default ()));
num = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb));
if (before_inserting) num++;
+ policy = g_settings_get_enum (EPHY_SETTINGS_UI,
+ EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY);
+
show_tabs = mode != EPHY_EMBED_SHELL_MODE_APPLICATION &&
- (g_settings_get_boolean (EPHY_SETTINGS_UI,
- EPHY_PREFS_UI_ALWAYS_SHOW_TABS_BAR)
+ (policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_ALWAYS
|| num > 1) &&
priv->show_tabs == TRUE;
@@ -455,7 +458,7 @@ ephy_notebook_init (EphyNotebook *notebook)
gtk_drag_dest_add_text_targets (widget);
g_signal_connect (EPHY_SETTINGS_UI,
- "changed::" EPHY_PREFS_UI_ALWAYS_SHOW_TABS_BAR,
+ "changed::" EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY,
G_CALLBACK (show_tabs_changed_cb), notebook);
}