From aa7e2fce49121bfbae4ad85fea836076234ba716 Mon Sep 17 00:00:00 2001 From: elexis Date: Tue, 22 Nov 2016 13:05:56 +0000 Subject: [PATCH] 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. --- source/gui/CDropDown.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/gui/CDropDown.cpp b/source/gui/CDropDown.cpp index 3a7e673208..73cecc40b3 100644 --- a/source/gui/CDropDown.cpp +++ b/source/gui/CDropDown.cpp @@ -382,24 +382,22 @@ InReaction CDropDown::ManuallyHandleEvent(const SDL_Event_* ev) void CDropDown::SetupListRect() { - float size, buffer, button_width; + float size, buffer; GUI::GetSetting(this, "dropdown_size", size); GUI::GetSetting(this, "dropdown_buffer", buffer); - GUI::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; } }