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.
This commit is contained in:
Dieter Verfaillie 2011-12-07 13:05:09 +01:00
parent 60d471b2d0
commit 81955757bc

View File

@ -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