summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tab.c38
-rw-r--r--src/tab.h3
2 files changed, 22 insertions, 19 deletions
diff --git a/src/tab.c b/src/tab.c
index 800d649..626424a 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -32,23 +32,6 @@
#include "web-view.h"
static void
-update_positions(MqTab *node, gint step)
-{
- if (node) {
- node->position += step;
- if (node->tab) {
- mq_tab_label_set_position(MQ_TAB_LABEL(node->tab),
- node->position);
- }
- if (node->next) {
- update_positions(node->next, step);
- } else if (node->parent && node->parent->next) {
- update_positions(node->parent->next, step);
- }
- }
-}
-
-static void
update_tree_sizes(MqTab *node, guint step)
{
if (node) {
@@ -74,7 +57,7 @@ append_child(MqTab *new_node, MqTab *parent)
parent->first_child = new_node;
}
parent->last_child = new_node;
- update_positions(new_node, 1);
+ mq_tab_update_positions(new_node, 1);
update_tree_sizes(new_node, 1);
}
@@ -92,7 +75,7 @@ append_sibling(MqTab *new_node, MqTab *prev_sibling)
prev_sibling->next->prev = new_node;
}
prev_sibling->next = new_node;
- update_positions(new_node, 1);
+ mq_tab_update_positions(new_node, 1);
update_tree_sizes(new_node, 1);
}
@@ -220,6 +203,23 @@ mq_tab_get_window(MqTab *tab)
}
void
+mq_tab_update_positions(MqTab *node, gint step)
+{
+ if (node) {
+ node->position += step;
+ if (node->tab) {
+ mq_tab_label_set_position(MQ_TAB_LABEL(node->tab),
+ node->position);
+ }
+ if (node->next) {
+ mq_tab_update_positions(node->next, step);
+ } else if (node->parent && node->parent->next) {
+ mq_tab_update_positions(node->parent->next, step);
+ }
+ }
+}
+
+void
mq_tab_update_position(MqTab *tab, guint position)
{
tab->position = position;
diff --git a/src/tab.h b/src/tab.h
index b49d72d..30d6b3d 100644
--- a/src/tab.h
+++ b/src/tab.h
@@ -69,6 +69,9 @@ MqWindow *
mq_tab_get_window(MqTab *tab);
void
+mq_tab_update_positions(MqTab *node, gint step);
+
+void
mq_tab_update_position(MqTab *tab, guint position);
guint