From 74348be6067e2d0b319e8fd522c87afafefe9c83 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sat, 22 Jul 2017 09:13:33 +0000 Subject: [PATCH] [EXPLORER] -Implement the minimum taskbar size for the vertical position. svn path=/trunk/; revision=75386 --- reactos/base/shell/explorer/taskband.cpp | 30 +++++++++--------------- reactos/base/shell/explorer/traywnd.cpp | 8 ++++++- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/reactos/base/shell/explorer/taskband.cpp b/reactos/base/shell/explorer/taskband.cpp index b079478ced7..b7bc13388df 100644 --- a/reactos/base/shell/explorer/taskband.cpp +++ b/reactos/base/shell/explorer/taskband.cpp @@ -40,15 +40,11 @@ class CTaskBand : CComPtr m_Site; HWND m_hWnd; - HWND m_hWndStartButton; - DWORD m_BandID; public: CTaskBand() : - m_hWnd(NULL), - m_BandID(0) + m_hWnd(NULL) { - } virtual ~CTaskBand() { } @@ -117,32 +113,30 @@ public: /* FIXME: What about DBIMF_NOGRIPPER and DBIMF_ALWAYSGRIPPER */ pdbi->dwModeFlags = DBIMF_VARIABLEHEIGHT; + /* Obtain the button size, to be used as the minimum size */ + DWORD size = SendMessageW(hwndToolbar, TB_GETBUTTONSIZE, 0, 0); + pdbi->ptMinSize.x = 0; + pdbi->ptMinSize.y = GET_Y_LPARAM(size); + if (dwViewMode & DBIF_VIEWMODE_VERTICAL) { + pdbi->ptIntegral.x = 0; pdbi->ptIntegral.y = 1; - pdbi->ptMinSize.y = 1; - /* FIXME: Get the button metrics from the task bar object!!! */ - pdbi->ptMinSize.x = (3 * GetSystemMetrics(SM_CXEDGE) / 2) + /* FIXME: Might be wrong if only one column! */ - GetSystemMetrics(SM_CXSIZE) + (2 * GetSystemMetrics(SM_CXEDGE)); /* FIXME: Min button size, query!!! */ } else { - /* Obtain the button size, to be used as the integral size */ - DWORD size = SendMessageW(hwndToolbar, TB_GETBUTTONSIZE, 0, 0); pdbi->ptIntegral.x = 0; pdbi->ptIntegral.y = GET_Y_LPARAM(size); - pdbi->ptMinSize = pdbi->ptIntegral; } /* Ignored: pdbi->ptMaxSize.x */ pdbi->ptMaxSize.y = -1; + RECT rcToolbar; + ::GetWindowRect(hwndToolbar, &rcToolbar); /* FIXME: We should query the height from the task bar object!!! */ - pdbi->ptActual.y = GetSystemMetrics(SM_CYSIZE) + (2 * GetSystemMetrics(SM_CYEDGE)); - - /* Save the band ID for future use in case we need to check whether a given band - is the task band */ - m_BandID = dwBandID; + pdbi->ptActual.x = rcToolbar.right - rcToolbar.left; + pdbi->ptActual.y = rcToolbar.bottom - rcToolbar.top; TRACE("H: %d, Min: %d,%d, Integral.y: %d Actual: %d,%d\n", (dwViewMode & DBIF_VIEWMODE_VERTICAL) == 0, pdbi->ptMinSize.x, pdbi->ptMinSize.y, pdbi->ptIntegral.y, @@ -334,8 +328,6 @@ public: HRESULT STDMETHODCALLTYPE Initialize(IN OUT ITrayWindow *tray, HWND hWndStartButton) { m_Tray = tray; - m_BandID = (DWORD) -1; - m_hWndStartButton = hWndStartButton; return S_OK; } diff --git a/reactos/base/shell/explorer/traywnd.cpp b/reactos/base/shell/explorer/traywnd.cpp index 36a09e5f2cb..bb2b6aec828 100644 --- a/reactos/base/shell/explorer/traywnd.cpp +++ b/reactos/base/shell/explorer/traywnd.cpp @@ -1688,8 +1688,14 @@ ChangePos: pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy); break; case ABE_LEFT: + rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx); + ::SendMessageW(m_Rebar, RB_SIZETORECT, RBSTR_CHANGERECT, (LPARAM)&rebarRect); + pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx); + break; case ABE_RIGHT: - /* FIXME: what to do here? */ + rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx); + ::SendMessageW(m_Rebar, RB_SIZETORECT, RBSTR_CHANGERECT, (LPARAM)&rebarRect); + pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx); break; } -- 2.17.1