Reactos

[EXPLORER] Start menu: Fix Small Icons flag (#6651)

Follow-up to #6646.
Fix wrong flag use: #6646 (comment)
JIRA issue: CORE-19494
- Delete SmallStartMenu flag (wrong) from
_TW_STUCKRECTS2.
- Rename _TW_STUCKRECTS2.SmallIcons as
SmSmallIcons.
- Use SmSmallIcons flag.

authored by

Katayama Hirofumi MZ and committed by
GitHub
17b0623c 2ec785b1

+33 -17
+10 -5
base/shell/explorer/precomp.h
··· 203 203 { 204 204 DWORD AutoHide : 1; 205 205 DWORD AlwaysOnTop : 1; 206 - DWORD SmallIcons : 1; 206 + DWORD SmSmallIcons : 1; // Start menu Small Icons 207 207 DWORD HideClock : 1; 208 - DWORD SmallStartMenu : 1; 209 208 }; 210 209 }; 211 210 DWORD Position; ··· 327 326 HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand* pTaskBand, OUT ITrayBandSite** pBandSite); 328 327 329 328 /* 330 - * startmnu.cpp 329 + * startctxmnu.cpp 331 330 */ 332 - 333 331 HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu); 334 332 333 + /* 334 + * startmnu.cpp 335 + */ 335 336 IMenuPopup* 336 337 CreateStartMenu(IN ITrayWindow *Tray, 337 338 OUT IMenuBand **ppMenuBand, 338 339 IN HBITMAP hbmBanner OPTIONAL, 339 340 IN BOOL bSmallIcons); 341 + HRESULT 342 + UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, 343 + IN HBITMAP hbmBanner OPTIONAL, 344 + IN BOOL bSmallIcons, 345 + IN BOOL bRefresh); 340 346 341 347 /* 342 348 * startmnucust.cpp ··· 347 353 /* 348 354 * startmnusite.cpp 349 355 */ 350 - 351 356 HRESULT 352 357 CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv); 353 358
+1 -2
base/shell/explorer/settings.cpp
··· 80 80 sr.Position = ABE_BOTTOM; 81 81 sr.AutoHide = FALSE; 82 82 sr.AlwaysOnTop = TRUE; 83 - sr.SmallIcons = TRUE; 83 + sr.SmSmallIcons = FALSE; 84 84 sr.HideClock = FALSE; 85 - sr.SmallStartMenu = FALSE; 86 85 sr.Rect.left = sr.Rect.top = 0; 87 86 sr.Rect.bottom = sr.Rect.right = 1; 88 87 sr.Size.cx = sr.Size.cy = 0;
+8 -2
base/shell/explorer/startmnu.cpp
··· 23 23 HRESULT 24 24 UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, 25 25 IN HBITMAP hbmBanner OPTIONAL, 26 - IN BOOL bSmallIcons) 26 + IN BOOL bSmallIcons, 27 + IN BOOL bRefresh) 27 28 { 28 29 CComPtr<IBanneredBar> pbb; 29 30 HRESULT hRet; ··· 35 36 36 37 /* Update the icon size */ 37 38 hRet = pbb->SetIconSize(bSmallIcons ? BMICON_SMALL : BMICON_LARGE); 39 + } 40 + 41 + if (bRefresh) 42 + { 43 + FIXME("Refresh the Start menu with communicating with SHELL32\n"); 38 44 } 39 45 40 46 return hRet; ··· 97 103 if (FAILED_UNEXPECTEDLY(hr)) 98 104 return NULL; 99 105 100 - UpdateStartMenu(pMp, hbmBanner, bSmallIcons); 106 + UpdateStartMenu(pMp, hbmBanner, bSmallIcons, FALSE); 101 107 102 108 *ppMenuBand = pMb.Detach(); 103 109
+2 -2
base/shell/explorer/startmnucust.cpp
··· 91 91 92 92 static BOOL CALLBACK CustomGetSmallStartMenu(const CUSTOM_ENTRY *entry) 93 93 { 94 - return g_TaskbarSettings.sr.SmallStartMenu; 94 + return g_TaskbarSettings.sr.SmSmallIcons; 95 95 } 96 96 97 97 static VOID CALLBACK CustomSetSmallStartMenu(const CUSTOM_ENTRY *entry, BOOL bValue) 98 98 { 99 - g_TaskbarSettings.sr.SmallStartMenu = bValue; 99 + g_TaskbarSettings.sr.SmSmallIcons = bValue; 100 100 } 101 101 102 102 static const CUSTOM_ENTRY s_CustomEntries[] =
+12 -6
base/shell/explorer/traywnd.cpp
··· 2554 2554 RegLoadSettings(); 2555 2555 2556 2556 /* Create and initialize the start menu */ 2557 - BOOL bSmallStartMenu = g_TaskbarSettings.sr.SmallStartMenu; 2558 2557 HBITMAP hbmBanner = LoadBitmapW(hExplorerInstance, MAKEINTRESOURCEW(IDB_STARTMENU)); 2559 - m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, bSmallStartMenu); 2558 + m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, 2559 + g_TaskbarSettings.sr.SmSmallIcons); 2560 2560 2561 2561 /* Create the task band */ 2562 2562 hRet = CTaskBand_CreateInstance(this, m_StartButton.m_hWnd, IID_PPV_ARG(IDeskBand, &m_TaskBand)); ··· 2661 2661 2662 2662 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0) 2663 2663 { 2664 - /* Re-create the start menu */ 2665 2664 HideStartMenu(); 2666 - m_StartMenuBand.Release(); 2667 2665 2668 - BOOL bSmallStartMenu = g_TaskbarSettings.sr.SmallStartMenu; 2669 2666 HBITMAP hbmBanner = LoadBitmapW(hExplorerInstance, MAKEINTRESOURCEW(IDB_STARTMENU)); 2670 - m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, bSmallStartMenu); 2667 + #if 1 // FIXME: Please re-use the start menu 2668 + /* Re-create the start menu */ 2669 + m_StartMenuBand.Release(); 2670 + m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, 2671 + g_TaskbarSettings.sr.SmSmallIcons); 2672 + FIXME("Use UpdateStartMenu\n"); 2673 + #else 2674 + // Update the start menu 2675 + UpdateStartMenu(m_StartMenuPopup, hbmBanner, g_TaskbarSettings.sr.SmSmallIcons, TRUE); 2676 + #endif 2671 2677 } 2672 2678 2673 2679 return 0;