Zhiyi Zhang : comctl32/button: Correctly align parts in group boxes with BS_PUSHLIKE when theming is off.
Alexandre Julliard
julliard at winehq.org
Thu Nov 11 16:01:28 CST 2021
Module: wine
Branch: master
Commit: 9e9448e72b132e97b74b3f8b603c7a83682eced6
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9e9448e72b132e97b74b3f8b603c7a83682eced6
Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date: Thu Nov 11 15:04:06 2021 +0800
comctl32/button: Correctly align parts in group boxes with BS_PUSHLIKE when theming is off.
Parts in group boxes with BS_PUSHLIKE can be at the bottom, center and top when theming is off.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/comctl32/button.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index af2fefabe2b..74de83b461a 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -1589,6 +1589,11 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la
split_style = infoPtr->imagelist.himl ? BUTTON_ILStoBS(infoPtr->imagelist.uAlign) : style;
dtStyle = BUTTON_BStoDT(style, ex_style);
+ /* Group boxes are top aligned unless BS_PUSHLIKE is set and it's not themed */
+ if (get_button_type(style) == BS_GROUPBOX
+ && (!(style & BS_PUSHLIKE) || GetWindowTheme(infoPtr->hwnd)))
+ style &= ~BS_VCENTER | BS_TOP;
+
SetRect(&imageRect, 0, 0, imageSize.cx, imageSize.cy);
imageRectWithMargin = imageRect;
if (infoPtr->imagelist.himl)
@@ -1670,11 +1675,7 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la
/* Show text only */
else
{
- if (get_button_type(style) != BS_GROUPBOX)
- BUTTON_PositionRect(style, labelRc, &textRect, textMargin);
- else
- /* GroupBox is always top aligned */
- BUTTON_PositionRect((style & ~BS_VCENTER) | BS_TOP, labelRc, &textRect, textMargin);
+ BUTTON_PositionRect(style, labelRc, &textRect, textMargin);
labelRect = textRect;
SetRectEmpty(&imageRect);
}
More information about the wine-cvs
mailing list