diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-28 15:03:55 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-28 15:03:55 (EDT) |
commit | 66372daa502d507c23ff54b51a7472759ff5172a (patch) | |
tree | 8e19eea6f1ebb16a0cac75cf1b6d75040ed5f806 | |
parent | 73eba9d25be572255997d2ea61d798e0d547b069 (diff) | |
download | marquee-66372daa502d507c23ff54b51a7472759ff5172a.zip marquee-66372daa502d507c23ff54b51a7472759ff5172a.tar.gz marquee-66372daa502d507c23ff54b51a7472759ff5172a.tar.bz2 |
MqWindow: Update title on tab switch
-rw-r--r-- | src/window.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index be034f8..32105a3 100644 --- a/src/window.c +++ b/src/window.c @@ -28,11 +28,24 @@ #include "tab.h" static void +set_title(MqWindow *window, const gchar *title) +{ + gchar *window_title; + + window_title = g_strdup_printf("%s - Marquee", title); + gtk_window_set_title(GTK_WINDOW(window->window), window_title); + g_free(window_title); +} + +static void switch_page_cb(GtkNotebook __attribute__((unused)) *notebook, GtkWidget __attribute__((unused)) *page, guint page_num, MqWindow *window) { window->current_tab = page_num; + + set_title(window, mq_tab_get_title(mq_tab_seek(window->root_tab, + page_num + 1))); } static void |