aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-30 18:42:07 +0800
committerXan Lopez <xan@igalia.com>2012-03-30 18:42:07 +0800
commit8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48 (patch)
tree08fa1bb532b36769013fb623e817bc8430676c6f /src
parent197ead54280e9c5b6478124ce8f30ca9fb65db6f (diff)
downloadgsoc2013-epiphany-8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48.tar
gsoc2013-epiphany-8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48.tar.gz
gsoc2013-epiphany-8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48.tar.bz2
gsoc2013-epiphany-8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48.tar.lz
gsoc2013-epiphany-8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48.tar.xz
gsoc2013-epiphany-8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48.tar.zst
gsoc2013-epiphany-8a886cb6af00b1a2fb7c544ba9b8cd82586e9c48.zip
ephy-window: listen to org.gnome.Epiphany.ui.show-toolbars
We were not properly changing the UI if the key was changing at runtime.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index a54f7f2d3..36243a3ad 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -727,6 +727,19 @@ sync_chromes_visibility (EphyWindow *window)
}
static void
+set_toolbar_visibility (EphyWindow *window, gboolean show_toolbar)
+{
+ EphyWindowPrivate *priv = window->priv;
+
+ if (show_toolbar)
+ priv->chrome |= EPHY_WEB_VIEW_CHROME_TOOLBAR;
+ else
+ priv->chrome &= ~EPHY_WEB_VIEW_CHROME_TOOLBAR;
+
+ sync_chromes_visibility (window);
+}
+
+static void
sync_tab_load_status (EphyWebView *view,
GParamSpec *pspec,
EphyWindow *window)
@@ -3128,6 +3141,19 @@ allow_popups_notifier (GSettings *settings,
}
static void
+show_toolbars_setting_cb (GSettings *settings,
+ char *key,
+ EphyWindow *window)
+{
+ gboolean show_toolbars;
+
+ show_toolbars = g_settings_get_boolean (EPHY_SETTINGS_UI,
+ EPHY_PREFS_UI_SHOW_TOOLBARS);
+
+ set_toolbar_visibility (window, show_toolbars);
+}
+
+static void
sync_user_input_cb (EphyLocationController *action,
GParamSpec *pspec,
EphyWindow *window)
@@ -3364,6 +3390,10 @@ ephy_window_constructor (GType type,
"changed::" EPHY_PREFS_WEB_ENABLE_POPUPS,
G_CALLBACK (allow_popups_notifier), window);
+ g_signal_connect (EPHY_SETTINGS_UI,
+ "changed::" EPHY_PREFS_UI_SHOW_TOOLBARS,
+ G_CALLBACK (show_toolbars_setting_cb), window);
+
/* network status */
single = EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (embed_shell));
sync_network_status (single, NULL, window);