mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-20 10:44:37 +10:00
@@ -1164,6 +1164,10 @@ const CItemManager::ItemInfo* CItemManager::GetLinkIcon(IShellLink* link, TIconS
|
|||||||
CComPtr<IResourceMap> resMap;
|
CComPtr<IResourceMap> resMap;
|
||||||
if (SUCCEEDED(resManager->GetMainResourceMap(IID_PPV_ARGS(&resMap))))
|
if (SUCCEEDED(resManager->GetMainResourceMap(IID_PPV_ARGS(&resMap))))
|
||||||
{
|
{
|
||||||
|
CComPtr<IResourceContext> resContext;
|
||||||
|
if (SUCCEEDED(resManager->GetDefaultContext(IID_PPV_ARGS(&resContext))))
|
||||||
|
resContext->SetTargetSize(GetIconSize(iconSizeType));
|
||||||
|
|
||||||
CComString location;
|
CComString location;
|
||||||
if (SUCCEEDED(resMap->GetFilePath(logoUri, &location)))
|
if (SUCCEEDED(resMap->GetFilePath(logoUri, &location)))
|
||||||
return GetCustomIcon(location, -65536, iconSizeType, true);
|
return GetCustomIcon(location, -65536, iconSizeType, true);
|
||||||
@@ -3585,6 +3589,26 @@ void CItemManager::ClearCache( void )
|
|||||||
item.extraLargeIcon=m_DefaultExtraLargeIcon;
|
item.extraLargeIcon=m_DefaultExtraLargeIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CItemManager::GetIconSize(TIconSizeType iconSizeType) const
|
||||||
|
{
|
||||||
|
switch (iconSizeType)
|
||||||
|
{
|
||||||
|
case ICON_SIZE_TYPE_SMALL:
|
||||||
|
case ICON_SIZE_TYPE_SMALL_METRO:
|
||||||
|
return SMALL_ICON_SIZE;
|
||||||
|
|
||||||
|
case ICON_SIZE_TYPE_LARGE:
|
||||||
|
case ICON_SIZE_TYPE_LARGE_METRO:
|
||||||
|
return LARGE_ICON_SIZE;
|
||||||
|
|
||||||
|
case ICON_SIZE_TYPE_EXTRA_LARGE:
|
||||||
|
case ICON_SIZE_TYPE_EXTRA_LARGE_METRO:
|
||||||
|
return EXTRA_LARGE_ICON_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// retrieves the pidl and the SFGAO_FOLDER, SFGAO_STREAM, SFGAO_LINK flags for the path
|
// retrieves the pidl and the SFGAO_FOLDER, SFGAO_STREAM, SFGAO_LINK flags for the path
|
||||||
// for paths starting with \\ tries to guess if it is a folder or a link based on the extension
|
// for paths starting with \\ tries to guess if it is a folder or a link based on the extension
|
||||||
HRESULT MenuParseDisplayName( const wchar_t *path, PIDLIST_ABSOLUTE *pPidl, SFGAOF *pFlags, TNetworkType *pNetworkType )
|
HRESULT MenuParseDisplayName( const wchar_t *path, PIDLIST_ABSOLUTE *pPidl, SFGAOF *pFlags, TNetworkType *pNetworkType )
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ public:
|
|||||||
ICON_SIZE_COUNT
|
ICON_SIZE_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int GetIconSize(TIconSizeType iconSizeType) const;
|
||||||
|
|
||||||
struct IconInfo
|
struct IconInfo
|
||||||
{
|
{
|
||||||
TIconSizeType sizeType;
|
TIconSizeType sizeType;
|
||||||
|
|||||||
Reference in New Issue
Block a user