diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2006-11-07 16:54:34 +0000 |
---|---|---|
committer | Carlos Garnacho <carlosg@src.gnome.org> | 2006-11-07 16:54:34 +0000 |
commit | d03d8e9e4097d6161debe290f8803d65afd27542 (patch) | |
tree | 9d8e985e7374160dc264a51c902ba28d11f3fe1b /gtk | |
parent | f3a47fc8353fa0d7d1a2856a71fef032b9e614d7 (diff) | |
download | gtk+-d03d8e9e4097d6161debe290f8803d65afd27542.tar.gz |
make non-focused tabs xthickness/ythickness thinner. (#353962)
2006-11-07 Carlos Garnacho <carlosg@gnome.org>
* gtk/gtknotebook.c (gtk_notebook_calculate_tabs_allocation): make
non-focused tabs xthickness/ythickness thinner. (#353962)
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtknotebook.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 240d4bb8f3..cd52f6fb28 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -5028,6 +5028,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook, gboolean allocate_at_bottom; gint tab_overlap, tab_pos, tab_extra_space; gint left_x, right_x, top_y, bottom_y, anchor; + gint xthickness, ythickness; gboolean gap_left, packing_changed; GtkAllocation child_allocation = { 0, }; gboolean allocation_changed = FALSE; @@ -5043,6 +5044,9 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook, child_allocation.x = widget->allocation.x + container->border_width; child_allocation.y = widget->allocation.y + container->border_width; + xthickness = widget->style->xthickness; + ythickness = widget->style->ythickness; + switch (tab_pos) { case GTK_POS_BOTTOM: @@ -5222,14 +5226,34 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook, page->allocation = child_allocation; - if (page == notebook->cur_page && - (priv->operation == DRAG_OPERATION_REORDER || - priv->operation == DRAG_OPERATION_DETACH)) + if (page == notebook->cur_page) { - /* needs to be allocated at 0,0 - * to be shown in the drag window */ - page->allocation.x = 0; - page->allocation.y = 0; + if (priv->operation == DRAG_OPERATION_REORDER || + priv->operation == DRAG_OPERATION_DETACH) + { + /* needs to be allocated at 0,0 + * to be shown in the drag window */ + page->allocation.x = 0; + page->allocation.y = 0; + } + } + else + { + switch (tab_pos) + { + case GTK_POS_TOP: + page->allocation.y += ythickness; + /* fall through */ + case GTK_POS_BOTTOM: + page->allocation.height = MAX (1, page->allocation.height - ythickness); + break; + case GTK_POS_LEFT: + page->allocation.x += xthickness; + /* fall through */ + case GTK_POS_RIGHT: + page->allocation.width = MAX (1, page->allocation.width - xthickness); + break; + } } /* calculate whether to leave a gap based on reorder operation or not */ |