aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2011-12-16 20:38:05 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2011-12-16 20:39:50 +0800
commit8fad1a68ef1649601b1cde4fb5830d0e34023aba (patch)
tree8fcf507265f0ca4ded156639c486bbadc68d36a2
parentb0772af83253244ab94f8842d35ea3bda830bd27 (diff)
downloadgsoc2013-epiphany-8fad1a68ef1649601b1cde4fb5830d0e34023aba.tar
gsoc2013-epiphany-8fad1a68ef1649601b1cde4fb5830d0e34023aba.tar.gz
gsoc2013-epiphany-8fad1a68ef1649601b1cde4fb5830d0e34023aba.tar.bz2
gsoc2013-epiphany-8fad1a68ef1649601b1cde4fb5830d0e34023aba.tar.lz
gsoc2013-epiphany-8fad1a68ef1649601b1cde4fb5830d0e34023aba.tar.xz
gsoc2013-epiphany-8fad1a68ef1649601b1cde4fb5830d0e34023aba.tar.zst
gsoc2013-epiphany-8fad1a68ef1649601b1cde4fb5830d0e34023aba.zip
EphyEmbed: Hide the statusbar in a timeout handler
To allow it being displayed for a short while once it's complete.
-rw-r--r--embed/ephy-embed.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index d7366cc97..05fc63963 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -85,6 +85,8 @@ struct _EphyEmbedPrivate
guint tab_message_id;
guint pop_statusbar_later_source_id;
+
+ guint clear_progress_source_id;
};
G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_BOX)
@@ -309,6 +311,9 @@ ephy_embed_finalize (GObject *object)
g_slist_free (embed->priv->keys);
embed->priv->keys = NULL;
+ if (embed->priv->clear_progress_source_id)
+ g_source_remove (embed->priv->clear_progress_source_id);
+
G_OBJECT_CLASS (ephy_embed_parent_class)->finalize (object);
}
@@ -523,6 +528,15 @@ frame_enter_notify_cb (GtkWidget *widget,
return FALSE;
}
+static gboolean
+clear_progress_cb (EphyEmbed *embed)
+{
+ gtk_widget_hide (embed->priv->progress);
+ embed->priv->clear_progress_source_id = 0;
+
+ return FALSE;
+}
+
static void
progress_update (EphyWebView *view, GParamSpec *pspec, EphyEmbed *embed)
{
@@ -531,11 +545,18 @@ progress_update (EphyWebView *view, GParamSpec *pspec, EphyEmbed *embed)
EphyEmbedPrivate *priv = embed->priv;
+ if (priv->clear_progress_source_id) {
+ g_source_remove (priv->clear_progress_source_id);
+ priv->clear_progress_source_id = 0;
+ }
+
progress = webkit_web_view_get_progress (priv->web_view);
loading = ephy_web_view_is_loading (EPHY_WEB_VIEW (priv->web_view));
if (progress == 1.0 || !loading)
- gtk_widget_hide (priv->progress);
+ priv->clear_progress_source_id = g_timeout_add (500,
+ (GSourceFunc) clear_progress_cb,
+ embed);
else
gtk_widget_show (priv->progress);