[epiphany] Add an option to never show the tabs bar



commit 7b666dcffb61a417ebe43ab9f10ca0450a288ea8
Author: Xan Lopez <xan igalia com>
Date:   Mon Apr 16 14:03:49 2012 +0200

    Add an option to never show the tabs bar
    
    We'll use this when we land the Overview.

 data/org.gnome.epiphany.gschema.xml |    2 +-
 lib/ephy-prefs.h                    |    3 ++-
 src/ephy-notebook.c                 |   12 ++++++------
 3 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/data/org.gnome.epiphany.gschema.xml b/data/org.gnome.epiphany.gschema.xml
index 69386bd..d69c7ab 100644
--- a/data/org.gnome.epiphany.gschema.xml
+++ b/data/org.gnome.epiphany.gschema.xml
@@ -88,7 +88,7 @@
 		<key name="tabs-bar-visibility-policy" enum="org.gnome.Epiphany.EphyPrefsUITabsBarVisibilityPolicy">
 			<default>'more-than-one'</default>
 			<summary>The visibility policy for the tabs  bar.</summary>
-			<description>Controls when the tabs bar is shown. Possible values are 'always' (the tabs bar is always shown) and 'more-than-one' (the tabs bar is only shown if there's two or more tabs).</description>
+			<description>Controls when the tabs bar is shown. Possible values are 'always' (the tabs bar is always shown), 'more-than-one' (the tabs bar is only shown if there's two or more tabs) and 'never' (the tabs bar is never shown).</description>
 		</key>
 	</schema>
 	<schema path="/org/gnome/epiphany/web/" id="org.gnome.Epiphany.web">
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index a510f65..d2a5f58 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -46,7 +46,8 @@ typedef enum
 typedef enum
 {
   EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_ALWAYS,
-  EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_MORE_THAN_ONE
+  EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_MORE_THAN_ONE,
+  EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_NEVER
 } EphyPrefsUITabsBarVisibilityPolicy;
 
 typedef enum
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 5614ca7..1b73e7b 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -397,7 +397,7 @@ update_tabs_visibility (EphyNotebook *nb,
 			gboolean before_inserting)
 {
 	EphyEmbedShellMode mode;
-	gboolean show_tabs;
+	gboolean show_tabs = FALSE;
 	guint num;
 	EphyPrefsUITabsBarVisibilityPolicy policy;
 
@@ -409,11 +409,11 @@ update_tabs_visibility (EphyNotebook *nb,
 	policy = g_settings_get_enum (EPHY_SETTINGS_UI,
 				      EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY);
 
-	show_tabs = mode != EPHY_EMBED_SHELL_MODE_APPLICATION &&
-		(policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_ALWAYS
-		 || num > 1) &&
-		priv->show_tabs == TRUE;
-
+	if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION &&
+	    ((policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_MORE_THAN_ONE && num > 1) ||
+	     policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_ALWAYS))
+		show_tabs = TRUE;
+	    
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nb), show_tabs);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]