https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c4f42b5a65c5489e2b8628ec6e196ea6909c4ea2

commit c4f42b5a65c5489e2b8628ec6e196ea6909c4ea2
Author:     Stanislav Motylkov <x86co...@gmail.com>
AuthorDate: Mon Sep 9 14:16:48 2024 +0300
Commit:     Stanislav Motylkov <x86co...@gmail.com>
CommitDate: Mon Sep 9 15:26:54 2024 +0300

    [UXTHEME] DrawNCPreview: Use DrawThemeTextEx() for drawing "Window Text"
    
    Addendum to 118869f69 and d4dc0cb54. CORE-5991
---
 dll/win32/uxtheme/nonclient.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c
index e78a62ed4ac..89fb621c5a0 100644
--- a/dll/win32/uxtheme/nonclient.c
+++ b/dll/win32/uxtheme/nonclient.c
@@ -1286,10 +1286,16 @@ HRESULT WINAPI DrawNCPreview(HDC hDC,
     if (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);
     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 */
     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);
 
     /* Draw preview dialog button */
-    HTHEME hBtnTheme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"BUTTON", 
OTD_NONCLIENT);
     if (hBtnTheme)
     {
         INT btnCenterH = rcWindowClient.left + ((rcWindowClient.right - 
rcWindowClient.left) / 2);

Reply via email to