isHot = m_hotBar == this && (int) cdraw->nmcd.dwItemSpec == m_hotItem;
isPopup = m_popupBar == this && (int) cdraw->nmcd.dwItemSpec == m_popupItem;
- if ((m_initFlags & SMINIT_VERTICAL))
+ if (m_hotItem < 0 && isPopup)
+ isHot = TRUE;
+
+ if ((m_useFlatMenus && isHot) || (m_initFlags & SMINIT_VERTICAL))
{
COLORREF clrText;
HBRUSH bgBrush;
cdraw->nmcd.uItemState &= ~(CDIS_HOT | CDIS_CHECKED);
// Decide on the colors
- if (isHot || (m_hotItem < 0 && isPopup))
+ if (isHot)
{
cdraw->nmcd.uItemState |= CDIS_HOT;
cdraw->nmcd.uItemState &= ~CDIS_HOT;
// Decide on the colors
- if (isHot || (m_hotItem < 0 && isPopup))
+ if (isHot)
{
cdraw->nmcd.uItemState |= CDIS_HOT;
}
UpdateImageLists();
// For custom-drawing
- if (IsAppThemed())
- GetThemeSysBool(GetWindowTheme(m_hWnd), TMT_FLATMENUS);
- else
- SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
+ SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
return S_OK;
}
SetWindowTheme(m_hWnd, L"", L"");
- if (IsAppThemed())
- GetThemeSysBool(GetWindowTheme(m_hWnd), TMT_FLATMENUS);
- else
- SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
+ SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
m_menuBand->AdjustForTheme(m_useFlatMenus);
TBBUTTON btn;
GetButton(iIndex, &btn);
- if (!isLButton)
- return ProcessContextMenu(btn.idCommand);
if ((m_initFlags & SMINIT_VERTICAL)
|| m_popupBar
return ProcessClick(btn.idCommand);
}
-HRESULT CMenuToolbarBase::MenuBarMouseUp(INT iIndex)
+HRESULT CMenuToolbarBase::MenuBarMouseUp(INT iIndex, BOOL isLButton)
{
TBBUTTON btn;
return S_OK;
GetButton(iIndex, &btn);
- return ProcessClick(btn.idCommand);
+
+ if (isLButton)
+ return ProcessClick(btn.idCommand);
+ else
+ return ProcessContextMenu(btn.idCommand);
}
HRESULT CMenuToolbarBase::PrepareExecuteItem(INT iItem)
// If no items were added, show the "empty" placeholder
if (DPA_GetPtrCount(dpaSort) == 0)
{
+ DPA_Destroy(dpaSort);
return AddPlaceholder();
}
hr = m_shellFolder->GetDisplayNameOf(item, SIGDN_NORMALDISPLAY, &sr);
if (FAILED_UNEXPECTEDLY(hr))
+ {
+ DPA_Destroy(dpaSort);
return hr;
+ }
StrRetToStr(&sr, NULL, &MenuString);