From f27afc611a387caf8c5774b4c167f2b9295e5be2 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 17 Sep 2017 02:56:21 -0400 Subject: src/window.c: Add a stub function to update tab positions --- (limited to 'src') diff --git a/src/window.c b/src/window.c index ee5725a..8b6efb1 100644 --- a/src/window.c +++ b/src/window.c @@ -58,6 +58,19 @@ add_tab(MqWindow *window, gchar *uri, gint position) mq_tab_update_position(tab, position); } +static void +update_positions(GtkNotebook __attribute__((unused)) *notebook, + GtkWidget __attribute__((unused)) *child, + guint __attribute__((unused)) page_num, MqWindow *window) +{ + /* TODO: Once MqWindow has a data structure for tabs, loop through them + * all and call mq_tab_update_position(). */ + /* TODO: Should this also update the tabs data structure? Probably. */ + + /* Temporarily "use" window. */ + window = window; +} + MqWindow * mq_window_new(gchar **uris) { @@ -77,6 +90,8 @@ mq_window_new(gchar **uris) gtk_notebook_set_group_name(GTK_NOTEBOOK(window->notebook), "mq-tabs"); gtk_container_add(GTK_CONTAINER(window->window), window->notebook); + g_signal_connect(window->notebook, "page-reordered", + G_CALLBACK(update_positions), window); if (uris && uris[0]) { for (i = 0; uris && uris[i]; ++i) { -- cgit v0.9.1