Skip to content

Commit e043676

Browse files
Add a Heading item: a separator with a label, with text options
The menu already draws a separator's label as text, which makes a good heading over a group of items. The item editor now has a Heading command for it (a separator, *heading in a custom menu), and three text options for headings: size (Normal, Small, Large), Bold and Italic (settings HEADING_SMALL, HEADING_LARGE, HEADING_BOLD, HEADING_ITALIC). A heading's row grows or shrinks with its text. The fonts are made from the skin's separator font when first needed and freed when the menu closes. Three things that kept labelled separators from working as headings: - A labelled separator right after another separator was dropped as a double separator. A heading always stays now. - A labelled separator at the end of the menu was trimmed like any trailing separator. When the list under a heading is empty, for example with no recent programs, the heading is the last item; if it also starts a column, trimming it merged that column into the others. - In the second pane of the Classic two-column menu a labelled separator had no font or colors of its own: the skin's Main2_separator section was read only for its image and height. Its font and colors are now read like Main_separator's, falling back to the second pane's items.
1 parent 729c368 commit e043676

8 files changed

Lines changed: 180 additions & 11 deletions

File tree

‎Src/StartMenu/StartMenuDLL/CustomMenu.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static StdMenuItem g_StdMenu[]=
5555
{L"switch_user",MENU_SWITCHUSER},
5656
{L"lock",MENU_LOCK},
5757
{L"*recent_programs",MENU_RECENT_PROGRAMS},
58+
{L"*heading",MENU_SEPARATOR}, // a separator that shows its label as a heading
5859
{L"search_box",MENU_SEARCH_BOX},
5960
{L"*apps",MENU_APPS},
6061

@@ -199,6 +200,10 @@ static unsigned int ParseItemSettings( const wchar_t *name )
199200
if (_wcsicmp(token,L"NOEXTENSIONS")==0) settings|=StdMenuItem::MENU_NOEXTENSIONS;
200201
if (_wcsicmp(token,L"INLINE")==0) settings|=StdMenuItem::MENU_INLINE;
201202
if (_wcsicmp(token,L"SPLIT")==0) settings|=StdMenuItem::MENU_SPLIT_BUTTON;
203+
if (_wcsicmp(token,L"HEADING_SMALL")==0) settings|=StdMenuItem::MENU_HEADING_SMALL;
204+
if (_wcsicmp(token,L"HEADING_LARGE")==0) settings|=StdMenuItem::MENU_HEADING_LARGE;
205+
if (_wcsicmp(token,L"HEADING_BOLD")==0) settings|=StdMenuItem::MENU_HEADING_BOLD;
206+
if (_wcsicmp(token,L"HEADING_ITALIC")==0) settings|=StdMenuItem::MENU_HEADING_ITALIC;
202207
}
203208
return settings;
204209
}

‎Src/StartMenu/StartMenuDLL/MenuContainer.cpp‎

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ CUserWindow CMenuContainer::s_UserPicture;
396396
RECT CMenuContainer::s_UserPictureRect;
397397
int CMenuContainer::s_ProgramsScrollPos;
398398
HBITMAP CMenuContainer::s_ArrowsBitmap;
399+
std::vector<CMenuContainer::HeadingFont> CMenuContainer::s_HeadingFonts;
399400
unsigned int CMenuContainer::s_LastArrowColor;
400401
char CMenuContainer::s_HasMoreResults;
401402
int CMenuContainer::s_ProgramsWidth, CMenuContainer::s_JumplistWidth;
@@ -1121,9 +1122,9 @@ void CMenuContainer::AddStandardItems( void )
11211122
if (!bFound && !bEmpty) continue;
11221123
}
11231124

1124-
if (pStdItem->id==MENU_SEPARATOR && menuIdx>0 && m_Items[menuIdx-1].id==MENU_SEPARATOR)
1125+
if (pStdItem->id==MENU_SEPARATOR && !pStdItem->label && menuIdx>0 && m_Items[menuIdx-1].id==MENU_SEPARATOR)
11251126
{
1126-
// prevent double separators unless that's exactly what is requested
1127+
// prevent double separators unless that's exactly what is requested. a heading (a separator with a label) always stays
11271128
if (pStdItem>m_pStdItem && pStdItem[-1].id!=MENU_SEPARATOR)
11281129
continue;
11291130
}
@@ -2610,8 +2611,8 @@ void CMenuContainer::InitItems( void )
26102611
}
26112612
AddStandardItems();
26122613

2613-
// remove trailing separators
2614-
while (!m_Items.empty() && m_Items[m_Items.size()-1].id==MENU_SEPARATOR && !m_Items[m_Items.size()-1].bInline)
2614+
// remove trailing separators, but not headings: a heading over an empty list still starts its column
2615+
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())
26152616
m_Items.pop_back();
26162617

26172618
if (m_Items.empty())
@@ -3052,6 +3053,68 @@ HBITMAP CMenuContainer::GetArrowsBitmap( unsigned int color )
30523053
return s_ArrowsBitmap;
30533054
}
30543055

3056+
// size of the small and large heading text and rows, in percent of the separator's
3057+
const int HEADING_SMALL_PERCENT=85;
3058+
const int HEADING_LARGE_PERCENT=125;
3059+
3060+
// The MENU_HEADING_ flags of a heading (a separator with a label), 0 for anything else
3061+
unsigned int CMenuContainer::GetHeadingStyle( const MenuItem &item )
3062+
{
3063+
if (item.id!=MENU_SEPARATOR || !item.pStdItem || item.name.IsEmpty())
3064+
return 0;
3065+
return item.pStdItem->settings&StdMenuItem::MENU_HEADING_MASK;
3066+
}
3067+
3068+
// The size of a heading's text and row, in percent of the separator's
3069+
static int GetHeadingPercent( unsigned int style )
3070+
{
3071+
if (style&StdMenuItem::MENU_HEADING_SMALL) return HEADING_SMALL_PERCENT;
3072+
if (style&StdMenuItem::MENU_HEADING_LARGE) return HEADING_LARGE_PERCENT;
3073+
return 100;
3074+
}
3075+
3076+
// The font of a heading: the skin's separator font, resized and styled by the item's settings
3077+
HFONT CMenuContainer::GetHeadingFont( const MenuItem &item, HFONT baseFont )
3078+
{
3079+
unsigned int style=GetHeadingStyle(item);
3080+
if (!style || !baseFont)
3081+
return baseFont;
3082+
HFONT font=FindHeadingFont(baseFont,style);
3083+
if (!font)
3084+
font=CreateHeadingFont(baseFont,style);
3085+
return font?font:baseFont;
3086+
}
3087+
3088+
// A heading font made before, or NULL
3089+
HFONT CMenuContainer::FindHeadingFont( HFONT baseFont, unsigned int style )
3090+
{
3091+
for (std::vector<HeadingFont>::const_iterator it=s_HeadingFonts.begin();it!=s_HeadingFonts.end();++it)
3092+
if (it->baseFont==baseFont && it->style==style)
3093+
return it->font;
3094+
return NULL;
3095+
}
3096+
3097+
// Makes a heading font and keeps it in s_HeadingFonts until the menu closes. Returns NULL if it fails
3098+
HFONT CMenuContainer::CreateHeadingFont( HFONT baseFont, unsigned int style )
3099+
{
3100+
LOGFONT lf;
3101+
if (!GetObject(baseFont,sizeof(lf),&lf))
3102+
return NULL;
3103+
lf.lfHeight=lf.lfHeight*GetHeadingPercent(style)/100;
3104+
if (style&StdMenuItem::MENU_HEADING_BOLD) lf.lfWeight=FW_BOLD;
3105+
if (style&StdMenuItem::MENU_HEADING_ITALIC) lf.lfItalic=TRUE;
3106+
HeadingFont headingFont={baseFont,style,CreateFontIndirect(&lf)};
3107+
if (headingFont.font)
3108+
s_HeadingFonts.push_back(headingFont);
3109+
return headingFont.font;
3110+
}
3111+
3112+
// The row height of a heading, scaled like its text
3113+
int CMenuContainer::GetHeadingHeight( const MenuItem &item, int itemHeight )
3114+
{
3115+
return itemHeight*GetHeadingPercent(GetHeadingStyle(item))/100;
3116+
}
3117+
30553118
// Calculate the size and create the background bitmaps
30563119
void CMenuContainer::InitWindow( bool bDontShrink )
30573120
{
@@ -3378,7 +3441,8 @@ void CMenuContainer::InitWindowInternal( bool bDontShrink, const POINT &corner,
33783441
{
33793442
if (!item.name.IsEmpty())
33803443
{
3381-
h=settings.itemHeight;
3444+
h=GetHeadingHeight(item,settings.itemHeight);
3445+
SelectObject(hdc,GetHeadingFont(item,settings.font));
33823446
RECT rcText={0,0,0,0};
33833447
DrawText(hdc,item.name,-1,&rcText,DT_CALCRECT|DT_SINGLELINE|DT_HIDEPREFIX);
33843448
w=rcText.right;
@@ -6281,6 +6345,9 @@ LRESULT CMenuContainer::OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
62816345
g_ItemManager.SaveCacheFile();
62826346
if (s_ArrowsBitmap) DeleteObject(s_ArrowsBitmap);
62836347
s_ArrowsBitmap=NULL;
6348+
for (std::vector<HeadingFont>::const_iterator it=s_HeadingFonts.begin();it!=s_HeadingFonts.end();++it)
6349+
DeleteObject(it->font);
6350+
s_HeadingFonts.clear();
62846351
CloseLog();
62856352
}
62866353
if (m_Options&CONTAINER_SEARCH)

‎Src/StartMenu/StartMenuDLL/MenuContainer.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ struct StdMenuItem
135135
MENU_SPLIT_BUTTON = 0x002000, // the item is drawn as a split button
136136
MENU_ITEM_DISABLED = 0x004000, // the item is disabled
137137
MENU_NORECENT = 0x008000, // don't show recent items in the root menu (because a sub-menu uses MENU_RECENT_ITEMS)
138+
MENU_HEADING_SMALL = 0x020000, // heading text is smaller than the separator font
139+
MENU_HEADING_LARGE = 0x040000, // heading text is larger than the separator font
140+
MENU_HEADING_BOLD = 0x080000, // heading text is bold
141+
MENU_HEADING_ITALIC = 0x400000, // heading text is italic (the bits in between are the style bits)
142+
MENU_HEADING_MASK = MENU_HEADING_SMALL|MENU_HEADING_LARGE|MENU_HEADING_BOLD|MENU_HEADING_ITALIC,
138143

139144
// style
140145
MENU_STYLE_CLASSIC1 = 0x100000,
@@ -924,6 +929,13 @@ class CMenuContainer: public IDropTarget, public IFrameworkInputPaneHandler, pub
924929
static int s_TipItem; // the item that needs a tooltip
925930
static CMenuContainer *s_pTipMenu;
926931
static HBITMAP s_ArrowsBitmap;
932+
struct HeadingFont
933+
{
934+
HFONT baseFont;
935+
unsigned int style; // MENU_HEADING_ flags
936+
HFONT font;
937+
};
938+
static std::vector<HeadingFont> s_HeadingFonts; // fonts created for headings, freed when the menu closes
927939
static unsigned int s_LastArrowColor;
928940
static CComPtr<IFrameworkInputPane> s_pFrameworkInputPane;
929941
static CString s_PinFolder;
@@ -971,6 +983,11 @@ class CMenuContainer: public IDropTarget, public IFrameworkInputPaneHandler, pub
971983
void ClearItems( const std::vector<MenuItem>::iterator &begin, const std::vector<MenuItem>::iterator &end );
972984
void AddJumpListItems( std::vector<MenuItem> &items );
973985
static HBITMAP GetArrowsBitmap( unsigned int color );
986+
static unsigned int GetHeadingStyle( const MenuItem &item );
987+
static HFONT GetHeadingFont( const MenuItem &item, HFONT baseFont );
988+
static HFONT FindHeadingFont( HFONT baseFont, unsigned int style );
989+
static HFONT CreateHeadingFont( HFONT baseFont, unsigned int style );
990+
static int GetHeadingHeight( const MenuItem &item, int itemHeight );
974991
static bool CloseProgramsMenu( void );
975992
static void HideStartMenu( void );
976993
static void SetDropTip( IDataObject *pDataObj, bool bPin );

‎Src/StartMenu/StartMenuDLL/MenuPaint.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ void CMenuContainer::DrawBackground( HDC hdc, const RECT &drawRect )
20622062
if (item.id==MENU_SEARCH_CATEGORY && !item.bSplit && item.categoryHash>=CSearchManager::CATEGORY_FILE && index==m_HotItem && m_bHotArrow)
20632063
SelectObject(hdc,s_Skin.Search_underline_font);
20642064
else
2065-
SelectObject(hdc,settings.font);
2065+
SelectObject(hdc,GetHeadingFont(item,settings.font));
20662066

20672067
COLORREF color=settings.textColors[(bHot && (!bSplit || stateLeft>0))?1:0];
20682068
COLORREF shadowColor=settings.textShadowColors[(bHot && (!bSplit || stateLeft>0))?1:0];

‎Src/StartMenu/StartMenuDLL/SettingsUI.cpp‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ static const CStdCommand g_StdCommands[]={
10611061
{L"switch_user",IDS_SHUTDOWN_SWITCH,IDS_SWITCH_TIP,L"SwitchUserItem",L"$Menu.SwitchUser",L"$Menu.SwitchUserTip",L"none"},
10621062
{L"lock",IDS_SHUTDOWN_LOCK,IDS_LOCK_TIP,L"LockItem",L"$Menu.Lock",L"$Menu.LockTip",L"none"},
10631063
{L"recent_programs",IDS_SHOW_RECENT,IDS_RECENT_TIP,L"RecentPrograms",NULL,NULL,L"none"},
1064+
{L"heading",IDS_HEADING_ITEM,IDS_HEADING_TIP,L"HeadingItem",NULL,NULL,L"none"},
10641065
{L"monitor_off",IDS_MONITOR_OFF_ITEM,IDS_MONITOR_OFF_TIP,L"MonitorOffItem",L"$Menu.MonitorOff",NULL,L"none"},
10651066
{L"",IDS_CUSTOM_ITEM,IDS_CUSTOM_TIP,L"CustomItem",NULL,NULL,L""},
10661067
{NULL},
@@ -1505,6 +1506,14 @@ class CEditMenuDlg: public CEditCustomItemDlg
15051506
LRESULT OnReset( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
15061507

15071508
private:
1509+
enum { HEADING_SIZE_NORMAL, HEADING_SIZE_SMALL, HEADING_SIZE_LARGE }; // the items of the heading size box
1510+
1511+
// the heading text options apply only to the Heading item
1512+
bool IsHeading( void ) { return m_pItem->pStdCommand && wcscmp(m_pItem->pStdCommand->name,L"heading")==0; }
1513+
void ShowHeadingSettings( void );
1514+
unsigned int GetHeadingSettings( void );
1515+
void EnableHeadingControls( void );
1516+
15081517
int m_Style, m_StyleMask;
15091518
};
15101519

@@ -1535,6 +1544,12 @@ LRESULT CEditMenuDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
15351544
CheckDlgButton(IDC_CHECKINLINE,(m_pItem->settings&StdMenuItem::MENU_INLINE)?BST_CHECKED:BST_UNCHECKED);
15361545
CheckDlgButton(IDC_CHECKSPLIT,(m_pItem->settings&StdMenuItem::MENU_SPLIT_BUTTON)?BST_CHECKED:BST_UNCHECKED);
15371546
CheckDlgButton(IDC_CHECKNOEXT,(m_pItem->settings&StdMenuItem::MENU_NOEXTENSIONS)?BST_CHECKED:BST_UNCHECKED);
1547+
CWindow headingSize=GetDlgItem(IDC_COMBOHEADINGSIZE); // in the order of HEADING_SIZE_
1548+
headingSize.SendMessage(CB_ADDSTRING,0,(LPARAM)(const wchar_t*)LoadStringEx(IDS_HEADING_NORMAL));
1549+
headingSize.SendMessage(CB_ADDSTRING,0,(LPARAM)(const wchar_t*)LoadStringEx(IDS_HEADING_SMALL));
1550+
headingSize.SendMessage(CB_ADDSTRING,0,(LPARAM)(const wchar_t*)LoadStringEx(IDS_HEADING_LARGE));
1551+
ShowHeadingSettings();
1552+
EnableHeadingControls();
15381553
if (m_pItem->pStdCommand && (wcscmp(m_pItem->pStdCommand->name,L"programs")==0 || wcscmp(m_pItem->pStdCommand->name,L"apps")==0))
15391554
{
15401555
CheckDlgButton(IDC_CHECKMULTICOLUMN,BST_CHECKED);
@@ -1677,6 +1692,7 @@ LRESULT CEditMenuDlg::OnOK( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHan
16771692
if (IsDlgButtonChecked(IDC_CHECKINLINE)==BST_CHECKED) m_pItem->settings|=StdMenuItem::MENU_INLINE;
16781693
if (IsDlgButtonChecked(IDC_CHECKSPLIT)==BST_CHECKED) m_pItem->settings|=StdMenuItem::MENU_SPLIT_BUTTON;
16791694
if (IsDlgButtonChecked(IDC_CHECKNOEXT)==BST_CHECKED) m_pItem->settings|=StdMenuItem::MENU_NOEXTENSIONS;
1695+
if (IsHeading()) m_pItem->settings|=GetHeadingSettings();
16801696
if (bForceMultiColumn)
16811697
{
16821698
// special handling of the Programs menu
@@ -1712,10 +1728,44 @@ LRESULT CEditMenuDlg::OnCommandChanged( WORD wNotifyCode, WORD wID, HWND hWndCtl
17121728
CheckDlgButton(IDC_CHECKMULTICOLUMN,(m_pItem->settings&StdMenuItem::MENU_MULTICOLUMN)?BST_CHECKED:BST_UNCHECKED);
17131729
GetDlgItem(IDC_CHECKMULTICOLUMN).EnableWindow(TRUE);
17141730
}
1731+
EnableHeadingControls();
17151732
UpdateIcons(IDC_ICONN,0);
17161733
return 0;
17171734
}
17181735

1736+
// Shows the item's heading text settings: size, bold and italic
1737+
void CEditMenuDlg::ShowHeadingSettings( void )
1738+
{
1739+
unsigned int settings=m_pItem->settings;
1740+
int size=HEADING_SIZE_NORMAL;
1741+
if (settings&StdMenuItem::MENU_HEADING_SMALL) size=HEADING_SIZE_SMALL;
1742+
if (settings&StdMenuItem::MENU_HEADING_LARGE) size=HEADING_SIZE_LARGE;
1743+
SendDlgItemMessage(IDC_COMBOHEADINGSIZE,CB_SETCURSEL,size);
1744+
CheckDlgButton(IDC_CHECKHEADINGBOLD,(settings&StdMenuItem::MENU_HEADING_BOLD)?BST_CHECKED:BST_UNCHECKED);
1745+
CheckDlgButton(IDC_CHECKHEADINGITALIC,(settings&StdMenuItem::MENU_HEADING_ITALIC)?BST_CHECKED:BST_UNCHECKED);
1746+
}
1747+
1748+
// The MENU_HEADING_ settings chosen in the dialog
1749+
unsigned int CEditMenuDlg::GetHeadingSettings( void )
1750+
{
1751+
unsigned int settings=0;
1752+
int size=(int)SendDlgItemMessage(IDC_COMBOHEADINGSIZE,CB_GETCURSEL);
1753+
if (size==HEADING_SIZE_SMALL) settings|=StdMenuItem::MENU_HEADING_SMALL;
1754+
if (size==HEADING_SIZE_LARGE) settings|=StdMenuItem::MENU_HEADING_LARGE;
1755+
if (IsDlgButtonChecked(IDC_CHECKHEADINGBOLD)==BST_CHECKED) settings|=StdMenuItem::MENU_HEADING_BOLD;
1756+
if (IsDlgButtonChecked(IDC_CHECKHEADINGITALIC)==BST_CHECKED) settings|=StdMenuItem::MENU_HEADING_ITALIC;
1757+
return settings;
1758+
}
1759+
1760+
void CEditMenuDlg::EnableHeadingControls( void )
1761+
{
1762+
BOOL bHeading=IsHeading();
1763+
GetDlgItem(IDC_STATICHEADING).EnableWindow(bHeading);
1764+
GetDlgItem(IDC_COMBOHEADINGSIZE).EnableWindow(bHeading);
1765+
GetDlgItem(IDC_CHECKHEADINGBOLD).EnableWindow(bHeading);
1766+
GetDlgItem(IDC_CHECKHEADINGITALIC).EnableWindow(bHeading);
1767+
}
1768+
17191769
LRESULT CEditMenuDlg::OnLinkChanged( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
17201770
{
17211771
CString text=GetComboText(wNotifyCode,wID);
@@ -1823,6 +1873,7 @@ LRESULT CEditMenuDlg::OnReset( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& b
18231873
}
18241874
else
18251875
GetDlgItem(IDC_CHECKMULTICOLUMN).EnableWindow(TRUE);
1876+
ShowHeadingSettings();
18261877

18271878
UpdateIcons(IDC_ICONN,IDC_ICOND);
18281879
return 0;
@@ -1870,6 +1921,10 @@ void CCustomMenuDlg::ParseTreeItemExtra( CTreeItem *pItem, CSettingsParser &pars
18701921
if (_wcsicmp(token,L"INLINE")==0) pItem->settings|=StdMenuItem::MENU_INLINE;
18711922
if (_wcsicmp(token,L"SPLIT")==0) pItem->settings|=StdMenuItem::MENU_SPLIT_BUTTON;
18721923
if (_wcsicmp(token,L"NOEXTENSIONS")==0) pItem->settings|=StdMenuItem::MENU_NOEXTENSIONS;
1924+
if (_wcsicmp(token,L"HEADING_SMALL")==0) pItem->settings|=StdMenuItem::MENU_HEADING_SMALL;
1925+
if (_wcsicmp(token,L"HEADING_LARGE")==0) pItem->settings|=StdMenuItem::MENU_HEADING_LARGE;
1926+
if (_wcsicmp(token,L"HEADING_BOLD")==0) pItem->settings|=StdMenuItem::MENU_HEADING_BOLD;
1927+
if (_wcsicmp(token,L"HEADING_ITALIC")==0) pItem->settings|=StdMenuItem::MENU_HEADING_ITALIC;
18731928
}
18741929
}
18751930

@@ -1892,6 +1947,10 @@ void CCustomMenuDlg::SerializeItemExtra( CTreeItem *pItem, std::vector<wchar_t>
18921947
if (pItem->settings&StdMenuItem::MENU_INLINE) AppendString(stringBuilder,L"INLINE|");
18931948
if (pItem->settings&StdMenuItem::MENU_SPLIT_BUTTON) AppendString(stringBuilder,L"SPLIT|");
18941949
if (pItem->settings&StdMenuItem::MENU_NOEXTENSIONS) AppendString(stringBuilder,L"NOEXTENSIONS|");
1950+
if (pItem->settings&StdMenuItem::MENU_HEADING_SMALL) AppendString(stringBuilder,L"HEADING_SMALL|");
1951+
if (pItem->settings&StdMenuItem::MENU_HEADING_LARGE) AppendString(stringBuilder,L"HEADING_LARGE|");
1952+
if (pItem->settings&StdMenuItem::MENU_HEADING_BOLD) AppendString(stringBuilder,L"HEADING_BOLD|");
1953+
if (pItem->settings&StdMenuItem::MENU_HEADING_ITALIC) AppendString(stringBuilder,L"HEADING_ITALIC|");
18951954
stringBuilder[stringBuilder.size()-1]='\n';
18961955
}
18971956

‎Src/StartMenu/StartMenuDLL/SkinManager.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,6 +2196,9 @@ bool MenuSkin::LoadSkin( HMODULE hMod, const wchar_t *variation, const wchar_t *
21962196
return false;
21972197
if (!LoadSkinItem(hMod,parser,L"Main2_new",ItemSettings[COLUMN2_NEW],&ItemSettings[COLUMN2_ITEM],Main_background,bRTL))
21982198
return false;
2199+
// like the first column: the text of named separators (headings) needs a font and colors
2200+
if (!LoadSkinItem(hMod,parser,L"Main2_separator",ItemSettings[COLUMN2_SEPARATOR],&ItemSettings[COLUMN2_ITEM],Main_background,bRTL))
2201+
return false;
21992202
ItemSettings[COLUMN2_SEPARATOR].sepHeight=ScaleSkinElement(DEFAULT_SEPARATOR_HEIGHT);
22002203
str=parser.FindSetting(L"Main2_separator");
22012204
if (str)

‎Src/StartMenu/StartMenuDLL/StartMenuDLL.rc‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ BEGIN
112112
LTEXT "This skin is used by the cascading All Programs menu in the Windows start menu",IDC_STATICALLPROGS,7,150,297,8
113113
END
114114

115-
IDD_CUSTOMMENU DIALOGEX 0, 0, 249, 236
115+
IDD_CUSTOMMENU DIALOGEX 0, 0, 249, 252
116116
STYLE DS_SETFONT | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
117117
CAPTION "Edit Menu Item (%s)"
118118
FONT 9, "Segoe UI", 400, 0, 0x0
@@ -144,9 +144,13 @@ BEGIN
144144
CONTROL "Don't track recent items",IDC_CHECKNOTRACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,155,97,10
145145
CONTROL "Place items first",IDC_CHECKITEMSFIRST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,168,69,10
146146
CONTROL "Hide extensions",IDC_CHECKNOEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,181,72,10
147-
PUSHBUTTON "Restore Defaults",IDC_BUTTONRESET,7,215,90,14
148-
DEFPUSHBUTTON "OK",IDOK,135,215,50,14
149-
PUSHBUTTON "Cancel",IDCANCEL,192,215,50,14
147+
LTEXT "Heading text:",IDC_STATICHEADING,7,209,46,12,SS_CENTERIMAGE
148+
COMBOBOX IDC_COMBOHEADINGSIZE,55,209,60,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
149+
CONTROL "Bold",IDC_CHECKHEADINGBOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,210,40,10
150+
CONTROL "Italic",IDC_CHECKHEADINGITALIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,175,210,40,10
151+
PUSHBUTTON "Restore Defaults",IDC_BUTTONRESET,7,231,90,14
152+
DEFPUSHBUTTON "OK",IDOK,135,231,50,14
153+
PUSHBUTTON "Cancel",IDCANCEL,192,231,50,14
150154
END
151155

152156
IDD_STYLESETTINGS DIALOGEX 0, 0, 362, 249
@@ -1075,6 +1079,11 @@ BEGIN
10751079
IDS_MAIN_MENU_SETTINGS "Main Menu"
10761080
IDS_BUTTON_OFFSET "Button offset"
10771081
IDS_BUTTON_OFFSET_TIP "Offset the start button horizontally by the amount of pixels specified"
1082+
IDS_HEADING_ITEM "Heading"
1083+
IDS_HEADING_TIP "A separator that shows its label as a heading over the items that follow it"
1084+
IDS_HEADING_NORMAL "Normal"
1085+
IDS_HEADING_SMALL "Small"
1086+
IDS_HEADING_LARGE "Large"
10781087
END
10791088

10801089
STRINGTABLE

‎Src/StartMenu/StartMenuDLL/resource.h‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@
101101
#define IDC_SKIN_CLASSIC2 1087
102102
#define IDC_SKIN_WIN7 1088
103103
#define IDC_STATICEDGE2 1089
104+
#define IDC_STATICHEADING 1093
105+
#define IDC_COMBOHEADINGSIZE 1094
106+
#define IDC_CHECKHEADINGBOLD 1095
107+
#define IDC_CHECKHEADINGITALIC 1096
104108
#define IDD_CUSTOMMENU 3001
105109
#define IDS_APP_TITLE 3001
106110
#define IDD_SKINSETTINGS 3002
@@ -788,6 +792,11 @@
788792
#define IDS_ALT_ACCELERATORS_TIP 3689
789793
#define IDS_BUTTON_OFFSET 3690
790794
#define IDS_BUTTON_OFFSET_TIP 3691
795+
#define IDS_HEADING_ITEM 3704
796+
#define IDS_HEADING_TIP 3705
797+
#define IDS_HEADING_NORMAL 3706
798+
#define IDS_HEADING_SMALL 3707
799+
#define IDS_HEADING_LARGE 3708
791800
#define IDS_STRING7001 7001
792801
#define IDS_STRING7002 7002
793802
#define IDS_STRING7003 7003
@@ -852,7 +861,7 @@
852861
#ifndef APSTUDIO_READONLY_SYMBOLS
853862
#define _APS_NEXT_RESOURCE_VALUE 126
854863
#define _APS_NEXT_COMMAND_VALUE 40001
855-
#define _APS_NEXT_CONTROL_VALUE 1090
864+
#define _APS_NEXT_CONTROL_VALUE 1097
856865
#define _APS_NEXT_SYMED_VALUE 101
857866
#endif
858867
#endif

0 commit comments

Comments
 (0)