forked from 0ad/0ad
Don't subtract the scrollbar size from GUI dropdowns when there is no scrollbar. Patch by Imarok, reviewed by mimo, refs #3571.
Remove unused button_width. This was SVN commit r18984.
This commit is contained in:
parent
0b03713b3b
commit
aa7e2fce49
@ -382,24 +382,22 @@ InReaction CDropDown::ManuallyHandleEvent(const SDL_Event_* ev)
|
||||
|
||||
void CDropDown::SetupListRect()
|
||||
{
|
||||
float size, buffer, button_width;
|
||||
float size, buffer;
|
||||
GUI<float>::GetSetting(this, "dropdown_size", size);
|
||||
GUI<float>::GetSetting(this, "dropdown_buffer", buffer);
|
||||
GUI<float>::GetSetting(this, "button_width", button_width);
|
||||
|
||||
if (m_ItemsYPositions.empty() || m_ItemsYPositions.back() >= size)
|
||||
{
|
||||
m_CachedListRect = CRect(m_CachedActualSize.left, m_CachedActualSize.bottom+buffer,
|
||||
m_CachedActualSize.right, m_CachedActualSize.bottom+buffer + size);
|
||||
m_CachedActualSize.right, m_CachedActualSize.bottom+buffer + size);
|
||||
|
||||
m_HideScrollBar = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CachedListRect = CRect(m_CachedActualSize.left, m_CachedActualSize.bottom+buffer,
|
||||
m_CachedActualSize.right - GetScrollBar(0).GetStyle()->m_Width, m_CachedActualSize.bottom+buffer + m_ItemsYPositions.back());
|
||||
m_CachedActualSize.right, m_CachedActualSize.bottom+buffer + m_ItemsYPositions.back());
|
||||
|
||||
// We also need to hide the scrollbar
|
||||
m_HideScrollBar = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user