summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/toolbars/navigation-toolbar.c15
-rw-r--r--src/toolbars/navigation-toolbar.h3
2 files changed, 14 insertions, 4 deletions
diff --git a/src/toolbars/navigation-toolbar.c b/src/toolbars/navigation-toolbar.c
index 2392efd..95d98da 100644
--- a/src/toolbars/navigation-toolbar.c
+++ b/src/toolbars/navigation-toolbar.c
@@ -45,6 +45,7 @@ struct _MqNavigationToolbar {
MqFindToolbar *find_toolbar;
MqWebView *web_view;
gchar *uri;
+ GtkToolItem *uri_entry;
};
enum {
@@ -71,7 +72,6 @@ constructed(GObject *object)
GtkToolItem *back_forward_button_box;
GtkToolItem *bookmarks_button_box;
GtkToolItem *stop_reload_button;
- GtkToolItem *uri_entry;
GtkToolItem *home_button;
GtkToolItem *history_button;
GtkToolItem *downloads_button;
@@ -93,8 +93,8 @@ constructed(GObject *object)
navigation_toolbar->web_view);
/* URI entry */
- uri_entry = mq_uri_entry_new(navigation_toolbar->web_view,
- navigation_toolbar->uri);
+ navigation_toolbar->uri_entry = mq_uri_entry_new(
+ navigation_toolbar->web_view, navigation_toolbar->uri);
/* Bookmarks button box */
bookmarks_button_box = mq_bookmarks_button_box_new();
@@ -118,7 +118,8 @@ constructed(GObject *object)
back_forward_button_box, -1);
gtk_toolbar_insert(GTK_TOOLBAR(navigation_toolbar),
stop_reload_button, -1);
- gtk_toolbar_insert(GTK_TOOLBAR(navigation_toolbar), uri_entry, -1);
+ gtk_toolbar_insert(GTK_TOOLBAR(navigation_toolbar),
+ navigation_toolbar->uri_entry, -1);
gtk_toolbar_insert(GTK_TOOLBAR(navigation_toolbar),
bookmarks_button_box, -1);
gtk_toolbar_insert(GTK_TOOLBAR(navigation_toolbar), home_button, -1);
@@ -277,3 +278,9 @@ mq_navigation_toolbar_new(MqConfig *config, MqTabPage *tab_page,
"uri", uri,
NULL);
}
+
+void
+mq_navigation_toolbar_focus_uri_entry(MqNavigationToolbar *navigation_toolbar)
+{
+ mq_uri_entry_grab_focus(MQ_URI_ENTRY(navigation_toolbar->uri_entry));
+}
diff --git a/src/toolbars/navigation-toolbar.h b/src/toolbars/navigation-toolbar.h
index 3dd9959..38c6c17 100644
--- a/src/toolbars/navigation-toolbar.h
+++ b/src/toolbars/navigation-toolbar.h
@@ -57,6 +57,9 @@ GtkWidget *
mq_navigation_toolbar_new(MqConfig *config, MqTabPage *tab_page,
MqFindToolbar *find_toolbar, MqWebView *web_view, const gchar *uri);
+void
+mq_navigation_toolbar_focus_uri_entry(MqNavigationToolbar *navigation_toolbar);
+
G_END_DECLS
#endif /* MQ_TOOLBARS_NAVIGATION_TOOLBAR_H */