Author: gadamopoulos
Date: Sat Jul 29 09:25:15 2017
New Revision: 75438
URL:
http://svn.reactos.org/svn/reactos?rev=75438&view=rev
Log:
[UXHTEME] - ThemeDrawCaptionText: Get the TMT_CONTENTALIGNMENT theme property and position
the text accordingly. Patch by Stas'M. CORE-13600
Modified:
trunk/reactos/dll/win32/uxtheme/nonclient.c
Modified: trunk/reactos/dll/win32/uxtheme/nonclient.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/nonclien…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/nonclient.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/nonclient.c [iso-8859-1] Sat Jul 29 09:25:15 2017
@@ -108,6 +108,8 @@
LOGFONTW logfont;
COLORREF textColor;
COLORREF oldTextColor;
+ int align = CA_LEFT;
+ int drawStyles = DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS;
WCHAR buffer[50];
WCHAR *pszText = buffer;
@@ -140,6 +142,12 @@
else
textColor = GetSysColor(COLOR_CAPTIONTEXT);
+ GetThemeEnumValue(pcontext->theme, iPartId, iStateId, TMT_CONTENTALIGNMENT,
&align);
+ if (align == CA_CENTER)
+ drawStyles |= DT_CENTER;
+ else if (align == CA_RIGHT)
+ drawStyles |= DT_RIGHT;
+
oldTextColor = SetTextColor(pcontext->hDC, textColor);
DrawThemeText(pcontext->theme,
pcontext->hDC,
@@ -147,7 +155,7 @@
iStateId,
pszText,
len - 1,
- DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS,
+ drawStyles,
0,
pRect);
SetTextColor(pcontext->hDC, oldTextColor);