[USER32][UXTHEME] Properly paint the general menubar when application is themed. Brought to you by Stefano Toncich aka Tonix. CORE-9585

svn path=/trunk/; revision=68116
This commit is contained in:
Amine Khaldi 2015-06-13 11:00:24 +00:00
parent be9ea7e123
commit fcbc8f277a
2 changed files with 28 additions and 5 deletions

View file

@ -513,11 +513,7 @@ ThemeDrawMenuItem(PDRAW_CONTEXT pcontext, HMENU Menu, int imenu)
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));

View file

@ -1212,14 +1212,41 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
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);
}