From 4f17ea26d6353499d074489e7660265cad057243 Mon Sep 17 00:00:00 2001 From: Bruno Van de Velde Date: Mon, 14 Aug 2017 19:48:23 +0200 Subject: [PATCH] Fixed ComboBox::addItem incorrectly setting the ListBox size --- src/TGUI/Widgets/ComboBox.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/TGUI/Widgets/ComboBox.cpp b/src/TGUI/Widgets/ComboBox.cpp index 1dd958c1..de260297 100644 --- a/src/TGUI/Widgets/ComboBox.cpp +++ b/src/TGUI/Widgets/ComboBox.cpp @@ -247,11 +247,9 @@ namespace tgui bool ComboBox::addItem(const sf::String& item, const sf::String& id) { - // Make room to add another item, until there are enough items - if ((m_nrOfItemsToDisplay == 0) || (m_listBox->getItemCount() < m_nrOfItemsToDisplay)) - updateListBoxHeight(); - - return m_listBox->addItem(item, id); + const bool ret = m_listBox->addItem(item, id); + updateListBoxHeight(); + return ret; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////