summaryrefslogtreecommitdiffstats
path: root/src/notebook.c
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-23 06:08:16 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-23 06:08:16 (EDT)
commit8a3bccf0dc619caaa0d912409cd24eddff7cb3b5 (patch)
tree6825988725bebd04f7db3b6249849668670babd4 /src/notebook.c
parent415c025725557acd75d86ec87b8bcc09ed66986d (diff)
downloadmarquee-8a3bccf0dc619caaa0d912409cd24eddff7cb3b5.zip
marquee-8a3bccf0dc619caaa0d912409cd24eddff7cb3b5.tar.gz
marquee-8a3bccf0dc619caaa0d912409cd24eddff7cb3b5.tar.bz2
mq_notebook_update_tab_title(): New function
Diffstat (limited to 'src/notebook.c')
-rw-r--r--src/notebook.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/notebook.c b/src/notebook.c
index 3521c93..1a33a4c 100644
--- a/src/notebook.c
+++ b/src/notebook.c
@@ -42,6 +42,7 @@ struct _MqNotebook {
MqWindow *window;
MqTabTree *tree;
MqTabTree *found_node;
+ MqTabPage *current_page;
};
enum {
@@ -118,6 +119,8 @@ static void
switch_page_cb(MqNotebook *notebook, MqTabPage *page,
guint G_GNUC_UNUSED page_num)
{
+ notebook->current_page = page;
+
mq_window_set_title(notebook->window, mq_tab_page_get_title(page));
}
@@ -243,3 +246,12 @@ mq_notebook_insert_child(MqNotebook *notebook, const gchar *uri,
return node->page;
}
+
+void
+mq_notebook_update_tab_title(MqNotebook *notebook, MqTabPage *tab_page,
+ const gchar *title)
+{
+ if (tab_page == notebook->current_page) {
+ mq_window_set_title(notebook->window, title);
+ }
+}