diff --git a/Src/StartMenu/StartMenuDLL/CustomMenu.cpp b/Src/StartMenu/StartMenuDLL/CustomMenu.cpp index 8d8785e38..574669c47 100644 --- a/Src/StartMenu/StartMenuDLL/CustomMenu.cpp +++ b/Src/StartMenu/StartMenuDLL/CustomMenu.cpp @@ -95,13 +95,13 @@ CStdCommand7 g_StdCommands7[]={ {L"user_videos",0,NULL,L"$Menu.UserVideosTip",NULL,&FOLDERID_Videos}, {L"control_panel",0,L"$Menu.ControlPanel",L"$Menu.ControlPanelTip",NULL,&FOLDERID_ControlPanelFolder,NULL,StdMenuItem::MENU_TRACK}, {L"pc_settings",IDS_PCSETTINGS,L"$Menu.PCSettings",L"",L"%windir%\\ImmersiveControlPanel\\SystemSettings.exe,10",NULL,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_SINGLE}, - {L"network_connections",0,NULL,L"$Menu.NetworkTip",NULL,&FOLDERID_ConnectionsFolder}, + {L"network_connections",0,NULL,L"$Menu.NetworkTip",NULL,&FOLDERID_ConnectionsFolder,NULL,0,CStdCommand7::ITEM_NODRIVES}, {L"network",0,NULL,NULL,NULL,&FOLDERID_NetworkFolder,NULL,0,CStdCommand7::ITEM_SINGLE}, - {L"printers",0,NULL,L"$Menu.PrintersTip",NULL,&FOLDERID_PrintersFolder}, + {L"printers",0,NULL,L"$Menu.PrintersTip",NULL,&FOLDERID_PrintersFolder,NULL,0,CStdCommand7::ITEM_NODRIVES}, {L"fonts",0,NULL,NULL,NULL,&FOLDERID_Fonts}, {L"desktop",0,NULL,NULL,NULL,&FOLDERID_Desktop}, - {L"admin",0,NULL,L"$Menu.AdminToolsTip",L"imageres.dll,114",&FOLDERID_CommonAdminTools,NULL,StdMenuItem::MENU_TRACK}, - {L"startup",0,NULL,NULL,NULL,&FOLDERID_Startup,NULL,StdMenuItem::MENU_TRACK}, + {L"admin",0,NULL,L"$Menu.AdminToolsTip",L"imageres.dll,114",&FOLDERID_CommonAdminTools,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_NODRIVES}, + {L"startup",0,NULL,NULL,NULL,&FOLDERID_Startup,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_NODRIVES}, {L"downloads",0,NULL,L"$Menu.DownloadTip",NULL,&FOLDERID_Downloads}, {L"games",0,NULL,L"$Menu.GamesTip",NULL,&FOLDERID_Games,NULL,StdMenuItem::MENU_TRACK}, {L"links",0,NULL,NULL,NULL,&FOLDERID_Links}, @@ -112,7 +112,7 @@ CStdCommand7 g_StdCommands7[]={ {L"lib_videos",IDS_LIB_VIDEOS_ITEM,NULL,L"$Menu.VideosLibTip",NULL,&FOLDERID_VideosLibrary}, {L"lib_tv",IDS_LIB_TV_ITEM,NULL,L"$Menu.RecordingsLibTip",NULL,&FOLDERID_RecordedTVLibrary}, {L"homegroup",0,NULL,L"$Menu.HomegroupTip",NULL,&FOLDERID_HomeGroup,NULL,0,CStdCommand7::ITEM_SINGLE}, - {L"devices",0,NULL,NULL,NULL,NULL,L"::{26EE0668-A00A-44D7-9371-BEB064C98683}\\0\\::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}, + {L"devices",0,NULL,NULL,NULL,NULL,L"::{26EE0668-A00A-44D7-9371-BEB064C98683}\\0\\::{A8A91A66-3A7D-4424-8D24-04E180695C7A}",0,CStdCommand7::ITEM_NODRIVES}, {L"defaults",0,NULL,NULL,NULL,NULL,L"::{26EE0668-A00A-44D7-9371-BEB064C98683}\\0\\::{17CD9488-1228-4B2F-88CE-4298E93E0966}",0,CStdCommand7::ITEM_SINGLE}, {L"apps",IDS_METRO_APPS,L"$Menu.Apps",NULL,L",2",NULL,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_FOLDER}, diff --git a/Src/StartMenu/StartMenuDLL/CustomMenu.h b/Src/StartMenu/StartMenuDLL/CustomMenu.h index f2cec3f44..8ecc02df4 100644 --- a/Src/StartMenu/StartMenuDLL/CustomMenu.h +++ b/Src/StartMenu/StartMenuDLL/CustomMenu.h @@ -15,6 +15,7 @@ struct CStdCommand7 ITEM_SINGLE=1, // this item never has sub-menu ITEM_FOLDER=2, // this item always has sub-menu ITEM_COMPUTER=4, // this item can be expanded only one level + ITEM_NODRIVES=8, // this item can never be expanded only one level }; const wchar_t *command; int nameID; diff --git a/Src/StartMenu/StartMenuDLL/DragDrop.cpp b/Src/StartMenu/StartMenuDLL/DragDrop.cpp index 7b3262db8..b59865eea 100644 --- a/Src/StartMenu/StartMenuDLL/DragDrop.cpp +++ b/Src/StartMenu/StartMenuDLL/DragDrop.cpp @@ -903,7 +903,7 @@ HRESULT STDMETHODCALLTYPE CMenuContainer::Drop( IDataObject *pDataObj, DWORD grf else if (i if (bLibrary) flags&=~SFGAO_STREAM; item.bLink=(flags&SFGAO_LINK)!=0; - item.bFolder=(!(options&CONTAINER_CONTROLPANEL) && !(options&CONTAINER_NOSUBFOLDERS) && (flags&SFGAO_FOLDER) && (!(flags&(SFGAO_STREAM|SFGAO_LINK)) || (s_bExpandLinks && item.bLink))); + item.bFolderLink=(flags&SFGAO_FOLDER && (!(flags&(SFGAO_STREAM|SFGAO_LINK)) || (s_bExpandLinks && item.bLink))); + item.bFolder=(!(options&CONTAINER_CONTROLPANEL) && !(options&CONTAINER_NOSUBFOLDERS) && item.bFolderLink); { CItemManager::RWLock lock(&g_ItemManager,false,CItemManager::RWLOCK_ITEMS); if (item.pItemInfo->IsMetroLink()) @@ -2505,9 +2506,9 @@ void CMenuContainer::InitItems( void ) m_Items.resize(MAX_MENU_ITEMS); } - if (m_Options&CONTAINER_CONTROLPANEL) + if (m_Options&CONTAINER_CONTROLPANEL && !(m_Options&CONTAINER_NOSUBFOLDERS)) { - // expand Administrative Tools. must be done after the sorting because we don't want the folder to jump to the top + // expand Administrative Tools when displaying as a menu. must be done after the sorting because we don't want the folder to jump to the top unsigned int AdminToolsHash=CalcFNVHash(L"::{D20EA4E1-3957-11D2-A40B-0C5020524153}"); for (std::vector::iterator it=m_Items.begin();it!=m_Items.end();++it) if (it->nameHash==AdminToolsHash) diff --git a/Src/StartMenu/StartMenuDLL/MenuContainer.h b/Src/StartMenu/StartMenuDLL/MenuContainer.h index 84e36931c..d98210934 100644 --- a/Src/StartMenu/StartMenuDLL/MenuContainer.h +++ b/Src/StartMenu/StartMenuDLL/MenuContainer.h @@ -453,7 +453,7 @@ class CMenuContainer: public IDropTarget, public IFrameworkInputPaneHandler, pub drawType=MenuSkin::COLUMN1_ITEM; column=row=0; memset(&itemRect,0,sizeof(itemRect)); - bFolder=bLink=bPrograms=bAlignBottom=bBreak=bInline=bInlineFirst=bInlineLast=bSplit=bHasJumpList=bMetroLink=bMetroApp=bBlankSeparator=bNew=bStartScreen=bCustomAccelerator=false; + bFolder=bLink=bFolderLink=bPrograms=bAlignBottom=bBreak=bInline=bInlineFirst=bInlineLast=bSplit=bHasJumpList=bMetroLink=bMetroApp=bBlankSeparator=bNew=bStartScreen=bCustomAccelerator=false; priority=0; pItem1=pItem2=NULL; mfuHash=0; @@ -477,6 +477,7 @@ class CMenuContainer: public IDropTarget, public IFrameworkInputPaneHandler, pub RECT itemRect; bool bFolder:1; // this is a folder - draw arrow bool bLink:1; // this is a link (if a link to a folder is expanded it is always single-column) + bool bFolderLink:1; // this is a folder that is not explicitly expandable - used for sorting the list-of-links style bool bPrograms:1; // this item is part of the Start Menu folder hierarchy bool bAlignBottom:1; // two-column menu: this item is aligned to the bottom bool bBreak:1; // two-column menu: this item starts the second column @@ -512,8 +513,8 @@ class CMenuContainer: public IDropTarget, public IFrameworkInputPaneHandler, pub if (priority>item.priority) return false; if (rowitem.row) return false; - if ((bFolder && !bHasJumpList) && !(item.bFolder && !item.bHasJumpList)) return true; - if (!(bFolder && !bHasJumpList) && (item.bFolder && !item.bHasJumpList)) return false; + if (((bFolder || bFolderLink) && !bHasJumpList) && !((item.bFolder || item.bFolderLink) && !item.bHasJumpList)) return true; + if (!((bFolder || bFolderLink) && !bHasJumpList) && ((item.bFolder || item.bFolderLink) && !item.bHasJumpList)) return false; if (drive && !item.drive) return true; if (!drive && item.drive) return false; if (drive && item.drive) return drivex.priority) return false; - if ((bFolder && !bHasJumpList) && !(x.bFolder && !x.bHasJumpList)) return true; - if (!(bFolder && !bHasJumpList) && (x.bFolder && !x.bHasJumpList)) return false; + if (((bFolder || bFolderLink) && !bHasJumpList) && !((x.bFolder || x.bFolderLink) && !x.bHasJumpList)) return true; + if (!((bFolder || bFolderLink) && !bHasJumpList) && ((x.bFolder || x.bFolderLink) && !x.bHasJumpList)) return false; if (drive && !x.drive) return true; if (!drive && x.drive) return false; if (drive && x.drive) return drive