Rebase against 6bb8ca1e25a9cfc66f396b2ae6bc423a8057929c.

This commit is contained in:
Sebastian Lackner
2017-02-09 15:38:35 +01:00
parent 29d851bf3a
commit 253835e7c3
20 changed files with 294 additions and 552 deletions

View File

@@ -1,40 +0,0 @@
From 3452ba066216b5c7175a66cf612812bab5c81cd8 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sun, 27 Nov 2016 14:01:58 +0800
Subject: user32: BUTTON_CalcLabelRect should use the button font.
Otherwise WM_SETTEXT handler gets wrong rectangle to erase an old text.
---
dlls/user32/button.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index e4074cd..623b425 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -596,15 +596,22 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc)
switch (style & (BS_ICON|BS_BITMAP))
{
case BS_TEXT:
+ {
+ HFONT hFont, hPrevFont = 0;
+
if (!(text = get_button_text( hwnd ))) goto empty_rect;
if (!text[0])
{
HeapFree( GetProcessHeap(), 0, text );
goto empty_rect;
}
+
+ if ((hFont = get_button_font( hwnd ))) hPrevFont = SelectObject( hdc, hFont );
DrawTextW(hdc, text, -1, &r, dtStyle | DT_CALCRECT);
+ if (hPrevFont) SelectObject( hdc, hPrevFont );
HeapFree( GetProcessHeap(), 0, text );
break;
+ }
case BS_ICON:
if (!GetIconInfo((HICON)GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET ), &iconInfo))
--
2.9.0

View File

@@ -1,27 +0,0 @@
From 62276b1f14a98c34737b195705c79f60a2561f59 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sun, 27 Nov 2016 14:07:12 +0800
Subject: user32: Fix groupbox rectangle calculation in the button's WM_SETTEXT
handler.
---
dlls/user32/button.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index 623b425..86b3b1e 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -394,6 +394,9 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
GetClientRect(hWnd, &client);
rc = client;
+ /* FIXME: check other BS_* handlers */
+ if (btn_type == BS_GROUPBOX)
+ InflateRect(&rc, -7, 1); /* GB_Paint does this */
BUTTON_CalcLabelRect(hWnd, hdc, &rc);
/* Clip by client rect bounds */
if (rc.right > client.right) rc.right = client.right;
--
2.9.0

View File

@@ -1 +0,0 @@
Fixes: [41830] Fix groupbox rectangle calculation and font handling