Changeset 99201 in webkit


Ignore:
Timestamp:
Nov 3, 2011 9:13:49 AM (13 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Show load progress information in MiniBrowser using WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=71461

Reviewed by Martin Robinson.

  • MiniBrowser/gtk/BrowserWindow.c:

(resetEntryProgress): Reset the entry progress after a while when
load has been completed.
(webViewLoadProgressChanged): Update location entry progress.
(browserWindowConstructed): Connect to WebView
notify::estimated-load-progress signal.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r99200 r99201  
     12011-11-03  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Show load progress information in MiniBrowser using WebKit2 GTK+ API
     4        https://bugs.webkit.org/show_bug.cgi?id=71461
     5
     6        Reviewed by Martin Robinson.
     7
     8        * MiniBrowser/gtk/BrowserWindow.c:
     9        (resetEntryProgress): Reset the entry progress after a while when
     10        load has been completed.
     11        (webViewLoadProgressChanged): Update location entry progress.
     12        (browserWindowConstructed): Connect to WebView
     13        notify::estimated-load-progress signal.
     14
    1152011-11-03  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • trunk/Tools/MiniBrowser/gtk/BrowserWindow.c

    r99200 r99201  
    7373}
    7474
     75static gboolean resetEntryProgress(GtkEntry *entry)
     76{
     77    gtk_entry_set_progress_fraction(entry, 0);
     78    return FALSE;
     79}
     80
     81static void webViewLoadProgressChanged(WebKitWebView *webView, GParamSpec *pspec, BrowserWindow *window)
     82{
     83    gdouble progress = webkit_web_view_get_estimated_load_progress(webView);
     84    gtk_entry_set_progress_fraction(GTK_ENTRY(window->uriEntry), progress);
     85    if (progress == 1.0)
     86        g_timeout_add(500, (GSourceFunc)resetEntryProgress, window->uriEntry);
     87}
     88
    7589static void browserWindowFinalize(GObject *gObject)
    7690{
     
    160174
    161175    g_signal_connect(window->webView, "notify::uri", G_CALLBACK(webViewURIChanged), window);
     176    g_signal_connect(window->webView, "notify::estimated-load-progress", G_CALLBACK(webViewLoadProgressChanged), window);
    162177
    163178    gtk_box_pack_start(GTK_BOX(window->mainBox), GTK_WIDGET(window->webView), TRUE, TRUE, 0);
Note: See TracChangeset for help on using the changeset viewer.