uxtheme-GTK_Theming: Correctly render checkboxes with GTK >= 3.14.0.

This commit is contained in:
Sebastian Lackner 2015-08-09 21:11:23 +02:00
parent f0c259b5e3
commit dff451a72c
2 changed files with 59 additions and 0 deletions

View File

@ -4800,10 +4800,12 @@ if test "$enable_uxtheme_GTK_Theming" -eq 1; then
patch_apply uxtheme-GTK_Theming/0001-uxthemegtk-Add-configure-check-and-stub-dll.patch
patch_apply uxtheme-GTK_Theming/0002-uxthemegtk-Initial-implementation.patch
patch_apply uxtheme-GTK_Theming/0003-uxthemegtk-Implement-enumeration-of-themes-color-and.patch
patch_apply uxtheme-GTK_Theming/0004-uxthemegtk-Correctly-render-buttons-with-GTK-3.14.0.patch
(
echo '+ { "Michael Müller", "uxthemegtk: Add configure check and stub dll.", 1 },';
echo '+ { "Ivan Akulinchev", "uxthemegtk: Initial implementation.", 1 },';
echo '+ { "Michael Müller", "uxthemegtk: Implement enumeration of themes, color and sizes.", 1 },';
echo '+ { "Sebastian Lackner", "uxthemegtk: Correctly render buttons with GTK >= 3.14.0.", 1 },';
) >> "$patchlist"
fi

View File

@ -0,0 +1,57 @@
From 00a03dba614dc158902fb9264e99f2f0cd3fd0ae Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 9 Aug 2015 21:09:50 +0200
Subject: uxthemegtk: Correctly render buttons with GTK >= 3.14.0.
---
dlls/uxtheme-gtk/button.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/uxtheme-gtk/button.c b/dlls/uxtheme-gtk/button.c
index b4b2d02..f3918b1 100644
--- a/dlls/uxtheme-gtk/button.c
+++ b/dlls/uxtheme-gtk/button.c
@@ -29,6 +29,10 @@
#include "wine/debug.h"
+#if !GTK_CHECK_VERSION(3, 14, 0)
+# define GTK_STATE_FLAG_CHECKED 0
+#endif
+
WINE_DEFAULT_DEBUG_CHANNEL(uxthemegtk);
typedef struct _button_theme
@@ -219,16 +223,16 @@ static GtkStateFlags get_checkbox_state_flags(int state_id)
return GTK_STATE_FLAG_INSENSITIVE;
case CBS_CHECKEDNORMAL:
- return GTK_STATE_FLAG_NORMAL | GTK_STATE_FLAG_ACTIVE;
+ return GTK_STATE_FLAG_NORMAL | GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_CHECKED;
case CBS_CHECKEDHOT:
- return GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE;
+ return GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_CHECKED;
case CBS_CHECKEDPRESSED:
- return GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_ACTIVE;
+ return GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_CHECKED;
case CBS_CHECKEDDISABLED:
- return GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_ACTIVE;
+ return GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_CHECKED;
case CBS_MIXEDNORMAL:
return GTK_STATE_FLAG_NORMAL | GTK_STATE_FLAG_INCONSISTENT;
@@ -237,7 +241,7 @@ static GtkStateFlags get_checkbox_state_flags(int state_id)
return GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_INCONSISTENT;
case CBS_MIXEDPRESSED:
- return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_INCONSISTENT;
+ return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_CHECKED | GTK_STATE_FLAG_INCONSISTENT;
case CBS_MIXEDDISABLED:
return GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_INCONSISTENT;
--
2.5.0