Skip to content

Commit 594bfa9

Browse files
Pinned Programs item: no automatic separator after the pinned programs
AddStandardItems puts a separator between the pinned programs and the items that follow them, because in the default menu they share a column. With a Pinned Programs item the user places the pinned programs and everything around them, so that separator is no longer needed, and when a list follows in the same column it pushes the rows below it out of line with the column next to it. The separator now gets no height when a Pinned Programs item places the pinned programs. The item stays, so the bottom alignment it carries for COLUMN_PADDING and the pager's use of it are unchanged. A SEPARATOR item after the Pinned Programs item still draws a line. Menus without a Pinned Programs item are unchanged.
1 parent 651880a commit 594bfa9

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎Src/StartMenu/StartMenuDLL/MenuContainer.cpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,13 @@ int CMenuContainer::GetPinnedEnd( void )
15981598
return end;
15991599
}
16001600

1601+
// Is the item the separator that AddStandardItems puts after the pinned programs, while a Pinned Programs item places them?
1602+
// That separator gets no height: with a Pinned Programs item the user adds separators where they want them
1603+
bool CMenuContainer::IsPinnedSeparator( int index )
1604+
{
1605+
return m_PinnedPosition>=0 && index==m_ScrollCount && m_Items[index].id==MENU_SEPARATOR;
1606+
}
1607+
16011608
// The SecondPane setting in effect
16021609
TSecondPane CMenuContainer::GetSecondPaneMode( void )
16031610
{
@@ -3642,6 +3649,8 @@ void CMenuContainer::InitWindowInternal( bool bDontShrink, const POINT &corner,
36423649
h=0; // hide it for now
36433650
else if (!s_bShowTopEmpty && m_Items.size()>1 && (m_Items[i].id==MENU_EMPTY_TOP || (i>0 && m_Items[i-1].id==MENU_EMPTY_TOP)))
36443651
h=0; // this is the first (Empty) item in the top menu. hide it for now
3652+
else if (IsPinnedSeparator(i))
3653+
h=0;
36453654
else if (item.bInline)
36463655
{
36473656
h=iconSize+settings.iconPadding.top+settings.iconPadding.bottom;

‎Src/StartMenu/StartMenuDLL/MenuContainer.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ class CMenuContainer: public IDropTarget, public IFrameworkInputPaneHandler, pub
720720
void MovePinnedPadding( void );
721721
void GetLayoutOrder( std::vector<int> &order );
722722
int GetPinnedEnd( void );
723+
bool IsPinnedSeparator( int index );
723724
static TSecondPane GetSecondPaneMode( void );
724725
static int CountColumnBreaks( const StdMenuItem *pStdItem );
725726
bool IsSecondPaneAfterBreaks( int breaks, int count );

0 commit comments

Comments
 (0)