diff --git a/Src/StartMenu/StartMenuDLL/CustomMenu.cpp b/Src/StartMenu/StartMenuDLL/CustomMenu.cpp index 8e7875c74..fbdf70f42 100644 --- a/Src/StartMenu/StartMenuDLL/CustomMenu.cpp +++ b/Src/StartMenu/StartMenuDLL/CustomMenu.cpp @@ -55,6 +55,7 @@ static StdMenuItem g_StdMenu[]= {L"switch_user",MENU_SWITCHUSER}, {L"lock",MENU_LOCK}, {L"*recent_programs",MENU_RECENT_PROGRAMS}, + {L"*heading",MENU_SEPARATOR}, // a separator that shows its label as a heading {L"search_box",MENU_SEARCH_BOX}, {L"*apps",MENU_APPS}, diff --git a/Src/StartMenu/StartMenuDLL/MenuContainer.cpp b/Src/StartMenu/StartMenuDLL/MenuContainer.cpp index 3337b66a8..06e77656b 100644 --- a/Src/StartMenu/StartMenuDLL/MenuContainer.cpp +++ b/Src/StartMenu/StartMenuDLL/MenuContainer.cpp @@ -1121,9 +1121,9 @@ void CMenuContainer::AddStandardItems( void ) if (!bFound && !bEmpty) continue; } - if (pStdItem->id==MENU_SEPARATOR && menuIdx>0 && m_Items[menuIdx-1].id==MENU_SEPARATOR) + if (pStdItem->id==MENU_SEPARATOR && !pStdItem->label && menuIdx>0 && m_Items[menuIdx-1].id==MENU_SEPARATOR) { - // prevent double separators unless that's exactly what is requested + // prevent double separators unless that's exactly what is requested. a heading (a separator with a label) always stays if (pStdItem>m_pStdItem && pStdItem[-1].id!=MENU_SEPARATOR) continue; } @@ -2610,8 +2610,8 @@ void CMenuContainer::InitItems( void ) } AddStandardItems(); - // remove trailing separators - while (!m_Items.empty() && m_Items[m_Items.size()-1].id==MENU_SEPARATOR && !m_Items[m_Items.size()-1].bInline) + // remove trailing separators, but not headings: a heading over an empty list still starts its column + while (!m_Items.empty() && m_Items[m_Items.size()-1].id==MENU_SEPARATOR && !m_Items[m_Items.size()-1].bInline && m_Items[m_Items.size()-1].name.IsEmpty()) m_Items.pop_back(); if (m_Items.empty()) diff --git a/Src/StartMenu/StartMenuDLL/SettingsUI.cpp b/Src/StartMenu/StartMenuDLL/SettingsUI.cpp index af9376103..19327995b 100644 --- a/Src/StartMenu/StartMenuDLL/SettingsUI.cpp +++ b/Src/StartMenu/StartMenuDLL/SettingsUI.cpp @@ -1061,6 +1061,7 @@ static const CStdCommand g_StdCommands[]={ {L"switch_user",IDS_SHUTDOWN_SWITCH,IDS_SWITCH_TIP,L"SwitchUserItem",L"$Menu.SwitchUser",L"$Menu.SwitchUserTip",L"none"}, {L"lock",IDS_SHUTDOWN_LOCK,IDS_LOCK_TIP,L"LockItem",L"$Menu.Lock",L"$Menu.LockTip",L"none"}, {L"recent_programs",IDS_SHOW_RECENT,IDS_RECENT_TIP,L"RecentPrograms",NULL,NULL,L"none"}, + {L"heading",IDS_HEADING_ITEM,IDS_HEADING_TIP,L"HeadingItem",NULL,NULL,L"none"}, {L"monitor_off",IDS_MONITOR_OFF_ITEM,IDS_MONITOR_OFF_TIP,L"MonitorOffItem",L"$Menu.MonitorOff",NULL,L"none"}, {L"",IDS_CUSTOM_ITEM,IDS_CUSTOM_TIP,L"CustomItem",NULL,NULL,L""}, {NULL}, diff --git a/Src/StartMenu/StartMenuDLL/SkinManager.cpp b/Src/StartMenu/StartMenuDLL/SkinManager.cpp index a9f882059..e2dac74c4 100644 --- a/Src/StartMenu/StartMenuDLL/SkinManager.cpp +++ b/Src/StartMenu/StartMenuDLL/SkinManager.cpp @@ -2196,6 +2196,9 @@ bool MenuSkin::LoadSkin( HMODULE hMod, const wchar_t *variation, const wchar_t * return false; if (!LoadSkinItem(hMod,parser,L"Main2_new",ItemSettings[COLUMN2_NEW],&ItemSettings[COLUMN2_ITEM],Main_background,bRTL)) return false; + // like the first column: the text of named separators (headings) needs a font and colors + if (!LoadSkinItem(hMod,parser,L"Main2_separator",ItemSettings[COLUMN2_SEPARATOR],&ItemSettings[COLUMN2_ITEM],Main_background,bRTL)) + return false; ItemSettings[COLUMN2_SEPARATOR].sepHeight=ScaleSkinElement(DEFAULT_SEPARATOR_HEIGHT); str=parser.FindSetting(L"Main2_separator"); if (str) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.rc b/Src/StartMenu/StartMenuDLL/StartMenuDLL.rc index d65ffce32..a573ebe38 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.rc +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.rc @@ -1075,6 +1075,8 @@ BEGIN IDS_MAIN_MENU_SETTINGS "Main Menu" IDS_BUTTON_OFFSET "Button offset" IDS_BUTTON_OFFSET_TIP "Offset the start button horizontally by the amount of pixels specified" + IDS_HEADING_ITEM "Heading" + IDS_HEADING_TIP "A separator that shows its label as a heading over the items that follow it" END STRINGTABLE diff --git a/Src/StartMenu/StartMenuDLL/resource.h b/Src/StartMenu/StartMenuDLL/resource.h index 81acb7478..f215d7271 100644 --- a/Src/StartMenu/StartMenuDLL/resource.h +++ b/Src/StartMenu/StartMenuDLL/resource.h @@ -788,6 +788,8 @@ #define IDS_ALT_ACCELERATORS_TIP 3689 #define IDS_BUTTON_OFFSET 3690 #define IDS_BUTTON_OFFSET_TIP 3691 +#define IDS_HEADING_ITEM 3704 +#define IDS_HEADING_TIP 3705 #define IDS_STRING7001 7001 #define IDS_STRING7002 7002 #define IDS_STRING7003 7003