mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	different max width
This commit is contained in:
		| @@ -866,11 +866,13 @@ void SelectionTab::ListItem::updateItem(std::shared_ptr<ElementInfo> 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<ElementInfo> 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<ElementInfo> 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); | ||||
| } | ||||
|   | ||||
| @@ -95,6 +95,11 @@ void CLabel::setText(const std::string & Txt) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void CLabel::setMaxWidth(int width) | ||||
| { | ||||
| 	maxWidth = width; | ||||
| } | ||||
|  | ||||
| void CLabel::trimText() | ||||
| { | ||||
| 	if(maxWidth > 0) | ||||
|   | ||||
| @@ -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(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user