[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.
This commit is contained in:
Katayama Hirofumi MZ 2024-03-22 21:15:22 +09:00 committed by GitHub
parent 2ec785b1ee
commit 17b0623cf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 17 deletions

View file

@ -203,9 +203,8 @@ typedef struct _TW_STUCKRECTS2
{ {
DWORD AutoHide : 1; DWORD AutoHide : 1;
DWORD AlwaysOnTop : 1; DWORD AlwaysOnTop : 1;
DWORD SmallIcons : 1; DWORD SmSmallIcons : 1; // Start menu Small Icons
DWORD HideClock : 1; DWORD HideClock : 1;
DWORD SmallStartMenu : 1;
}; };
}; };
DWORD Position; DWORD Position;
@ -327,16 +326,23 @@ DECLARE_INTERFACE_(ITrayBandSite, IUnknown)
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand* pTaskBand, OUT ITrayBandSite** pBandSite); HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand* pTaskBand, OUT ITrayBandSite** pBandSite);
/* /*
* startmnu.cpp * startctxmnu.cpp
*/ */
HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu); HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu);
/*
* startmnu.cpp
*/
IMenuPopup* IMenuPopup*
CreateStartMenu(IN ITrayWindow *Tray, CreateStartMenu(IN ITrayWindow *Tray,
OUT IMenuBand **ppMenuBand, OUT IMenuBand **ppMenuBand,
IN HBITMAP hbmBanner OPTIONAL, IN HBITMAP hbmBanner OPTIONAL,
IN BOOL bSmallIcons); IN BOOL bSmallIcons);
HRESULT
UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup,
IN HBITMAP hbmBanner OPTIONAL,
IN BOOL bSmallIcons,
IN BOOL bRefresh);
/* /*
* startmnucust.cpp * startmnucust.cpp
@ -347,7 +353,6 @@ ShowCustomizeClassic(HINSTANCE, HWND);
/* /*
* startmnusite.cpp * startmnusite.cpp
*/ */
HRESULT HRESULT
CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv); CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv);

View file

@ -80,9 +80,8 @@ BOOL TaskbarSettings::Load()
sr.Position = ABE_BOTTOM; sr.Position = ABE_BOTTOM;
sr.AutoHide = FALSE; sr.AutoHide = FALSE;
sr.AlwaysOnTop = TRUE; sr.AlwaysOnTop = TRUE;
sr.SmallIcons = TRUE; sr.SmSmallIcons = FALSE;
sr.HideClock = FALSE; sr.HideClock = FALSE;
sr.SmallStartMenu = FALSE;
sr.Rect.left = sr.Rect.top = 0; sr.Rect.left = sr.Rect.top = 0;
sr.Rect.bottom = sr.Rect.right = 1; sr.Rect.bottom = sr.Rect.right = 1;
sr.Size.cx = sr.Size.cy = 0; sr.Size.cx = sr.Size.cy = 0;

View file

@ -23,7 +23,8 @@
HRESULT HRESULT
UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup,
IN HBITMAP hbmBanner OPTIONAL, IN HBITMAP hbmBanner OPTIONAL,
IN BOOL bSmallIcons) IN BOOL bSmallIcons,
IN BOOL bRefresh)
{ {
CComPtr<IBanneredBar> pbb; CComPtr<IBanneredBar> pbb;
HRESULT hRet; HRESULT hRet;
@ -37,6 +38,11 @@ UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup,
hRet = pbb->SetIconSize(bSmallIcons ? BMICON_SMALL : BMICON_LARGE); hRet = pbb->SetIconSize(bSmallIcons ? BMICON_SMALL : BMICON_LARGE);
} }
if (bRefresh)
{
FIXME("Refresh the Start menu with communicating with SHELL32\n");
}
return hRet; return hRet;
} }
@ -97,7 +103,7 @@ CreateStartMenu(IN ITrayWindow *Tray,
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return NULL; return NULL;
UpdateStartMenu(pMp, hbmBanner, bSmallIcons); UpdateStartMenu(pMp, hbmBanner, bSmallIcons, FALSE);
*ppMenuBand = pMb.Detach(); *ppMenuBand = pMb.Detach();

View file

@ -91,12 +91,12 @@ static VOID CALLBACK CustomSetAdvanced(const CUSTOM_ENTRY *entry, BOOL bValue)
static BOOL CALLBACK CustomGetSmallStartMenu(const CUSTOM_ENTRY *entry) static BOOL CALLBACK CustomGetSmallStartMenu(const CUSTOM_ENTRY *entry)
{ {
return g_TaskbarSettings.sr.SmallStartMenu; return g_TaskbarSettings.sr.SmSmallIcons;
} }
static VOID CALLBACK CustomSetSmallStartMenu(const CUSTOM_ENTRY *entry, BOOL bValue) static VOID CALLBACK CustomSetSmallStartMenu(const CUSTOM_ENTRY *entry, BOOL bValue)
{ {
g_TaskbarSettings.sr.SmallStartMenu = bValue; g_TaskbarSettings.sr.SmSmallIcons = bValue;
} }
static const CUSTOM_ENTRY s_CustomEntries[] = static const CUSTOM_ENTRY s_CustomEntries[] =

View file

@ -2554,9 +2554,9 @@ ChangePos:
RegLoadSettings(); RegLoadSettings();
/* Create and initialize the start menu */ /* Create and initialize the start menu */
BOOL bSmallStartMenu = g_TaskbarSettings.sr.SmallStartMenu;
HBITMAP hbmBanner = LoadBitmapW(hExplorerInstance, MAKEINTRESOURCEW(IDB_STARTMENU)); HBITMAP hbmBanner = LoadBitmapW(hExplorerInstance, MAKEINTRESOURCEW(IDB_STARTMENU));
m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, bSmallStartMenu); m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner,
g_TaskbarSettings.sr.SmSmallIcons);
/* Create the task band */ /* Create the task band */
hRet = CTaskBand_CreateInstance(this, m_StartButton.m_hWnd, IID_PPV_ARG(IDeskBand, &m_TaskBand)); hRet = CTaskBand_CreateInstance(this, m_StartButton.m_hWnd, IID_PPV_ARG(IDeskBand, &m_TaskBand));
@ -2661,13 +2661,19 @@ ChangePos:
if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0) if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
{ {
/* Re-create the start menu */
HideStartMenu(); HideStartMenu();
m_StartMenuBand.Release();
BOOL bSmallStartMenu = g_TaskbarSettings.sr.SmallStartMenu;
HBITMAP hbmBanner = LoadBitmapW(hExplorerInstance, MAKEINTRESOURCEW(IDB_STARTMENU)); HBITMAP hbmBanner = LoadBitmapW(hExplorerInstance, MAKEINTRESOURCEW(IDB_STARTMENU));
m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, bSmallStartMenu); #if 1 // FIXME: Please re-use the start menu
/* Re-create the start menu */
m_StartMenuBand.Release();
m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner,
g_TaskbarSettings.sr.SmSmallIcons);
FIXME("Use UpdateStartMenu\n");
#else
// Update the start menu
UpdateStartMenu(m_StartMenuPopup, hbmBanner, g_TaskbarSettings.sr.SmSmallIcons, TRUE);
#endif
} }
return 0; return 0;