Module: wine Branch: master Commit: 790d13ee980eb083e108fb74d61eca13f5012340 URL: https://source.winehq.org/git/wine.git/?a=commit;h=790d13ee980eb083e108fb74d...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Wed Sep 5 22:58:05 2018 +0800
comctl32/button: Avoid push button content covering frames.
A focus frame may be 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@codeweavers.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/comctl32/button.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 653586a..2fa18f4 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)