Bug 351678 - Notebooks not with PositionType.Top drawn incorrectly. Patch

2006-12-02  Dom Lachowicz <domlachowicz@gmail.com>

	* src/modules/engines/ms-windows/msw_style.c: Bug 351678 - Notebooks
	not with PositionType.Top drawn incorrectly. Patch by Cody Russell
This commit is contained in:
Dom Lachowicz 2006-12-02 16:34:12 +00:00 committed by Dom Lachowicz
parent cbfd2b96b8
commit a4a874c38a
2 changed files with 80 additions and 27 deletions

View File

@ -1,3 +1,8 @@
2006-12-02 Dom Lachowicz <domlachowicz@gmail.com>
* src/modules/engines/ms-windows/msw_style.c: Bug 351678 - Notebooks
not with PositionType.Top drawn incorrectly. Patch by Cody Russell
2006-11-28 Behdad Esfahbod <behdad@gnome.org> 2006-11-28 Behdad Esfahbod <behdad@gnome.org>
Remove the broken Thai input method and add a functional Thai and Lao Remove the broken Thai input method and add a functional Thai and Lao

View File

@ -2403,19 +2403,67 @@ draw_extension (GtkStyle * style,
if (widget && GTK_IS_NOTEBOOK (widget) && detail && !strcmp (detail, "tab")) if (widget && GTK_IS_NOTEBOOK (widget) && detail && !strcmp (detail, "tab"))
{ {
GtkNotebook *notebook = GTK_NOTEBOOK (widget); GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GdkPixmap *pixmap = NULL;
GdkDrawable *target = NULL;
gint x2, y2, w2, h2; gint x2, y2, w2, h2;
int tab_part = XP_THEME_ELEMENT_TAB_ITEM; int tab_part = XP_THEME_ELEMENT_TAB_ITEM;
int real_gap_side = gtk_notebook_get_tab_pos (notebook); int real_gap_side = gtk_notebook_get_tab_pos (notebook);
/* why this differs from the above gap_side, i have no idea... */ /* why this differs from the above gap_side, i have no idea... */
if (real_gap_side == GTK_POS_LEFT || real_gap_side == GTK_POS_RIGHT)
{
/* Create "rotated" pixmap.. swap width and height */
pixmap = gdk_pixmap_new (window, height, width, -1);
target = pixmap;
x2 = 0;
y2 = 0;
w2 = height;
h2 = width;
}
else
{
target = window;
x2 = x; x2 = x;
y2 = y; y2 = y;
w2 = width; w2 = width;
h2 = height; h2 = height;
}
if (xp_theme_draw (window, tab_part, if (xp_theme_draw (target, tab_part, style, x2, y2, w2, h2, state_type, NULL /*area*/))
style, x2, y2, w2, h2, (real_gap_side == GTK_POS_TOP ? state_type : GTK_STATE_SELECTED), area))
{ {
GdkPixbufRotation rotation = GDK_PIXBUF_ROTATE_NONE;
if (real_gap_side == GTK_POS_BOTTOM)
rotation = GDK_PIXBUF_ROTATE_UPSIDEDOWN;
else if (real_gap_side == GTK_POS_LEFT)
rotation = GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE;
else if (real_gap_side == GTK_POS_RIGHT)
rotation = GDK_PIXBUF_ROTATE_CLOCKWISE;
if (rotation != GDK_PIXBUF_ROTATE_NONE)
{
GdkPixbuf * pixbuf, * rotated;
pixbuf = gdk_pixbuf_get_from_drawable (NULL, target, NULL, x2, y2, 0, 0, w2, h2);
rotated = gdk_pixbuf_rotate_simple (pixbuf, rotation);
g_object_unref (pixbuf);
pixbuf = rotated;
if (real_gap_side == GTK_POS_RIGHT || real_gap_side == GTK_POS_LEFT)
{
x2 = x;
y2 = y;
w2 = width;
h2 = height;
}
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)
{
g_object_unref (pixmap);
}
}
return; return;
} else if (real_gap_side == GTK_POS_TOP || real_gap_side == GTK_POS_BOTTOM) { } else if (real_gap_side == GTK_POS_TOP || real_gap_side == GTK_POS_BOTTOM) {
/* experimental tab-drawing code from mozilla */ /* experimental tab-drawing code from mozilla */