]> Pileus Git - ~andy/gtk/commitdiff
Fixed, very hackishly, a one pixel error that occurs using the XP theme
authorCody Russell <bratsche@gnome.org>
Wed, 27 Jun 2007 20:00:53 +0000 (20:00 +0000)
committerCody Russell <bratsche@src.gnome.org>
Wed, 27 Jun 2007 20:00:53 +0000 (20:00 +0000)
2007-06-27  Cody Russell  <bratsche@gnome.org>

        * modules/engines/ms-windows/msw_style.c (draw_themed_tab_button):
        Fixed, very hackishly, a one pixel error that occurs using the
        XP theme engine only on the left-most tab, if it is active, when
        the notebook is bottom-oriented. (#392283)

svn path=/trunk/; revision=18264

ChangeLog
modules/engines/ms-windows/msw_style.c

index 8be910272c02392b210d7e790334d034fb612ef7..d31f1d93262ca6d152451c0fe75688ff812ba72b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-27  Cody Russell  <bratsche@gnome.org>
+
+       * modules/engines/ms-windows/msw_style.c (draw_themed_tab_button):
+       Fixed, very hackishly, a one pixel error that occurs using the
+       XP theme engine only on the left-most tab, if it is active, when
+       the notebook is bottom-oriented. (#392283)
+
 2007-06-27  Johan Dahlin  <jdahlin@async.com.br>
 
        * tests/buildertest.c: (test_value_from_string): 
index b2d92b67a0944587fe2923332bef5f1a171d28bc..87ac6a41276042c77b45c3f5ae8f2433f662872f 100755 (executable)
@@ -2552,6 +2552,25 @@ draw_themed_tab_button (GtkStyle *style,
       g_object_unref (pixbuf);
       pixbuf = rotated;
 
+      // XXX - This is really hacky and evil.  When we're drawing the left-most tab
+      //       while it is active on a bottom-oriented notebook, there is one white
+      //       pixel at the top.  There may be a better solution than this if someone
+      //       has time to discover it.
+      if (gap_side == GTK_POS_BOTTOM && state_type == GTK_STATE_NORMAL && x == widget->allocation.x)
+       {
+         int rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+         int n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+         int psub = 0;
+
+         guchar *pixels = gdk_pixbuf_get_pixels (pixbuf);
+         guchar *p = pixels + rowstride;
+
+         for (psub = 0; psub < n_channels; psub++)
+           {
+             pixels[psub] = p[psub];
+           }
+       }
+
       gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, clip_rect.x, clip_rect.y,
                        clip_rect.width, clip_rect.height, GDK_RGB_DITHER_NONE, 0, 0);
       g_object_unref (pixbuf);