comctl32/button: Support BS_PUSHLIKE for themed group boxes.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-11-11 15:04:19 +08:00 committed by Alexandre Julliard
parent 9e9448e72b
commit 3a2d2adc4e
1 changed files with 6 additions and 4 deletions

View File

@ -448,7 +448,7 @@ static int get_draw_state(const BUTTON_INFO *infoPtr)
return style & BS_PUSHLIKE ? pushlike_rb_states[check_state][state] return style & BS_PUSHLIKE ? pushlike_rb_states[check_state][state]
: rb_states[check_state][state]; : rb_states[check_state][state];
case BS_GROUPBOX: case BS_GROUPBOX:
return gb_states[state]; return style & BS_PUSHLIKE ? pb_states[state] : gb_states[state];
default: default:
WARN("Unsupported button type 0x%08x\n", type); WARN("Unsupported button type 0x%08x\n", type);
return PBS_NORMAL; return PBS_NORMAL;
@ -2883,6 +2883,7 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
HFONT font, hPrevFont = NULL; HFONT font, hPrevFont = NULL;
BOOL created_font = FALSE; BOOL created_font = FALSE;
TEXTMETRICW textMetric; TEXTMETRICW textMetric;
int part;
HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf); HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
@ -2914,9 +2915,10 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
ExtSelectClipRgn(hDC, textRegion, RGN_DIFF); ExtSelectClipRgn(hDC, textRegion, RGN_DIFF);
} }
if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state)) part = GetWindowLongW(infoPtr->hwnd, GWL_STYLE) & BS_PUSHLIKE ? BP_PUSHBUTTON : BP_GROUPBOX;
if (IsThemeBackgroundPartiallyTransparent(theme, part, state))
DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL); DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL);
DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL); DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL);
if (dtFlags != (UINT)-1) if (dtFlags != (UINT)-1)
{ {
@ -2928,7 +2930,7 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
SelectClipRgn(hDC, textRegion); SelectClipRgn(hDC, textRegion);
DeleteObject(textRegion); DeleteObject(textRegion);
} }
BUTTON_DrawThemedLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect, theme, BP_GROUPBOX, state); BUTTON_DrawThemedLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect, theme, part, state);
} }
SelectClipRgn(hDC, region); SelectClipRgn(hDC, region);