[epiphany] ephy-window: keep track of whether the downloads box is shown



commit 6c69d491e6275aead0bdfcfa4f2d436d093aadff
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Jun 11 13:04:29 2012 +0300

    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

 embed/ephy-web-view.h |    1 +
 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 2bdd7db..dd8235a 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 18ce8d0..3ebeec7 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



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