commit: 008910b49b0686ac2cb165153d411703d887303a
parent: 78a41bafb8ea56d72e873e617d1adbc5c3d0e212
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 8 Jan 2019 22:17:31 +0100
badwolf.c: Use a GtkLabel instead of GtkStatusBar
Diffstat:
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/badwolf.c b/badwolf.c
@@ -79,14 +79,8 @@ static gboolean WebViewCb_mouse_target_changed(WebKitWebView *webView,
{
struct Client *browser = (struct Client *)user_data;
const gchar *link_uri = webkit_hit_test_result_get_link_uri(hit);
- guint context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(browser->statusbar), "link");
- gtk_statusbar_remove_all(GTK_STATUSBAR(browser->statusbar), context_id);
-
- if(link_uri != NULL)
- {
- gtk_statusbar_push(GTK_STATUSBAR(browser->statusbar), context_id, link_uri);
- }
+ gtk_label_set_text(GTK_LABEL(browser->statusbar), link_uri);
return TRUE;
}
@@ -115,7 +109,7 @@ int main(int argc, char *argv[])
browser->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
browser->location = gtk_entry_new();
- browser->statusbar = gtk_statusbar_new();
+ browser->statusbar = gtk_label_new(NULL);
browser->webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
gtk_container_add(GTK_CONTAINER(browser->main_window), browser->box);
@@ -123,6 +117,8 @@ int main(int argc, char *argv[])
gtk_box_pack_start(GTK_BOX(browser->box), GTK_WIDGET(browser->webView), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(browser->box), GTK_WIDGET(browser->statusbar), FALSE, FALSE, 0);
+ gtk_widget_set_halign(browser->statusbar, GTK_ALIGN_START);
+
gtk_entry_set_text(GTK_ENTRY(browser->location), target_url);
g_signal_connect(browser->main_window, "destroy", G_CALLBACK(gtk_main_quit), NULL);