* CMenuBand: Fix display of icons for the static toolbar.
* CMenuDeskBar: Fix positioning of the window not to cross the top edge.
CORE-7881

svn path=/branches/shell-experiments/; revision=62242
This commit is contained in:
David Quintana 2014-02-18 11:17:37 +00:00
parent 662d8363c3
commit edfdf34624
2 changed files with 9 additions and 13 deletions

View file

@ -1130,7 +1130,8 @@ HRESULT CMenuStaticToolbar::FillToolbar()
tbb.iString = (INT_PTR) MenuString;
tbb.idCommand = info.wID;
SMINFO sminfo;
SMINFO sminfo = { 0 };
sminfo.dwMask = SMIM_ICON;
if (info.wID >= 0 && SUCCEEDED(m_menuBand->CallCBWithId(info.wID, SMC_GETINFO, 0, (LPARAM) &sminfo)))
{
tbb.iBitmap = sminfo.iIcon;

View file

@ -134,7 +134,6 @@ public:
MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
MESSAGE_HANDLER(WM_CANCELMODE, OnCancelMode)
MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
MESSAGE_HANDLER(WM_PAINT, OnPaint)
END_MSG_MAP()
@ -143,7 +142,6 @@ public:
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnCancelMode(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnWindowPosChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
#endif
@ -667,16 +665,6 @@ LRESULT CMenuDeskBar::OnWindowPosChanged(UINT uMsg, WPARAM wParam, LPARAM lParam
return 0;
}
LRESULT CMenuDeskBar::OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
if (LOWORD(wParam) == WA_INACTIVE)
{
//DestroyWindow();
//ShowWindow(SW_HIDE);
}
return 0;
}
LRESULT CMenuDeskBar::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
TRACE("OnPaint\n");
@ -771,6 +759,13 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup(POINTL *ppt, RECTL *prcExclude, MP
int cx = rc.right;
int cy = rc.bottom;
if (y < 0)
{
y = 0;
}
// if (y+cy > work area height) cy = work area height - y
this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, SWP_SHOWWINDOW);
// HACK: The bar needs to be notified of the size AFTER it is shown.