From 0cbfa9be51eafc985678bf2d67c34fb906282e05 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 10 Feb 2022 14:57:36 +0800 Subject: [PATCH] comctl32/button: Use pressed state when a pushlike checkbox or radio button is checked and hovered. On XP, when a pushlike checkbox or radio button is checked and hovered, PBS_HOT is used. In later versions of Windows, PBS_PRESSED is used. This patch changes pushlike checkboxes and radio buttons to use the new behavior because it seems more intuitive. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52436 Signed-off-by: Zhiyi Zhang Signed-off-by: Alexandre Julliard --- dlls/comctl32/button.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 2ce12252460..ee7c2c288b1 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -396,7 +396,7 @@ static int get_draw_state(const BUTTON_INFO *infoPtr) static const int pushlike_cb_states[3][DRAW_STATE_COUNT] = { { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_NORMAL }, - { PBS_PRESSED, PBS_PRESSED, PBS_HOT, PBS_PRESSED, PBS_PRESSED }, + { PBS_PRESSED, PBS_PRESSED, PBS_PRESSED, PBS_PRESSED, PBS_PRESSED }, { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_NORMAL } }; static const int rb_states[2][DRAW_STATE_COUNT] = @@ -407,7 +407,7 @@ static int get_draw_state(const BUTTON_INFO *infoPtr) static const int pushlike_rb_states[2][DRAW_STATE_COUNT] = { { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_NORMAL }, - { PBS_PRESSED, PBS_PRESSED, PBS_HOT, PBS_PRESSED, PBS_PRESSED } + { PBS_PRESSED, PBS_PRESSED, PBS_PRESSED, PBS_PRESSED, PBS_PRESSED } }; static const int gb_states[DRAW_STATE_COUNT] = { GBS_NORMAL, GBS_DISABLED, GBS_NORMAL, GBS_NORMAL, GBS_NORMAL }; LONG style = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);