]> Pileus Git - ~andy/gtk/commitdiff
win32: correctly handle difference between tab_pos and gap_side when drawing an exten...
authorDieter Verfaillie <dieterv@optionexplicit.be>
Thu, 20 Oct 2011 15:09:31 +0000 (17:09 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 10 Nov 2011 16:40:57 +0000 (17:40 +0100)
modules/engines/ms-windows/msw_style.c

index c9333c76f51ad02dd2e21f9410e73857ec82218a..85d59abd38a6ffc274106213f386ea359c8f7e3c 100755 (executable)
@@ -2569,21 +2569,25 @@ draw_extension (GtkStyle *style,
     {
       GtkNotebook *notebook = GTK_NOTEBOOK (widget);
 
-      /* Why this differs from gap_side, I have no idea.. */
-      int real_gap_side = gtk_notebook_get_tab_pos (notebook);
+      /* draw_themed_tab_button and draw_tab_button expect to work with tab
+       * position, instead of simply taking the "side of the gap" (gap_side)
+       * which simply said is the side of the tab that touches the notebook
+       * frame and is always the exact opposite of the gap side... */
+      int tab_pos = gtk_notebook_get_tab_pos (notebook);
 
       if (!draw_themed_tab_button (style, cr, state_type,
-                                  GTK_NOTEBOOK (widget), x, y,
-                                  width, height, real_gap_side))
+                                  notebook, x, y,
+                                  width, height, tab_pos))
        {
          if (!draw_tab_button (style, cr, state_type,
                                shadow_type, widget,
-                               detail, x, y, width, height, real_gap_side))
+                               detail, x, y, width, height, tab_pos))
            {
+             /* GtkStyle expects the usual gap_side */
              parent_class->draw_extension (style, cr, state_type,
                                            shadow_type, widget, detail,
                                            x, y, width, height,
-                                           real_gap_side);
+                                           gap_side);
            }
        }
     }