Fix moving channels when using tabs

This commit is contained in:
TingPing 2013-10-15 01:10:03 -04:00
parent 490b9a91e4
commit 57d168e56a

View File

@ -722,11 +722,11 @@ cv_tabs_remove (chan *ch)
static void static void
cv_tabs_move (chan *ch, int delta) cv_tabs_move (chan *ch, int delta)
{ {
int i, pos = 0; int i = 0;
int pos = 0;
GList *list; GList *list;
GtkWidget *parent = gtk_widget_get_parent(GTK_WIDGET (ch->impl)); 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) for (list = gtk_container_get_children (GTK_CONTAINER (parent)); list; list = list->next)
{ {
GtkWidget *child_entry; GtkWidget *child_entry;
@ -734,6 +734,11 @@ cv_tabs_move (chan *ch, int delta)
child_entry = list->data; child_entry = list->data;
if (child_entry == ch->impl) if (child_entry == ch->impl)
pos = i; pos = 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++; i++;
} }