[epiphany/tgt: 9/10] Change mouse icon while page is loading



commit 2ed804282d91cf76135131d49b028b3302895463
Author: Manuel Rego Casasnovas <rego igalia com>
Date:   Thu Sep 12 09:26:26 2013 +0200

    Change mouse icon while page is loading
    
    Use the GDK_WATCH icon for mouse while the page is loading. Once the page is
    ready it comes back to the previous icon.

 embed/ephy-embed.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 7bf2411..e15e8b4 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -853,9 +853,17 @@ window_resize_requested (WebKitWebWindowFeatures *features, GParamSpec *pspec, E
 static gboolean
 clear_progress_cb (EphyEmbed *embed)
 {
+  GtkWidget *widget;
+  GdkCursor *cursor;
+
   gtk_widget_hide (embed->priv->progress);
   embed->priv->clear_progress_source_id = 0;
 
+  widget = GTK_WIDGET (embed->priv->web_view);
+  cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+                                       GDK_LAST_CURSOR);
+  gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
+
   return FALSE;
 }
 
@@ -889,9 +897,18 @@ progress_update (EphyWebView *view, GParamSpec *pspec, EphyEmbed *embed)
     priv->clear_progress_source_id = g_timeout_add (500,
                                                     (GSourceFunc)clear_progress_cb,
                                                     embed);
-  else
+  else {
+    GtkWidget *widget;
+    GdkCursor *cursor;
+
     gtk_widget_show (priv->progress);
 
+    widget = GTK_WIDGET (embed->priv->web_view);
+    cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+                                         GDK_WATCH);
+    gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
+  }
+
   gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->progress),
                                  (loading || progress == 1.0) ? progress : 0.0);
 }


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