diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-06-11 18:04:29 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-06-20 19:45:13 +0800 |
commit | 6c69d491e6275aead0bdfcfa4f2d436d093aadff (patch) | |
tree | d7d176ff6cb45125eed62e36affbc1bd3a06ac97 | |
parent | 8f4b964c570b0159126af073606039b711abc917 (diff) | |
download | gsoc2013-epiphany-6c69d491e6275aead0bdfcfa4f2d436d093aadff.tar gsoc2013-epiphany-6c69d491e6275aead0bdfcfa4f2d436d093aadff.tar.gz gsoc2013-epiphany-6c69d491e6275aead0bdfcfa4f2d436d093aadff.tar.bz2 gsoc2013-epiphany-6c69d491e6275aead0bdfcfa4f2d436d093aadff.tar.lz gsoc2013-epiphany-6c69d491e6275aead0bdfcfa4f2d436d093aadff.tar.xz gsoc2013-epiphany-6c69d491e6275aead0bdfcfa4f2d436d093aadff.tar.zst gsoc2013-epiphany-6c69d491e6275aead0bdfcfa4f2d436d093aadff.zip |
ephy-window: keep track of whether the downloads box is shown
We add it to EphyWebViewChrome and track it there.
https://bugzilla.gnome.org/show_bug.cgi?id=671195
-rw-r--r-- | embed/ephy-web-view.h | 1 | ||||
-rw-r--r-- | src/ephy-window.c | 19 |
2 files changed, 15 insertions, 5 deletions
diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h index 2bdd7dbed..dd8235a03 100644 --- a/embed/ephy-web-view.h +++ b/embed/ephy-web-view.h @@ -52,6 +52,7 @@ typedef enum typedef enum { EPHY_WEB_VIEW_CHROME_TOOLBAR = 1 << 0, + EPHY_WEB_VIEW_CHROME_DOWNLOADS_BOX = 1 << 1 } EphyWebViewChrome; #define EPHY_WEB_VIEW_CHROME_ALL (EPHY_WEB_VIEW_CHROME_TOOLBAR) diff --git a/src/ephy-window.c b/src/ephy-window.c index 18ce8d0db..3ebeec78f 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -663,7 +663,8 @@ settings_changed_cb (GtkSettings *settings) static void get_chromes_visibility (EphyWindow *window, gboolean *show_toolbar, - gboolean *show_tabsbar) + gboolean *show_tabsbar, + gboolean *show_downloads_box) { EphyWindowPrivate *priv = window->priv; EphyWebViewChrome flags = priv->chrome; @@ -678,23 +679,27 @@ get_chromes_visibility (EphyWindow *window, *show_toolbar = (flags & EPHY_WEB_VIEW_CHROME_TOOLBAR) != 0; *show_tabsbar = !priv->is_popup; } + + *show_downloads_box = (flags & EPHY_WEB_VIEW_CHROME_DOWNLOADS_BOX); } static void sync_chromes_visibility (EphyWindow *window) { EphyWindowPrivate *priv = window->priv; - gboolean show_toolbar, show_tabsbar; + gboolean show_toolbar, show_tabsbar, show_downloads_box; if (priv->closing) return; get_chromes_visibility (window, &show_toolbar, - &show_tabsbar); + &show_tabsbar, + &show_downloads_box); g_object_set (priv->toolbar, "visible", show_toolbar, NULL); ephy_notebook_set_tabs_allowed (EPHY_NOTEBOOK (priv->notebook), show_tabsbar); + gtk_widget_set_visible (priv->downloads_box, show_downloads_box); } static void @@ -2779,10 +2784,14 @@ static void ephy_window_set_downloads_box_visibility (EphyWindow *window, gboolean show) { - if (show) + + if (show) { gtk_widget_show (window->priv->downloads_box); - else + window->priv->chrome |= EPHY_WEB_VIEW_CHROME_DOWNLOADS_BOX; + } else { gtk_widget_hide (window->priv->downloads_box); + window->priv->chrome &= ~EPHY_WEB_VIEW_CHROME_DOWNLOADS_BOX; + } } static void |