Skip to content
Open
3 changes: 2 additions & 1 deletion Src/Lib/SettingsUIHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ struct CTreeItem
CString icon;
CString iconD;
unsigned int settings;
int rows; // rows per column of a Pinned programs or Recent Programs list (0 - no limit)
const CStdCommand *pStdCommand; // always valid

CTreeItem( void ) { settings=0; pStdCommand=NULL; }
CTreeItem( void ) { settings=0; rows=0; pStdCommand=NULL; }
void SetCommand( CString command, const CStdCommand *pStdCommands, int style, int mask );
unsigned int GetIconKey( void ) const;
HICON LoadIcon( bool bSmall, std::vector<HMODULE> &modules ) const;
Expand Down
6 changes: 6 additions & 0 deletions Src/StartMenu/StartMenuDLL/CustomMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static StdMenuItem g_StdMenu[]=
{L"switch_user",MENU_SWITCHUSER},
{L"lock",MENU_LOCK},
{L"*recent_programs",MENU_RECENT_PROGRAMS},
{L"*pinned_programs",MENU_PINNED_PROGRAMS},
{L"search_box",MENU_SEARCH_BOX},
{L"*apps",MENU_APPS},

Expand Down Expand Up @@ -199,6 +200,7 @@ static unsigned int ParseItemSettings( const wchar_t *name )
if (_wcsicmp(token,L"NOEXTENSIONS")==0) settings|=StdMenuItem::MENU_NOEXTENSIONS;
if (_wcsicmp(token,L"INLINE")==0) settings|=StdMenuItem::MENU_INLINE;
if (_wcsicmp(token,L"SPLIT")==0) settings|=StdMenuItem::MENU_SPLIT_BUTTON;
if (_wcsicmp(token,L"FLAT_LIST")==0) settings|=StdMenuItem::MENU_FLAT_LIST;
}
return settings;
}
Expand Down Expand Up @@ -285,6 +287,9 @@ static void ParseMenuItem( StdMenuItem &item, const wchar_t *name )
item.iconPath=g_CustomMenuParser.FindSetting(buf);

item.settings=ParseItemSettings(name);
Sprintf(buf,_countof(buf),L"%s.Rows",name);
str=g_CustomMenuParser.FindSetting(buf);
item.rows=str?_wtol(str):0;
if (custom7>=0)
{
if (g_StdCommands7[custom7].flags&CStdCommand7::ITEM_SINGLE)
Expand Down Expand Up @@ -491,6 +496,7 @@ const StdMenuItem *ParseCustomMenu( unsigned int &rootSettings )
item.folder1=item.folder2=NULL;
item.label=item.tip=item.iconPath=item.link=NULL;
item.settings=0;
item.rows=0;
item.submenu=NULL;

// handle special names
Expand Down
3 changes: 2 additions & 1 deletion Src/StartMenu/StartMenuDLL/DragDrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ HRESULT STDMETHODCALLTYPE CMenuContainer::DragOver( DWORD grfKeyState, POINTL pt
}
else
{
if (!m_bSubMenu && index<m_OriginalCount && PtInRect(&m_rContent,p) && (s_pDragSource!=this || s_bDragFromTree || !s_bDragMovable || m_Items[m_DragIndex].id==MENU_RECENT))
RECT rScroll=GetScrollRect(); // a drop on empty space in the column of the pinned programs adds to them
if (!m_bSubMenu && index<m_OriginalCount && PtInRect(&rScroll,p) && (s_pDragSource!=this || s_bDragFromTree || !s_bDragMovable || m_Items[m_DragIndex].id==MENU_RECENT))
{
if (s_bWin7Style)
{
Expand Down
4 changes: 2 additions & 2 deletions Src/StartMenu/StartMenuDLL/MenuCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,9 +1497,9 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
{
// scroll the pager to make this item visible
RECT rc=item.itemRect;
OffsetRect(&rc,0,-m_rContent.top);
OffsetRect(&rc,0,-GetScrollRect().top);
int pos=m_ScrollOffset;
int total=m_Items[m_ScrollCount-1].itemRect.bottom-m_rContent.top-m_ScrollHeight;
int total=GetScrollRange();
if (pos>rc.top-m_ScrollButtonSize)
pos=rc.top-m_ScrollButtonSize;
else if (pos<rc.bottom+m_ScrollButtonSize-m_ScrollHeight)
Expand Down
Loading