Skip to content

Commit 2ca236c

Browse files
committed
Don't make metro icons smaller if Invert metro icons is enabled
There should be no need to make icons smaller.
1 parent 8a22282 commit 2ca236c

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

Src/StartMenu/StartMenuDLL/ItemManager.cpp

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ static HBITMAP BitmapFromMetroBitmap( HBITMAP hBitmap, int bitmapSize, DWORD met
259259
HGDIOBJ bmp0=SelectObject(hdc,bmp);
260260
HGDIOBJ bmp02=SelectObject(hsrc,hBitmap);
261261
int offset=(bitmapSize-info.bmWidth)/2;
262-
bool bInvert=g_bInvertMetroIcons;
263262
if (g_bInvertMetroIcons && bGrayscale)
264263
{
265264
FillRect(hdc,&rc,(HBRUSH)GetStockObject(BLACK_BRUSH));
@@ -302,8 +301,7 @@ static HBITMAP BitmapFromMetroBitmap( HBITMAP hBitmap, int bitmapSize, DWORD met
302301

303302
static HBITMAP LoadMetroBitmap0( const wchar_t *path, int bitmapSize, DWORD metroColor )
304303
{
305-
int iconSize=g_bInvertMetroIcons?bitmapSize:(bitmapSize-2);
306-
SIZE size={-iconSize,iconSize};
304+
SIZE size={-bitmapSize,bitmapSize};
307305
HBITMAP hBitmap=LoadImageFile(path,&size,true,true,NULL);
308306
if (hBitmap)
309307
{
@@ -440,16 +438,8 @@ static HBITMAP LoadMetroBitmap2( const wchar_t *location, int bitmapSize, DWORD
440438
}
441439
if (iconSize)
442440
{
443-
if (g_bInvertMetroIcons)
444-
{
445-
if (iconSize>bitmapSize)
446-
iconSize=bitmapSize;
447-
}
448-
else
449-
{
450-
if (iconSize>bitmapSize-2)
451-
iconSize=bitmapSize-2;
452-
}
441+
if (iconSize>bitmapSize)
442+
iconSize=bitmapSize;
453443
SIZE size={iconSize,iconSize};
454444
HBITMAP hBitmap=LoadImageFile(path,&size,true,true,NULL);
455445
if (hBitmap)
@@ -2322,12 +2312,6 @@ void CItemManager::LoadShellIcon( IShellItem *pItem, int refreshFlags, const Ico
23222312
int smallIconSize=SMALL_ICON_SIZE;
23232313
int largeIconSize=LARGE_ICON_SIZE;
23242314
int extraLargeIconSize=EXTRA_LARGE_ICON_SIZE;
2325-
if (pMetroColor)
2326-
{
2327-
smallIconSize-=2;
2328-
largeIconSize-=2;
2329-
extraLargeIconSize-=2;
2330-
}
23312315
HICON hSmallIcon=NULL, hLargeIcon=NULL, hExtraLargeIcon=NULL;
23322316
if (bNotFileName)
23332317
{
@@ -2446,8 +2430,7 @@ void CItemManager::LoadMetroIcon( IShellItem *pItem, int &refreshFlags, const Ic
24462430
if (FAILED(pResManager->GetDefaultContext(IID_ResourceContext,(void**)&pResContext)))
24472431
return;
24482432
int iconFlags=0;
2449-
int delta=g_bInvertMetroIcons?0:2;
2450-
if ((refreshFlags&INFO_SMALL_ICON) && SetResContextTargetSize(pResContext,SMALL_ICON_SIZE-delta))
2433+
if ((refreshFlags&INFO_SMALL_ICON) && SetResContextTargetSize(pResContext,SMALL_ICON_SIZE))
24512434
{
24522435
CComString pLocation;
24532436
if (SUCCEEDED(pResMap->GetFilePath(iconName,&pLocation)))
@@ -2457,7 +2440,7 @@ void CItemManager::LoadMetroIcon( IShellItem *pItem, int &refreshFlags, const Ic
24572440
StoreInCache(hash,L"",hSmallBitmap,NULL,NULL,INFO_SMALL_ICON,smallIcon,largeIcon,extraLargeIcon,false,true);
24582441
}
24592442
}
2460-
if ((refreshFlags&INFO_LARGE_ICON) && SetResContextTargetSize(pResContext,LARGE_ICON_SIZE-delta))
2443+
if ((refreshFlags&INFO_LARGE_ICON) && SetResContextTargetSize(pResContext,LARGE_ICON_SIZE))
24612444
{
24622445
CComString pLocation;
24632446
if (SUCCEEDED(pResMap->GetFilePath(iconName,&pLocation)))
@@ -2467,7 +2450,7 @@ void CItemManager::LoadMetroIcon( IShellItem *pItem, int &refreshFlags, const Ic
24672450
StoreInCache(hash,L"",NULL,hLargeBitmap,NULL,INFO_LARGE_ICON,smallIcon,largeIcon,extraLargeIcon,false,true);
24682451
}
24692452
}
2470-
if ((refreshFlags&INFO_EXTRA_LARGE_ICON) && SetResContextTargetSize(pResContext,EXTRA_LARGE_ICON_SIZE-delta))
2453+
if ((refreshFlags&INFO_EXTRA_LARGE_ICON) && SetResContextTargetSize(pResContext,EXTRA_LARGE_ICON_SIZE))
24712454
{
24722455
CComString pLocation;
24732456
if (SUCCEEDED(pResMap->GetFilePath(iconName,&pLocation)))

0 commit comments

Comments
 (0)