diff --git a/client/lobby/SelectionTab.cpp b/client/lobby/SelectionTab.cpp index 1a5a079d4..02bd79705 100644 --- a/client/lobby/SelectionTab.cpp +++ b/client/lobby/SelectionTab.cpp @@ -866,11 +866,13 @@ void SelectionTab::ListItem::updateItem(std::shared_ptr info, bool iconLossCondition->disable(); labelNumberOfCampaignMaps->disable(); labelName->enable(); + labelName->setMaxWidth(316); labelName->setText(info->folderName); labelName->setColor(color); return; } + labelName->enable(); if(info->campaign) { labelAmountOfPlayers->disable(); @@ -885,6 +887,7 @@ void SelectionTab::ListItem::updateItem(std::shared_ptr info, bool ostr << info->campaign->scenariosCount(); labelNumberOfCampaignMaps->setText(ostr.str()); labelNumberOfCampaignMaps->setColor(color); + labelName->setMaxWidth(316); } else { @@ -905,8 +908,8 @@ void SelectionTab::ListItem::updateItem(std::shared_ptr info, bool iconVictoryCondition->setFrame(info->mapHeader->victoryIconIndex, 0); iconLossCondition->enable(); iconLossCondition->setFrame(info->mapHeader->defeatIconIndex, 0); + labelName->setMaxWidth(185); } - labelName->enable(); labelName->setText(info->getNameForList()); labelName->setColor(color); } diff --git a/client/widgets/TextControls.cpp b/client/widgets/TextControls.cpp index 37d7b7091..344d20757 100644 --- a/client/widgets/TextControls.cpp +++ b/client/widgets/TextControls.cpp @@ -95,6 +95,11 @@ void CLabel::setText(const std::string & Txt) } } +void CLabel::setMaxWidth(int width) +{ + maxWidth = width; +} + void CLabel::trimText() { if(maxWidth > 0) diff --git a/client/widgets/TextControls.h b/client/widgets/TextControls.h index 8da63d07f..7c6b5266b 100644 --- a/client/widgets/TextControls.h +++ b/client/widgets/TextControls.h @@ -55,6 +55,7 @@ public: std::string getText(); virtual void setAutoRedraw(bool option); virtual void setText(const std::string & Txt); + virtual void setMaxWidth(int width); virtual void setColor(const ColorRGBA & Color); size_t getWidth();