summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-03-05 03:01:44 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2011-03-07 00:49:14 -0500
commita3b3c91001840908891c1954a35c6892ca569e6e (patch)
tree0061b6d140fd818d82db887dad9c4706d0ee3f51 /gtk/gtknotebook.c
parenta54ca77fb7aa159ec8c1d50db3c5c608fe9c27d3 (diff)
downloadgtk+-a3b3c91001840908891c1954a35c6892ca569e6e.tar.gz
notebook: flip the render order
The render order for tabs is now - left to right until the active tab - right to left until the active tab - active tab This allows themes that use non-straight lines for the tab curvature to draw them not worrying about flipping one side after the active tab.
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 77d44f9cb7..e601bb7205 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -4906,7 +4906,7 @@ gtk_notebook_paint (GtkWidget *widget,
GtkNotebookPrivate *priv;
GtkNotebookPage *page;
GtkAllocation allocation;
- GList *children;
+ GList *children, *other_order;
gboolean showarrow;
gint width, height;
gint x, y;
@@ -5061,8 +5061,13 @@ gtk_notebook_paint (GtkWidget *widget,
while (children)
{
page = children->data;
+
+ if (page == priv->cur_page)
+ break;
+
children = gtk_notebook_search_page (notebook, children,
step, TRUE);
+
if (!gtk_widget_get_visible (page->child) ||
!gtk_widget_get_mapped (page->tab_label))
continue;
@@ -5071,6 +5076,37 @@ gtk_notebook_paint (GtkWidget *widget,
gtk_notebook_draw_tab (notebook, page, cr, tab_flags);
}
+ if (children != NULL)
+ {
+ other_order = NULL;
+
+ while (children)
+ {
+ page = children->data;
+ children = gtk_notebook_search_page (notebook, children,
+ step, TRUE);
+ if (!gtk_widget_get_visible (page->child) ||
+ !gtk_widget_get_mapped (page->tab_label))
+ continue;
+
+ if (children != NULL)
+ other_order = g_list_prepend (other_order, children->data);
+ }
+
+ /* draw them with the opposite order */
+ children = other_order;
+
+ while (children)
+ {
+ page = children->data;
+
+ tab_flags = _gtk_notebook_get_tab_flags (notebook, page);
+ gtk_notebook_draw_tab (notebook, page, cr, tab_flags);
+
+ children = children->next;
+ }
+ }
+
if (showarrow && priv->scrollable)
{
if (priv->has_before_previous)