https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bab9a540396e6b21e1e86…
commit bab9a540396e6b21e1e863f87cc38319cc9dbd44
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Fri Oct 20 16:23:17 2017 +0300
[BROWSEUI] Add a hack and abuse ISFB_STATE_QLINKSMODE to make the quick launch band to
be aligned to left and show no text
---
dll/win32/browseui/shellbars/CBandSiteMenu.cpp | 7 +++++++
dll/win32/browseui/shellbars/CISFBand.cpp | 19 ++++++++++++++++---
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
index 300a2ccb40..0f8089791d 100644
--- a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
+++ b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp
@@ -184,6 +184,13 @@ HRESULT CBandSiteMenu::_CreateBuiltInISFBand(UINT uID, REFIID riid,
void** ppv)
if (FAILED_UNEXPECTEDLY(hr))
return hr;
+ /* HACK! We shouldn't pass ISFB_STATE_QLINKSMODE and CISFBand shouldn't
handle it! */
+ if (uID == IDM_TASKBAR_TOOLBARS_QUICKLAUNCH)
+ {
+ BANDINFOSFB bisfb = {ISFB_MASK_STATE, ISFB_STATE_QLINKSMODE,
ISFB_STATE_QLINKSMODE};
+ pISFB->SetBandInfoSFB(&bisfb);
+ }
+
return pISFB->QueryInterface(riid, ppv);
}
diff --git a/dll/win32/browseui/shellbars/CISFBand.cpp
b/dll/win32/browseui/shellbars/CISFBand.cpp
index 65a146ada7..6e4bb36a7f 100644
--- a/dll/win32/browseui/shellbars/CISFBand.cpp
+++ b/dll/win32/browseui/shellbars/CISFBand.cpp
@@ -71,6 +71,9 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent)
if (m_hWnd == NULL)
return E_FAIL;
+ if (!m_textFlag)
+ SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
+
// Set the image list.
HIMAGELIST* piml;
HRESULT hr = SHGetImageList(SHIL_SMALL, IID_IImageList, (void**)&piml);
@@ -243,7 +246,10 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent)
if (pdbi->dwMask & DBIM_MINSIZE)
{
- pdbi->ptMinSize.x = -1;
+ if (m_QLaunch)
+ pdbi->ptMinSize.x = idealSize.x;
+ else
+ pdbi->ptMinSize.x = -1;
pdbi->ptMinSize.y = idealSize.y;
}
if (pdbi->dwMask & DBIM_MAXSIZE)
@@ -260,14 +266,18 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent)
}
if (pdbi->dwMask & DBIM_TITLE)
{
- if (!ILGetDisplayNameEx(NULL, m_pidl, pdbi->wszTitle,
ILGDN_INFOLDER))
+ if (m_QLaunch || !ILGetDisplayNameEx(NULL, m_pidl, pdbi->wszTitle,
ILGDN_INFOLDER))
{
pdbi->dwMask &= ~DBIM_TITLE;
}
}
if (pdbi->dwMask & DBIM_MODEFLAGS)
{
- pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT |
DBIMF_USECHEVRON | DBIMF_NOMARGINS | DBIMF_BKCOLOR | DBIMF_ADDTOFRONT;
+ pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT |
DBIMF_USECHEVRON | DBIMF_NOMARGINS | DBIMF_BKCOLOR;
+ if (m_QLaunch)
+ {
+ pdbi->dwModeFlags |= DBIMF_ADDTOFRONT;
+ }
}
if (pdbi->dwMask & DBIM_BKCOLOR)
pdbi->dwMask &= ~DBIM_BKCOLOR;
@@ -509,6 +519,9 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent)
(pbi->dwStateMask & ISFB_STATE_QLINKSMODE))
{
m_QLaunch = true;
+ m_textFlag = false;
+ if (m_hWnd)
+ SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
}
return E_NOTIMPL;