fixed status bar content not removed when switching to another article
[prss.git] / src / webbrowser.c
index ebbfce1..bb69e34 100644 (file)
@@ -22,7 +22,7 @@
 #include "webbrowser.h"
 
 static WebKitWebView *view;
-static GtkLabel *w_status;
+static GtkStatusbar *w_status;
 
 static gboolean new_window_requested_cbk(WebKitWebView *view,
                                         WebKitWebFrame *frame,
@@ -42,10 +42,14 @@ static void hovering_over_link_cbk(WebKitWebView *web_view,
                                   gchar *uri,
                                   gpointer user_data)
 {
+       guint id;
+
+       id = gtk_statusbar_get_context_id(w_status, "info");
+
        if (uri)
-               gtk_label_set_label(w_status, uri);
+               gtk_statusbar_push(w_status, id, uri);
        else
-               gtk_label_set_label(w_status, "");
+               gtk_statusbar_remove_all(w_status, id);
 }
 
 GtkWidget *web_get_widget()
@@ -70,7 +74,7 @@ void web_load(const char *str)
        webkit_web_view_load_string(view, str, NULL, "UTF-8", "file://");
 }
 
-void webbrowser_init(GtkLabel *status)
+void webbrowser_init(GtkStatusbar *status)
 {
        w_status = status;
 }