[PATCH 4/7] comctl32/button: Avoid push button content covering frames.
Zhiyi Zhang
zzhang at codeweavers.com
Wed Sep 5 09:58:05 CDT 2018
A focus frame maybe covered by content in the push button.
Shrink the label rectangle before layout calculation so that
content can never cover the frame.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
dlls/comctl32/button.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 653586a748..2fa18f4f47 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -1250,6 +1250,8 @@ static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action )
/* draw button label */
labelRect = rc;
+ /* Shrink label rect at all sides by 2 so that the content won't touch the surrounding frame */
+ InflateRect(&labelRect, -2, -2);
dtFlags = BUTTON_CalcLayoutRects(infoPtr, hDC, &labelRect, &imageRect, &textRect);
if (dtFlags == (UINT)-1L)
--
2.18.0
More information about the wine-devel
mailing list