Changeset 99275 in webkit


Ignore:
Timestamp:
Nov 4, 2011 6:37:12 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Use web view title as window title in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=71544

Reviewed by Philippe Normand.

  • MiniBrowser/gtk/BrowserWindow.c:

(webViewURIChanged): Removed extra space.
(webViewTitleChanged): Set window title using
webkit_web_view_get_title().
(browser_window_init): Set initial default window title.
(browserWindowConstructed): Connect to WebView notify::title
signal.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r99274 r99275  
     12011-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Use web view title as window title in MiniBrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=71544
     5
     6        Reviewed by Philippe Normand.
     7
     8        * MiniBrowser/gtk/BrowserWindow.c:
     9        (webViewURIChanged): Removed extra space.
     10        (webViewTitleChanged): Set window title using
     11        webkit_web_view_get_title().
     12        (browser_window_init): Set initial default window title.
     13        (browserWindowConstructed): Connect to WebView notify::title
     14        signal.
     15
    1162011-11-04  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    217
  • trunk/Tools/MiniBrowser/gtk/BrowserWindow.c

    r99207 r99275  
    5050};
    5151
     52static const char *defaultWindowTitle = "WebKitGTK+ MiniBrwoser";
    5253static gint windowCount = 0;
    5354
     
    8283}
    8384
    84 static void webViewURIChanged(WebKitWebView *webView,  GParamSpec *pspec, BrowserWindow *window)
     85static void webViewURIChanged(WebKitWebView *webView, GParamSpec *pspec, BrowserWindow *window)
    8586{
    8687    gtk_entry_set_text(GTK_ENTRY(window->uriEntry), webkit_web_view_get_uri(webView));
     88}
     89
     90static void webViewTitleChanged(WebKitWebView *webView, GParamSpec *pspec, BrowserWindow *window)
     91{
     92    const char *title = webkit_web_view_get_title(webView);
     93    gtk_window_set_title(GTK_WINDOW(window), title ? title : defaultWindowTitle);
    8794}
    8895
     
    207214    g_atomic_int_inc(&windowCount);
    208215
     216    gtk_window_set_title(GTK_WINDOW(window), defaultWindowTitle);
    209217    gtk_window_set_default_size(GTK_WINDOW(window), 800, 600);
    210218
     
    257265    g_signal_connect(window->webView, "notify::uri", G_CALLBACK(webViewURIChanged), window);
    258266    g_signal_connect(window->webView, "notify::estimated-load-progress", G_CALLBACK(webViewLoadProgressChanged), window);
     267    g_signal_connect(window->webView, "notify::title", G_CALLBACK(webViewTitleChanged), window);
    259268
    260269    WebKitBackForwardList *backForwadlist = webkit_web_view_get_back_forward_list(window->webView);
Note: See TracChangeset for help on using the changeset viewer.