From db866825a64c64a19a1c0976f6196d279420532c Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Sun, 1 Apr 2007 18:51:22 +0000 Subject: [PATCH] Fix bottom-oriented notebook tabs on Win32. #399253 svn path=/branches/gtk-2-10/; revision=17576 --- ChangeLog | 7 +++++++ modules/engines/ms-windows/msw_style.c | 29 ++++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d77283ca4c..d3933280db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-04-01 Cody Russell + + Merge from trunk: + + * modules/engines/ms-windows/msw_style.c: Fix rendering of + notebook tabs when they are bottom-oriented. Fixes #399253. + 2007-03-28 Matthias Clasen Merge from trunk: diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c index dcb34fd880..3264918f46 100755 --- a/modules/engines/ms-windows/msw_style.c +++ b/modules/engines/ms-windows/msw_style.c @@ -2466,18 +2466,12 @@ draw_extension (GtkStyle * style, } else if (real_gap_side == GTK_POS_BOTTOM) { - x2 = x; - y2 = y + (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder); + x2 = 0; + y2 = 0; w2 = width; h2 = height - (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder * 2); - target = window; - - /* If we are currently drawing the right-most tab (any state)... */ - if (widget->allocation.x + widget->allocation.width - border_width == x + width) - { - x2--; - w2--; - } + pixmap = gdk_pixmap_new (window, w2, h2, -1); + target = pixmap; } if (xp_theme_draw (target, tab_part, style, x2, y2, w2, h2, state_type, NULL /*area*/)) @@ -2526,10 +2520,23 @@ draw_extension (GtkStyle * style, h2--; } } + else if (real_gap_side == GTK_POS_BOTTOM) + { + x2 = x; + y2 = y + (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder); + w2 = width; + h2 = height - (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder * 2); + /* If we are currently drawing the right-most tab (any state)... */ + if (widget->allocation.x + widget->allocation.width - border_width == x + width) + { + x2--; + w2--; + } + } gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, x2, y2, w2, h2, GDK_RGB_DITHER_NONE, 0, 0); - if (real_gap_side == GTK_POS_LEFT || real_gap_side == GTK_POS_RIGHT) + if (real_gap_side == GTK_POS_LEFT || real_gap_side == GTK_POS_RIGHT || real_gap_side == GTK_POS_BOTTOM) { g_object_unref (pixmap); }