diff options
author | Xan Lopez <xan@igalia.com> | 2012-04-16 20:03:49 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-04-16 21:53:29 +0800 |
commit | 7b666dcffb61a417ebe43ab9f10ca0450a288ea8 (patch) | |
tree | 8751b8d36334228c67cb1c52d8f48410c2634cb0 | |
parent | 6e45bec38cc6696c2cc789403082368fcdbcd68f (diff) | |
download | gsoc2013-epiphany-7b666dcffb61a417ebe43ab9f10ca0450a288ea8.tar gsoc2013-epiphany-7b666dcffb61a417ebe43ab9f10ca0450a288ea8.tar.gz gsoc2013-epiphany-7b666dcffb61a417ebe43ab9f10ca0450a288ea8.tar.bz2 gsoc2013-epiphany-7b666dcffb61a417ebe43ab9f10ca0450a288ea8.tar.lz gsoc2013-epiphany-7b666dcffb61a417ebe43ab9f10ca0450a288ea8.tar.xz gsoc2013-epiphany-7b666dcffb61a417ebe43ab9f10ca0450a288ea8.tar.zst gsoc2013-epiphany-7b666dcffb61a417ebe43ab9f10ca0450a288ea8.zip |
Add an option to never show the tabs bar
We'll use this when we land the Overview.
-rw-r--r-- | data/org.gnome.epiphany.gschema.xml | 2 | ||||
-rw-r--r-- | lib/ephy-prefs.h | 3 | ||||
-rw-r--r-- | 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 69386bdf1..d69c7ab57 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 a510f657a..d2a5f5884 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 5614ca707..1b73e7bfa 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); } |