From 86117c86ed80b6d660258045a680f89a46b0f9d5 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 17 Sep 2017 03:39:05 -0400 Subject: src/tab-chrome.c: Handle URI bar activation --- (limited to 'src') diff --git a/src/tab-chrome.c b/src/tab-chrome.c index d66fcb1..2808b3f 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -40,6 +40,13 @@ forward_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton, webkit_web_view_go_forward(chrome->web_view); } +static void +uri_activate_cb(GtkEntry *entry, MqTabChrome *chrome) +{ + webkit_web_view_load_uri(chrome->web_view, + gtk_entry_get_text(GTK_ENTRY(entry))); +} + static GtkWidget * navigation_toolbar_new(MqTabChrome *chrome, gchar *uri) { @@ -71,6 +78,8 @@ navigation_toolbar_new(MqTabChrome *chrome, gchar *uri) gtk_entry_set_icon_from_icon_name(GTK_ENTRY(chrome->uri_entry), GTK_ENTRY_ICON_PRIMARY, "text-x-generic"); gtk_entry_set_progress_fraction(GTK_ENTRY(chrome->uri_entry), 0.0); + g_signal_connect(chrome->uri_entry, "activate", + G_CALLBACK(uri_activate_cb), chrome); gtk_container_add(GTK_CONTAINER(uri_toolitem), chrome->uri_entry); gtk_tool_item_set_expand(uri_toolitem, TRUE); -- cgit v0.9.1