mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 20:43:18 +00:00
recalculate start menu root position for any call
svn path=/trunk/; revision=10281
This commit is contained in:
parent
ce336586ba
commit
8fb1163c02
1 changed files with 23 additions and 2 deletions
|
@ -1491,17 +1491,27 @@ StartMenuRoot::StartMenuRoot(HWND hwnd)
|
|||
}
|
||||
|
||||
|
||||
HWND StartMenuRoot::Create(HWND hwndOwner)
|
||||
static void CalculateStartPos(HWND hwndOwner, RECT& rect)
|
||||
{
|
||||
WindowRect pos(hwndOwner);
|
||||
|
||||
RECT rect = {pos.left, pos.top-STARTMENU_LINE_HEIGHT-4, pos.left+STARTMENU_WIDTH_MIN, pos.top};
|
||||
rect.left = pos.left;
|
||||
rect.top = pos.top-STARTMENU_LINE_HEIGHT-4;
|
||||
rect.right = pos.left+STARTMENU_WIDTH_MIN;
|
||||
rect.bottom = pos.top;
|
||||
|
||||
#ifndef _LIGHT_STARTMENU
|
||||
rect.top += STARTMENU_LINE_HEIGHT;
|
||||
#endif
|
||||
|
||||
AdjustWindowRectEx(&rect, WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_VISIBLE, FALSE, 0);
|
||||
}
|
||||
|
||||
HWND StartMenuRoot::Create(HWND hwndOwner)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
CalculateStartPos(hwndOwner, rect);
|
||||
|
||||
return Window::Create(WINDOW_CREATOR(StartMenuRoot), 0, GetWndClasss(), TITLE_STARTMENU,
|
||||
WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN,
|
||||
|
@ -1518,6 +1528,17 @@ void StartMenuRoot::TrackStartmenu()
|
|||
_selected_id = -1;
|
||||
#endif
|
||||
|
||||
#ifdef _LIGHT_STARTMENU
|
||||
// recalculate start menu root position
|
||||
RECT rect;
|
||||
|
||||
CalculateStartPos(GetParent(hwnd), rect);
|
||||
|
||||
SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0);
|
||||
|
||||
ResizeToButtons();
|
||||
#endif
|
||||
|
||||
// show previously hidden start menu
|
||||
ShowWindow(hwnd, SW_SHOW);
|
||||
SetForegroundWindow(hwnd);
|
||||
|
|
Loading…
Reference in a new issue