summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-10-15 01:10:03 -0400
committerTingPing <tingping@tingping.se>2013-10-15 01:10:03 -0400
commit57d168e56a21296a0b499caca5012962050cd45a (patch)
tree0d9cb2940b872a20cf2368e4ff1da02acce6c3be
parent490b9a91e4e17ef1efad992a315ad264293907cf (diff)
Fix moving channels when using tabs
-rw-r--r--src/fe-gtk/chanview-tabs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fe-gtk/chanview-tabs.c b/src/fe-gtk/chanview-tabs.c
index 17461da7..5024d366 100644
--- a/src/fe-gtk/chanview-tabs.c
+++ b/src/fe-gtk/chanview-tabs.c
@@ -722,11 +722,11 @@ cv_tabs_remove (chan *ch)
 static void
 cv_tabs_move (chan *ch, int delta)
 {
-	int i, pos = 0;
+	int i = 0;
+	int pos = 0;
 	GList *list;
 	GtkWidget *parent = gtk_widget_get_parent(GTK_WIDGET (ch->impl));
 
-	i = 0;
 	for (list = gtk_container_get_children (GTK_CONTAINER (parent)); list; list = list->next)
 	{
 		GtkWidget *child_entry;
@@ -734,7 +734,12 @@ cv_tabs_move (chan *ch, int delta)
 		child_entry = list->data;
 		if (child_entry == ch->impl)
 			pos = i;
-		i++;
+
+		/* keep separator at end to not throw off our count */
+		if (GTK_IS_SEPARATOR (child_entry))
+			gtk_box_reorder_child (GTK_BOX (parent), child_entry, -1);
+		else
+			i++;
 	}
 
 	pos = (pos - delta) % i;