Skip to content

Commit

Permalink
Removed PanelListBox::ItemsWidth from PR #193
Browse files Browse the repository at this point in the history
  • Loading branch information
texus committed Apr 11, 2023
1 parent 1ab5f44 commit f31805e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
9 changes: 0 additions & 9 deletions include/TGUI/Widgets/PanelListBox.hpp
Expand Up @@ -113,15 +113,6 @@ TGUI_MODULE_EXPORT namespace tgui
TGUI_NODISCARD Panel::Ptr getPanelTemplate();


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Changes the width of the items in the list box
///
/// @param width The width of a single item in the list
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void setItemsWidth(const Layout& width) const;


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns the width of the items in the list box
///
Expand Down
14 changes: 0 additions & 14 deletions src/Widgets/PanelListBox.cpp
Expand Up @@ -138,17 +138,6 @@ namespace tgui

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void PanelListBox::setItemsWidth(const Layout& width) const
{
const auto panelWidth = width.getValue() == 0.f ? getSize().x : std::min(width.getValue(), getSize().x);
m_panelTemplate->setSize(panelWidth, m_panelTemplate->getSize().y);

updateItemsSize();
updateItemsPositions();
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Layout PanelListBox::getItemsWidth() const
{
return m_panelTemplate->getSize().x;
Expand Down Expand Up @@ -555,9 +544,6 @@ namespace tgui
if (node->propertyValuePairs[U"ItemsHeight"])
setItemsHeight(node->propertyValuePairs[U"ItemsHeight"]->value);

if (node->propertyValuePairs[U"ItemsWidth"])
setItemsWidth(node->propertyValuePairs[U"ItemsWidth"]->value);

if (node->propertyValuePairs[U"MaximumItems"])
{
unsigned max_items(0);
Expand Down
20 changes: 0 additions & 20 deletions tests/Widgets/PanelListBox.cpp
Expand Up @@ -223,26 +223,6 @@ TEST_CASE("[PanelListBox]")
REQUIRE(panelListBox->getItemsHeight().getValue() == 20);
}

SECTION("ItemsWidth")
{
panelListBox->setItemsWidth(20);
REQUIRE(panelListBox->getItemsWidth().getValue() == 0);

panelListBox->setSize(300, 400);

panelListBox->setItemsWidth(20);
REQUIRE(panelListBox->getItemsWidth().getValue() == 20);

panelListBox->setItemsWidth(2000);
REQUIRE(panelListBox->getItemsWidth().getValue() == 300);

panelListBox->setItemsWidth(20);
REQUIRE(panelListBox->getItemsWidth().getValue() == 20);

panelListBox->setItemsWidth(0);
REQUIRE(panelListBox->getItemsWidth().getValue() == 300);
}

SECTION("MaximumItems")
{
const auto panel1 = panelListBox->addItem("1");
Expand Down

0 comments on commit f31805e

Please sign in to comment.