diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-23 07:36:58 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-23 07:36:58 (EDT) |
commit | 5e8cb62d66d03c457fd155d92256f4ab6cc8f62b (patch) | |
tree | d9cf8e8e9805475ab816b5fad1168b26f7048bab /src | |
parent | b9709b1c67af92f14d56c6a089e3dc8616bc9e36 (diff) | |
download | marquee-5e8cb62d66d03c457fd155d92256f4ab6cc8f62b.zip marquee-5e8cb62d66d03c457fd155d92256f4ab6cc8f62b.tar.gz marquee-5e8cb62d66d03c457fd155d92256f4ab6cc8f62b.tar.bz2 |
MqNotebook: Update positions of tabs after inserted tab
Diffstat (limited to 'src')
-rw-r--r-- | src/notebook.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/notebook.c b/src/notebook.c index 305a2da..fc39d20 100644 --- a/src/notebook.c +++ b/src/notebook.c @@ -200,6 +200,15 @@ find_node(MqNotebook *notebook, MqTabPage *page) g_assert(notebook->found_node); } +static gboolean +update_position(MqTree *node, gpointer G_GNUC_UNUSED user_data) +{ + mq_tab_page_set_position (MQ_TAB_TREE(node)->page, node->position); + mq_tab_label_set_position(MQ_TAB_TREE(node)->label, node->position); + + return MQ_TREE_CONTINUE; +} + static void insert_page(MqNotebook *notebook, MqTabTree *node, const gchar *uri) { @@ -217,8 +226,7 @@ insert_page(MqNotebook *notebook, MqTabTree *node, const gchar *uri) gtk_widget_show_all(GTK_WIDGET(node->page)); gtk_widget_show_all(GTK_WIDGET(node->label)); - mq_tab_page_set_position (node->page, MQ_TREE(node)->position); - mq_tab_label_set_position(node->label, MQ_TREE(node)->position); + mq_tree_foreach_from(MQ_TREE(node), update_position, NULL); } MqTabPage * |