diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-23 06:08:16 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-23 06:08:16 (EDT) |
commit | 8a3bccf0dc619caaa0d912409cd24eddff7cb3b5 (patch) | |
tree | 6825988725bebd04f7db3b6249849668670babd4 | |
parent | 415c025725557acd75d86ec87b8bcc09ed66986d (diff) | |
download | marquee-8a3bccf0dc619caaa0d912409cd24eddff7cb3b5.zip marquee-8a3bccf0dc619caaa0d912409cd24eddff7cb3b5.tar.gz marquee-8a3bccf0dc619caaa0d912409cd24eddff7cb3b5.tar.bz2 |
mq_notebook_update_tab_title(): New function
-rw-r--r-- | src/notebook.c | 12 | ||||
-rw-r--r-- | src/notebook.h | 4 |
2 files changed, 16 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); + } +} diff --git a/src/notebook.h b/src/notebook.h index 47c1e5d..4cb696e 100644 --- a/src/notebook.h +++ b/src/notebook.h @@ -64,6 +64,10 @@ MqTabPage * mq_notebook_insert_child(MqNotebook *notebook, const gchar *uri, MqTabPage *child); +void +mq_notebook_update_tab_title(MqNotebook *notebook, MqTabPage *tab_page, + const gchar *title); + G_END_DECLS #endif /* MQ_NOTEBOOK_H */ |