From 3d570ce5ac40a1a05f41fe8a68581cc49ea81a60 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 14 Nov 2017 23:23:39 -0500 Subject: mq_notebook_insert_*(): Focus URI entry of inserted tab page --- (limited to 'src') diff --git a/src/notebook.c b/src/notebook.c index 4919b0c..0185bdf 100644 --- a/src/notebook.c +++ b/src/notebook.c @@ -367,6 +367,10 @@ mq_notebook_insert_top(MqNotebook *notebook, const gchar *uri, mq_tree_position(node) - 1); } + if (!uri || !uri[0]) { + mq_tab_page_focus_uri_entry(node->page); + } + return node->page; } @@ -390,6 +394,9 @@ mq_notebook_insert_sibling(MqNotebook *notebook, const gchar *uri, notebook->current_page = node->page; gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), mq_tree_position(node) - 1); + if (!uri || !uri[0]) { + mq_tab_page_focus_uri_entry(node->page); + } } return node->page; @@ -415,6 +422,9 @@ mq_notebook_insert_child(MqNotebook *notebook, const gchar *uri, notebook->current_page = node->page; gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), mq_tree_position(node) - 1); + if (!uri || !uri[0]) { + mq_tab_page_focus_uri_entry(node->page); + } } return node->page; -- cgit v0.9.1