mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[UXTHEME] DrawNCPreview: Use DrawThemeTextEx() for drawing "Window Text"
Addendum to118869f69
andd4dc0cb54
. CORE-5991
This commit is contained in:
parent
d4dc0cb545
commit
c4f42b5a65
1 changed files with 8 additions and 3 deletions
|
@ -1286,10 +1286,16 @@ HRESULT WINAPI DrawNCPreview(HDC hDC,
|
||||||
if (textFont)
|
if (textFont)
|
||||||
SelectFont(hDC, textFont);
|
SelectFont(hDC, textFont);
|
||||||
|
|
||||||
SetTextColor(hDC, GetThemeSysColor(context.theme, TMT_WINDOWTEXT));
|
HTHEME hBtnTheme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"BUTTON", OTD_NONCLIENT);
|
||||||
len = LoadStringW(hDllInst, IDS_WINTEXT, (LPWSTR)&szText, 0);
|
len = LoadStringW(hDllInst, IDS_WINTEXT, (LPWSTR)&szText, 0);
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
DrawThemeText(context.theme, hDC, WP_DIALOG, 0, szText, len, DT_LEFT | DT_TOP | textDrawFlags, 0, &rcWindowClient);
|
{
|
||||||
|
DTTOPTS dttOpts = { sizeof(dttOpts) };
|
||||||
|
dttOpts.dwFlags = DTT_TEXTCOLOR;
|
||||||
|
dttOpts.crText = GetThemeSysColor(context.theme, COLOR_WINDOWTEXT);
|
||||||
|
|
||||||
|
DrawThemeTextEx(hBtnTheme, hDC, BP_PUSHBUTTON, PBS_DEFAULTED, szText, len, DT_LEFT | DT_TOP | textDrawFlags, &rcWindowClient, &dttOpts);
|
||||||
|
}
|
||||||
|
|
||||||
/* Draw preview dialog window */
|
/* Draw preview dialog window */
|
||||||
SetWindowResourceText(hwndDummy, IDS_MESSAGEBOX);
|
SetWindowResourceText(hwndDummy, IDS_MESSAGEBOX);
|
||||||
|
@ -1307,7 +1313,6 @@ HRESULT WINAPI DrawNCPreview(HDC hDC,
|
||||||
DrawWindowForNCPreview(hDC, &context, msgBoxHCenter - NC_PREVIEW_MSGBOX_HALF_WIDTH, msgBoxVCenter + NC_PREVIEW_MSGBOX_OFFSET_X, msgBoxHCenter + NC_PREVIEW_MSGBOX_HALF_WIDTH, msgBoxVCenter + NC_PREVIEW_MSGBOX_OFFSET_Y, COLOR_BTNFACE, &rcWindowClient);
|
DrawWindowForNCPreview(hDC, &context, msgBoxHCenter - NC_PREVIEW_MSGBOX_HALF_WIDTH, msgBoxVCenter + NC_PREVIEW_MSGBOX_OFFSET_X, msgBoxHCenter + NC_PREVIEW_MSGBOX_HALF_WIDTH, msgBoxVCenter + NC_PREVIEW_MSGBOX_OFFSET_Y, COLOR_BTNFACE, &rcWindowClient);
|
||||||
|
|
||||||
/* Draw preview dialog button */
|
/* Draw preview dialog button */
|
||||||
HTHEME hBtnTheme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"BUTTON", OTD_NONCLIENT);
|
|
||||||
if (hBtnTheme)
|
if (hBtnTheme)
|
||||||
{
|
{
|
||||||
INT btnCenterH = rcWindowClient.left + ((rcWindowClient.right - rcWindowClient.left) / 2);
|
INT btnCenterH = rcWindowClient.left + ((rcWindowClient.right - rcWindowClient.left) / 2);
|
||||||
|
|
Loading…
Reference in a new issue