diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-14 23:12:27 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-14 23:12:27 (EST) |
commit | 1d78f8a495125e4e312552228c61dd3caf9e9ae1 (patch) | |
tree | ee7f8dba4bdad7d95eb1c2ae34e114edce79f6ff | |
parent | 0da420729ff5249c31de1744f216b40395db0e67 (diff) | |
download | marquee-1d78f8a495125e4e312552228c61dd3caf9e9ae1.zip marquee-1d78f8a495125e4e312552228c61dd3caf9e9ae1.tar.gz marquee-1d78f8a495125e4e312552228c61dd3caf9e9ae1.tar.bz2 |
mq_navigation_toolbar_focus_uri_entry(): New function
-rw-r--r-- | src/toolbars/navigation-toolbar.c | 15 | ||||
-rw-r--r-- | src/toolbars/navigation-toolbar.h | 3 |
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 */ |