[gtk+/gtk-2-24-win32] win32: correctly handle difference between tab_pos and gap_side when drawing an extension (notebook



commit 97a0234370910ef35c76adacbff68e48097e1ad5
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Thu Oct 20 17:09:31 2011 +0200

    win32: correctly handle difference between tab_pos and gap_side when drawing an extension (notebook tab)

 modules/engines/ms-windows/msw_style.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c
index 20c6d29..829b6ae 100755
--- a/modules/engines/ms-windows/msw_style.c
+++ b/modules/engines/ms-windows/msw_style.c
@@ -2644,21 +2644,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, window, state_type,
-				   GTK_NOTEBOOK (widget), x, y,
-				   width, height, real_gap_side))
+				   notebook, x, y,
+				   width, height, tab_pos))
 	{
 	  if (!draw_tab_button (style, window, state_type,
 				shadow_type, area, 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, window, state_type,
 					    shadow_type, area, widget, detail,
 					    x, y, width, height,
-					    real_gap_side);
+					    gap_side);
 	    }
 	}
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]