Author: akhaldi Date: Sat Jun 13 11:00:24 2015 New Revision: 68116
URL: http://svn.reactos.org/svn/reactos?rev=68116&view=rev Log: [USER32][UXTHEME] Properly paint the general menubar when application is themed. Brought to you by Stefano Toncich aka Tonix. CORE-9585
Modified: trunk/reactos/dll/win32/uxtheme/nonclient.c trunk/reactos/win32ss/user/user32/windows/font.c
Modified: trunk/reactos/dll/win32/uxtheme/nonclient.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/nonclient... ============================================================================== --- trunk/reactos/dll/win32/uxtheme/nonclient.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/uxtheme/nonclient.c [iso-8859-1] Sat Jun 13 11:00:24 2015 @@ -513,11 +513,7 @@
GetMenuItemRect(pcontext->hWnd, Menu, imenu, &Rect);
-#ifdef __REACTOS__ - OffsetRect(&Rect, -pcontext->wi.rcClient.left, -pcontext->wi.rcClient.top); -#else OffsetRect(&Rect, -pcontext->wi.rcWindow.left, -pcontext->wi.rcWindow.top); -#endif
SetBkColor(pcontext->hDC, GetSysColor(flat_menu ? COLOR_MENUBAR : COLOR_MENU)); SetTextColor(pcontext->hDC, GetSysColor(Item.fState & MF_GRAYED ? COLOR_GRAYTEXT : COLOR_MENUTEXT));
Modified: trunk/reactos/win32ss/user/user32/windows/font.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/windows... ============================================================================== --- trunk/reactos/win32ss/user/user32/windows/font.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/font.c [iso-8859-1] Sat Jun 13 11:00:24 2015 @@ -1212,14 +1212,41 @@ last_line = !(flags & DT_NOCLIP) && y + ((flags & DT_EDITCONTROL) ? 2*lh-1 : lh) > rect->bottom; strPtr = TEXT_NextLineW(hdc, strPtr, &count, line, &len, width, flags, &size, last_line, &p_retstr, tabwidth, &prefix_offset, &ellip);
+#ifdef __REACTOS__ + if (flags & DT_CENTER) + { + if (((rect->right - rect->left) < size.cx) && (flags & DT_CALCRECT)) + { + x = rect->left + size.cx; + } + else + { + x = (rect->left + rect->right - size.cx) / 2; + } + } +#else if (flags & DT_CENTER) x = (rect->left + rect->right - size.cx) / 2; +#endif else if (flags & DT_RIGHT) x = rect->right - size.cx;
if (flags & DT_SINGLELINE) { if (flags & DT_VCENTER) - y = rect->top + (rect->bottom - rect->top) / 2 + (invert_y ? (size.cy / 2) : (-size.cy / 2)); +#ifdef __REACTOS__ + { + if (((rect->bottom - rect->top) < (invert_y ? -size.cy : size.cy)) && (flags & DT_CALCRECT)) + { + y = rect->top + (invert_y ? -size.cy : size.cy); + } + else + { +#endif + y = rect->top + (rect->bottom - rect->top) / 2 + (invert_y ? (size.cy / 2) : (-size.cy / 2)); +#ifdef __REACTOS__ + } + } +#endif else if (flags & DT_BOTTOM) y = rect->bottom + (invert_y ? 0 : -size.cy); }