2006-06-04 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtknotebook.c (gtk_notebook_calculate_shown_tabs):
+ (gtk_notebook_calc_tabs): Fix borderline cases in tab
+ visibility calculation. (#168105, Carlos Garnacho Parro)
+
* gdk/x11/gdkfont-x11.c (_gdk_font_destroy): Remove the right
XID from the xid table. (#34327, Sampo Savolainen, Tim Janik)
2006-06-04 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtknotebook.c (gtk_notebook_calculate_shown_tabs):
+ (gtk_notebook_calc_tabs): Fix borderline cases in tab
+ visibility calculation. (#168105, Carlos Garnacho Parro)
+
* gdk/x11/gdkfont-x11.c (_gdk_font_destroy): Remove the right
XID from the xid table. (#34327, Sampo Savolainen, Tim Janik)
&(notebook->focus_tab),
remaining_space, STEP_NEXT);
}
-
+
if (*remaining_space <= 0)
{
/* show 1 tab */
&(notebook->first_tab), remaining_space,
STEP_PREV);
- page = notebook->focus_tab->data;
- if (*remaining_space <= 0 &&
- !gtk_widget_get_child_visible(page->tab_label))
+ if (*remaining_space < 0)
{
notebook->first_tab =
gtk_notebook_search_page (notebook, notebook->first_tab,
GtkNotebookPage *page = NULL;
GList *children;
GList *last_list = NULL;
+ GList *last_calculated_child = NULL;
gboolean pack;
gint tab_pos = get_effective_tab_pos (notebook);
+ guint real_direction;
if (!start)
return;
children = start;
pack = GTK_NOTEBOOK_PAGE (start)->pack;
if (pack == GTK_PACK_END)
- direction = (direction == STEP_PREV) ? STEP_NEXT : STEP_PREV;
+ real_direction = (direction == STEP_PREV) ? STEP_NEXT : STEP_PREV;
+ else
+ real_direction = direction;
while (1)
{
{
*tab_space = - (*tab_space +
page->requisition.width);
+
+ if (*tab_space == 0 && direction == STEP_PREV)
+ children = last_calculated_child;
+
*end = children;
}
return;
}
+
+ last_calculated_child = children;
}
last_list = children;
}
- if (direction == STEP_NEXT)
+ if (real_direction == STEP_NEXT)
children = children->next;
else
children = children->prev;
{
*tab_space = - (*tab_space +
page->requisition.height);
+
+ if (*tab_space == 0 && direction == STEP_PREV)
+ children = last_calculated_child;
+
*end = children;
}
return;
}
+
+ last_calculated_child = children;
}
last_list = children;
}
- if (direction == STEP_NEXT)
+ if (real_direction == STEP_NEXT)
children = children->next;
else
children = children->prev;
}
break;
}
- if (direction == STEP_PREV)
+ if (real_direction == STEP_PREV)
return;
pack = (pack == GTK_PACK_END) ? GTK_PACK_START : GTK_PACK_END;
- direction = STEP_PREV;
+ real_direction = STEP_PREV;
children = last_list;
}
}