Only draw a themed border when edit control has WS_EX_CLIENTEDGE
style.
This commit is contained in:
parent
23f192d299
commit
2f47050c32
|
@ -35,12 +35,14 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(themingedit);
|
||||
|
||||
/* Draw themed border */
|
||||
static void nc_paint (HWND hwnd, HRGN region)
|
||||
static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme (hwnd);
|
||||
HRGN cliprgn = region;
|
||||
DWORD exStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
|
||||
if (exStyle & WS_EX_CLIENTEDGE)
|
||||
{
|
||||
HDC dc;
|
||||
RECT r;
|
||||
HRGN cliprgn;
|
||||
int cxEdge = GetSystemMetrics (SM_CXEDGE),
|
||||
cyEdge = GetSystemMetrics (SM_CYEDGE);
|
||||
int part = EP_EDITTEXT;
|
||||
|
@ -56,6 +58,7 @@ static void nc_paint (HWND hwnd, HRGN region)
|
|||
|
||||
GetWindowRect(hwnd, &r);
|
||||
|
||||
/* New clipping region passed to default proc to exclude border */
|
||||
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
|
||||
r.right - cxEdge, r.bottom - cyEdge);
|
||||
if (region != (HRGN)1)
|
||||
|
@ -69,8 +72,9 @@ static void nc_paint (HWND hwnd, HRGN region)
|
|||
DrawThemeParentBackground(hwnd, dc, &r);
|
||||
DrawThemeBackground (theme, dc, part, state, &r, 0);
|
||||
ReleaseDC(hwnd, dc);
|
||||
}
|
||||
|
||||
/* Call default proc to get the scrollbars etc. painted */
|
||||
/* Call default proc to get the scrollbars etc. also painted */
|
||||
DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
|
||||
}
|
||||
|
||||
|
@ -113,7 +117,7 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg,
|
|||
case WM_NCPAINT:
|
||||
theme = GetWindowTheme( hwnd );
|
||||
if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
|
||||
nc_paint (hwnd, (HRGN)wParam);
|
||||
nc_paint (theme, hwnd, (HRGN)wParam);
|
||||
break;
|
||||
|
||||
case WM_ENABLE:
|
||||
|
|
Loading…
Reference in New Issue