From 81955757bc2a5e23ffdc793d9f343f7302fd38de Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 7 Dec 2011 13:05:09 +0100 Subject: [PATCH] win32: don't rely on GTK_IS_H* or GTK_IS_V_* macros But use the orientable interface instead. This has already proven usefull for GtkVolumeButton widgets (see previous commit) so apply the same logic all over the place. --- modules/engines/ms-windows/msw_style.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c index afd1a40328..84e253bba5 100755 --- a/modules/engines/ms-windows/msw_style.c +++ b/modules/engines/ms-windows/msw_style.c @@ -1917,16 +1917,24 @@ draw_box (GtkStyle *style, if (GTK_IS_SCROLLBAR (widget)) { GtkScrollbar *scrollbar = GTK_SCROLLBAR (widget); - gboolean is_v = GTK_IS_VSCROLLBAR (widget); + GtkOrientation orientation; + gboolean is_vertical; + + orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)); + + if (orientation == GTK_ORIENTATION_VERTICAL) + is_vertical = TRUE; + else + is_vertical = FALSE; if (xp_theme_draw (window, - is_v + is_vertical ? XP_THEME_ELEMENT_SCROLLBAR_V : XP_THEME_ELEMENT_SCROLLBAR_H, style, x, y, width, height, state_type, area)) { XpThemeElement gripper = - (is_v ? XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V : + (is_vertical ? XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V : XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H); /* Do not display grippers on tiny scroll bars, @@ -2003,7 +2011,15 @@ draw_box (GtkStyle *style, } else if (widget && GTK_IS_SCROLLBAR (widget)) { - gboolean is_vertical = GTK_IS_VSCROLLBAR (widget); + GtkOrientation orientation; + gboolean is_vertical; + + orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)); + + if (orientation == GTK_ORIENTATION_VERTICAL) + is_vertical = TRUE; + else + is_vertical = FALSE; if (xp_theme_draw (window, is_vertical