https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ea0cc1c7831dbe7dec31f…
commit ea0cc1c7831dbe7dec31f4f495befb5dfa90ab5c
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Sun Apr 22 15:42:10 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Apr 22 15:42:29 2018 +0200
[BROWSEUI] Apply a hack to prevent truncating the address bar text.
CORE-13003
---
dll/win32/browseui/addressband.cpp | 31 +++++++++++++++++++++++++++++--
dll/win32/browseui/addressband.h | 1 +
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/dll/win32/browseui/addressband.cpp b/dll/win32/browseui/addressband.cpp
index c319dbd628..0bc3e971e2 100644
--- a/dll/win32/browseui/addressband.cpp
+++ b/dll/win32/browseui/addressband.cpp
@@ -43,6 +43,7 @@ CAddressBand::CAddressBand()
fGoButton = NULL;
fComboBox = NULL;
fGoButtonShown = false;
+ fAdjustNeeded = 0;
}
CAddressBand::~CAddressBand()
@@ -66,7 +67,10 @@ HRESULT STDMETHODCALLTYPE CAddressBand::GetBandInfo(DWORD dwBandID,
DWORD dwView
{
if (pdbi->dwMask & DBIM_MINSIZE)
{
- pdbi->ptMinSize.x = 100;
+ if (fGoButtonShown)
+ pdbi->ptMinSize.x = 100;
+ else
+ pdbi->ptMinSize.x = 150;
pdbi->ptMinSize.y = 22;
}
if (pdbi->dwMask & DBIM_MAXSIZE)
@@ -81,7 +85,10 @@ HRESULT STDMETHODCALLTYPE CAddressBand::GetBandInfo(DWORD dwBandID,
DWORD dwView
}
if (pdbi->dwMask & DBIM_ACTUAL)
{
- pdbi->ptActual.x = 100;
+ if (fGoButtonShown)
+ pdbi->ptActual.x = 100;
+ else
+ pdbi->ptActual.x = 150;
pdbi->ptActual.y = 22;
}
if (pdbi->dwMask & DBIM_TITLE)
@@ -451,6 +458,8 @@ LRESULT CAddressBand::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam,
BOOL &bHan
long newHeight;
long newWidth;
+ fAdjustNeeded = 1;
+
if (fGoButtonShown == false)
{
bHandled = FALSE;
@@ -505,6 +514,24 @@ LRESULT CAddressBand::OnWindowPosChanging(UINT uMsg, WPARAM wParam,
LPARAM lPara
positionInfoCopy = *reinterpret_cast<WINDOWPOS *>(lParam);
newHeight = positionInfoCopy.cy;
newWidth = positionInfoCopy.cx;
+
+/*
+ Sometimes when we get here newWidth = 100 which comes from GetBandInfo and is less
than the 200 that we need.
+ We need room for the "Address" text (50 pixels), the "GoButton"
(50 pixels), the left and right borders (30 pixels)
+ the icon (20 pixels) and the ComboBox (50 pixels) for handling the text of the
current directory. This is 200 pixels.
+ When newWidth = 100 the Addressband ComboBox will only have a single character
because it becomes 2 pixels wide.
+ The hack below readjusts the width to the minimum required to allow seeing the whole
text and prints out a debug message.
+*/
+
+ if ((newWidth < 200) && (newWidth != 0))
+ {
+ if (fAdjustNeeded == 1)
+ {
+ ERR("CORE-13003 HACK: Addressband ComboBox width readjusted from %ld to
200.\n", newWidth);
+ newWidth = 200;
+ fAdjustNeeded = 0;
+ }
+ }
SendMessage(fGoButton, TB_GETITEMRECT, 0,
reinterpret_cast<LPARAM>(&buttonBounds));
buttonWidth = buttonBounds.right - buttonBounds.left;
diff --git a/dll/win32/browseui/addressband.h b/dll/win32/browseui/addressband.h
index 5d345bcb14..eaba14282a 100644
--- a/dll/win32/browseui/addressband.h
+++ b/dll/win32/browseui/addressband.h
@@ -43,6 +43,7 @@ private:
bool fGoButtonShown;
HIMAGELIST m_himlNormal;
HIMAGELIST m_himlHot;
+ INT fAdjustNeeded;
public:
CAddressBand();