Fix #3415. Removes 'ghost' scrollbar bounding to enable extreme-right hover and selection in dropdowns. Patch by elexis.
This was SVN commit r17149.
This commit is contained in:
parent
230654f6ca
commit
108633affd
@ -113,8 +113,9 @@ void CDropDown::HandleMessage(SGUIMessage& Message)
|
||||
if (mouse.y >= rect.top + m_ItemsYPositions[i] &&
|
||||
mouse.y < rect.top + m_ItemsYPositions[i+1] &&
|
||||
// mouse is not over scroll-bar
|
||||
!(mouse.x >= GetScrollBar(0).GetOuterRect().left &&
|
||||
mouse.x <= GetScrollBar(0).GetOuterRect().right))
|
||||
(m_HideScrollBar ||
|
||||
mouse.x < GetScrollBar(0).GetOuterRect().left ||
|
||||
mouse.x > GetScrollBar(0).GetOuterRect().right))
|
||||
{
|
||||
set = i;
|
||||
}
|
||||
@ -208,9 +209,10 @@ void CDropDown::HandleMessage(SGUIMessage& Message)
|
||||
return; // overshadow
|
||||
}
|
||||
|
||||
if (!(mouse.x >= GetScrollBar(0).GetOuterRect().left &&
|
||||
mouse.x <= GetScrollBar(0).GetOuterRect().right) &&
|
||||
mouse.y >= GetListRect().top)
|
||||
if (m_HideScrollBar ||
|
||||
mouse.x < GetScrollBar(0).GetOuterRect().left ||
|
||||
mouse.x > GetScrollBar(0).GetOuterRect().right ||
|
||||
mouse.y < GetListRect().top)
|
||||
{
|
||||
m_Open = false;
|
||||
GetScrollBar(0).SetZ(GetBufferedZ());
|
||||
|
@ -54,7 +54,7 @@ void CGUIScrollBarVertical::Draw()
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetGUI() && GetMaxPos() != 1)
|
||||
if (GetGUI() && IsVisible())
|
||||
{
|
||||
CRect outline = GetOuterRect();
|
||||
|
||||
|
@ -200,8 +200,9 @@ void CList::HandleMessage(SGUIMessage& Message)
|
||||
if (mouse.y >= rect.top + m_ItemsYPositions[i] &&
|
||||
mouse.y < rect.top + m_ItemsYPositions[i+1] &&
|
||||
// mouse is not over scroll-bar
|
||||
!(mouse.x >= GetScrollBar(0).GetOuterRect().left &&
|
||||
mouse.x <= GetScrollBar(0).GetOuterRect().right))
|
||||
(!scrollbar || !GetScrollBar(0).IsVisible() ||
|
||||
mouse.x < GetScrollBar(0).GetOuterRect().left ||
|
||||
mouse.x > GetScrollBar(0).GetOuterRect().right))
|
||||
{
|
||||
set = i;
|
||||
}
|
||||
|
@ -209,6 +209,11 @@ public:
|
||||
*/
|
||||
float GetMaxPos() const { return std::max(1.f, m_ScrollRange - m_ScrollSpace); }
|
||||
|
||||
/**
|
||||
* Get the value of m_Pos that corresponds to the bottom of the scrollable region
|
||||
*/
|
||||
float IsVisible() const { return GetMaxPos() != 1.f; }
|
||||
|
||||
/**
|
||||
* Increase scroll one step
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user