]> Pileus Git - ~andy/gtk/blobdiff - modules/engines/ms-windows/msw_style.c
win32: Fall back to raleigh with the classic theme
[~andy/gtk] / modules / engines / ms-windows / msw_style.c
index aabcb0d0d96d8373732ef15a5ecfba19f5bba77e..f8a95227bc0fe5cea7bec0fedfc9f933faaada2c 100755 (executable)
@@ -16,9 +16,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
 
 #include "gtk/gtk.h"
 #include "gtk/gtk.h"
+#ifndef GTK_COMPILATION
+#define GTK_COMPILATION
+#endif
+#include "gtk/gtkmenushellprivate.h"
 
 #ifdef BUILDING_STANDALONE
 #include "gdk/gdkwin32.h"
@@ -660,8 +662,9 @@ setup_msw_rc_style (void)
              btn_face.red, btn_face.green, btn_face.blue);
   gtk_rc_parse_string (buf);
 
-  /* enable coloring for text on buttons TODO: use GetThemeMetric for the
-     border and outside border */
+  /* enable coloring for text on buttons
+   * TODO: use GetThemeMetric for the border and outside border
+   * TODO: child-displacement-x & y should be 0 when XP theme is active */
   g_snprintf (buf, sizeof (buf),
              "style \"msw-button\" = \"msw-default\"\n"
              "{\n"
@@ -849,7 +852,7 @@ setup_system_styles (GtkStyle *style)
   sys_color_to_gtk_color (XP_THEME_CLASS_TEXT, COLOR_GRAYTEXT,
                          &style->fg[GTK_STATE_INSENSITIVE]);
   sys_color_to_gtk_color (XP_THEME_CLASS_BUTTON, COLOR_BTNTEXT,
-                         &style->bg[GTK_STATE_ACTIVE]);
+                          &style->fg[GTK_STATE_ACTIVE]);
   sys_color_to_gtk_color (XP_THEME_CLASS_WINDOW, COLOR_WINDOWTEXT,
                          &style->fg[GTK_STATE_PRELIGHT]);
 
@@ -1337,9 +1340,9 @@ draw_arrow (GtkStyle *style,
       reverse_engineer_stepper_box (widget, arrow_type,
                                    &box_x, &box_y, &box_width, &box_height);
 
-      if (gtk_range_get_adjustment(&scrollbar->range)->page_size >=
-          (gtk_range_get_adjustment(&scrollbar->range)->upper -
-           gtk_range_get_adjustment(&scrollbar->range)->lower))
+      if (gtk_adjustment_get_page_size(gtk_range_get_adjustment(&scrollbar->range)) >=
+          (gtk_adjustment_get_upper(gtk_range_get_adjustment(&scrollbar->range)) -
+           gtk_adjustment_get_lower(gtk_range_get_adjustment(&scrollbar->range))))
        {
          is_disabled = TRUE;
        }
@@ -1577,7 +1580,7 @@ draw_menu_item (cairo_t *cr, GtkWidget *widget, GtkStyle *style,
 
       if (state_type == GTK_STATE_PRELIGHT)
        {
-         draw_3d_border (dc, &rect, bar->active);
+        draw_3d_border (dc, &rect, bar->priv->active);
        }
 
       release_window_dc (&dc_info);
@@ -1881,9 +1884,9 @@ draw_box (GtkStyle *style,
            }
          else
            {
-              if (gtk_range_get_adjustment(&scrollbar->range)->page_size >=
-                 (gtk_range_get_adjustment(&scrollbar->range)->upper -
-                  gtk_range_get_adjustment(&scrollbar->range)->lower))
+              if (gtk_adjustment_get_page_size(gtk_range_get_adjustment(&scrollbar->range)) >=
+                 (gtk_adjustment_get_page_size(gtk_range_get_adjustment(&scrollbar->range)) -
+                  gtk_adjustment_get_page_size(gtk_range_get_adjustment(&scrollbar->range))))
                {
                  return;
                }
@@ -2564,21 +2567,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);
            }
        }
     }