[gtk+/gtk-2-24] win32: don't rely on GTK_IS_H* or GTK_IS_V_* macros
- From: Dieter Verfaillie <dieterv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] win32: don't rely on GTK_IS_H* or GTK_IS_V_* macros
- Date: Wed, 7 Dec 2011 19:05:31 +0000 (UTC)
commit 81955757bc2a5e23ffdc793d9f343f7302fd38de
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date: Wed Dec 7 13:05:09 2011 +0100
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 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c
index afd1a40..84e253b 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]