mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 09:50:07 +00:00
[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:
parent
be9ea7e123
commit
fcbc8f277a
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue