mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 07:36:05 +00:00
[RSHELL]
* CMenuDeskBar: Actually use the Popup flags to decide on the relative position of the submenus. CORE-7886 svn path=/branches/shell-experiments/; revision=62296
This commit is contained in:
parent
905ab8ebba
commit
dcbd65feca
2 changed files with 31 additions and 14 deletions
|
@ -727,7 +727,7 @@ HRESULT CMenuToolbarBase::PopupSubMenu(UINT index, IShellMenu* childShellMenu)
|
||||||
ClientToScreen(m_hwnd, &a);
|
ClientToScreen(m_hwnd, &a);
|
||||||
ClientToScreen(m_hwnd, &b);
|
ClientToScreen(m_hwnd, &b);
|
||||||
|
|
||||||
POINTL pt = { b.x, b.y };
|
POINTL pt = { b.x, a.y };
|
||||||
RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar?
|
RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar?
|
||||||
|
|
||||||
|
|
||||||
|
@ -1580,6 +1580,8 @@ HRESULT STDMETHODCALLTYPE CMenuBand::GetBandInfo(
|
||||||
pdbi->dwMask = DBIM_MINSIZE | DBIM_MAXSIZE | DBIM_INTEGRAL | DBIM_ACTUAL | DBIM_TITLE | DBIM_MODEFLAGS | DBIM_BKCOLOR;
|
pdbi->dwMask = DBIM_MINSIZE | DBIM_MAXSIZE | DBIM_INTEGRAL | DBIM_ACTUAL | DBIM_TITLE | DBIM_MODEFLAGS | DBIM_BKCOLOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MIN_WIDTH 220
|
||||||
|
|
||||||
if (pdbi->dwMask & DBIM_MINSIZE)
|
if (pdbi->dwMask & DBIM_MINSIZE)
|
||||||
{
|
{
|
||||||
SIZE sizeStatic = { 0 };
|
SIZE sizeStatic = { 0 };
|
||||||
|
@ -1588,7 +1590,7 @@ HRESULT STDMETHODCALLTYPE CMenuBand::GetBandInfo(
|
||||||
if (hwndStatic) SendMessageW(hwndStatic, TB_GETIDEALSIZE, TRUE, reinterpret_cast<LPARAM>(&sizeStatic));
|
if (hwndStatic) SendMessageW(hwndStatic, TB_GETIDEALSIZE, TRUE, reinterpret_cast<LPARAM>(&sizeStatic));
|
||||||
if (hwndShlFld) SendMessageW(hwndShlFld, TB_GETIDEALSIZE, TRUE, reinterpret_cast<LPARAM>(&sizeShlFld));
|
if (hwndShlFld) SendMessageW(hwndShlFld, TB_GETIDEALSIZE, TRUE, reinterpret_cast<LPARAM>(&sizeShlFld));
|
||||||
|
|
||||||
pdbi->ptMinSize.x = 0;
|
pdbi->ptMinSize.x = MIN_WIDTH;
|
||||||
pdbi->ptMinSize.y = sizeStatic.cy + sizeShlFld.cy;
|
pdbi->ptMinSize.y = sizeStatic.cy + sizeShlFld.cy;
|
||||||
}
|
}
|
||||||
if (pdbi->dwMask & DBIM_MAXSIZE)
|
if (pdbi->dwMask & DBIM_MAXSIZE)
|
||||||
|
@ -1599,10 +1601,7 @@ HRESULT STDMETHODCALLTYPE CMenuBand::GetBandInfo(
|
||||||
if (hwndStatic) SendMessageW(hwndStatic, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&sizeStatic));
|
if (hwndStatic) SendMessageW(hwndStatic, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&sizeStatic));
|
||||||
if (hwndShlFld) SendMessageW(hwndShlFld, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&sizeShlFld));
|
if (hwndShlFld) SendMessageW(hwndShlFld, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&sizeShlFld));
|
||||||
|
|
||||||
sizeStatic.cx += 64;
|
pdbi->ptMaxSize.x = max(MIN_WIDTH, max(sizeStatic.cx, sizeShlFld.cx)); // ignored
|
||||||
sizeShlFld.cx += 64;
|
|
||||||
|
|
||||||
pdbi->ptMaxSize.x = max(sizeStatic.cx, sizeShlFld.cx); // ignored
|
|
||||||
pdbi->ptMaxSize.y = sizeStatic.cy + sizeShlFld.cy;
|
pdbi->ptMaxSize.y = sizeStatic.cy + sizeShlFld.cy;
|
||||||
}
|
}
|
||||||
if (pdbi->dwMask & DBIM_INTEGRAL)
|
if (pdbi->dwMask & DBIM_INTEGRAL)
|
||||||
|
@ -2242,7 +2241,7 @@ HRESULT CMenuBand::_OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pEx
|
||||||
if (popup)
|
if (popup)
|
||||||
{
|
{
|
||||||
IUnknown_SetSite(popup, m_subMenuParent);
|
IUnknown_SetSite(popup, m_subMenuParent);
|
||||||
popup->Popup(pAt, pExclude, MPPF_TOP | MPPF_RIGHT);
|
popup->Popup(pAt, pExclude, MPPF_RIGHT);
|
||||||
}
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,8 +399,6 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup(POINTL *ppt, RECTL *prcExclude, MP
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
::AdjustWindowRect(&rc, ::GetWindowLong(m_hWnd, GWL_STYLE), FALSE);
|
::AdjustWindowRect(&rc, ::GetWindowLong(m_hWnd, GWL_STYLE), FALSE);
|
||||||
rc.right -= rc.left;
|
|
||||||
rc.bottom -= rc.top;
|
|
||||||
|
|
||||||
if (m_Banner != NULL)
|
if (m_Banner != NULL)
|
||||||
{
|
{
|
||||||
|
@ -409,16 +407,36 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup(POINTL *ppt, RECTL *prcExclude, MP
|
||||||
rc.right += bm.bmWidth;
|
rc.right += bm.bmWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = ppt->x;
|
int x, y, cx, cy;
|
||||||
int y = ppt->y - rc.bottom;
|
|
||||||
int cx = rc.right;
|
|
||||||
int cy = rc.bottom;
|
|
||||||
|
|
||||||
RECT rcWorkArea;
|
RECT rcWorkArea;
|
||||||
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0);
|
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0);
|
||||||
|
|
||||||
int waHeight = rcWorkArea.bottom - rcWorkArea.top;
|
int waHeight = rcWorkArea.bottom - rcWorkArea.top;
|
||||||
|
|
||||||
|
switch (dwFlags & MPPF_POS_MASK)
|
||||||
|
{
|
||||||
|
case MPPF_LEFT:
|
||||||
|
case MPPF_TOP:
|
||||||
|
x = ppt->x - rc.right;
|
||||||
|
cx = rc.right - rc.left;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
x = ppt->x;
|
||||||
|
cx = rc.right - rc.left;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dwFlags & MPPF_BOTTOM)
|
||||||
|
{
|
||||||
|
y = ppt->y - rc.bottom;
|
||||||
|
cy = rc.bottom - rc.top;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
y = ppt->y + rc.top;
|
||||||
|
cy = rc.bottom - rc.top;
|
||||||
|
}
|
||||||
|
|
||||||
if (y < rcWorkArea.top)
|
if (y < rcWorkArea.top)
|
||||||
{
|
{
|
||||||
y = rcWorkArea.top;
|
y = rcWorkArea.top;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue