Browse Source

Merge pull request #1901 from rilian-la-te/disable-info-bar-scroll

InfoBar: disable scrollbar
Ivan Savenko 2 years ago
parent
commit
4d37686eb3
2 changed files with 4 additions and 6 deletions
  1. 2 4
      client/adventureMap/CInfoBar.cpp
  2. 2 2
      client/adventureMap/CInfoBar.h

+ 2 - 4
client/adventureMap/CInfoBar.cpp

@@ -173,7 +173,7 @@ CInfoBar::VisibleComponentInfo::VisibleComponentInfo(const std::vector<Component
 	auto fullRect = Rect(CInfoBar::offset, CInfoBar::offset, data_width - 2 * CInfoBar::offset, data_height - 2 * CInfoBar::offset);
 	auto textRect = fullRect;
 	auto imageRect = fullRect;
-	auto font = FONT_SMALL;
+	auto font = tiny ? FONT_TINY : FONT_SMALL;
 	auto maxComponents = 2; 
 
 	if(!compsToDisplay.empty())
@@ -210,11 +210,9 @@ CInfoBar::VisibleComponentInfo::VisibleComponentInfo(const std::vector<Component
 
 		comps = std::make_shared<CComponentBox>(vect, imageRect, 4, 4, 1, maxComponents);
 	}
-	else
-		font = tiny ? FONT_TINY : font;
 
 	if(!message.empty())
-		text = std::make_shared<CTextBox>(message, textRect, 0, font, ETextAlignment::CENTER, Colors::WHITE);
+		text = std::make_shared<CMultiLineLabel>(textRect, font, ETextAlignment::CENTER, Colors::WHITE, message);
 }
 
 void CInfoBar::playNewDaySound()

+ 2 - 2
client/adventureMap/CInfoBar.h

@@ -27,7 +27,7 @@ class CComponentBox;
 class CHeroTooltip;
 class CTownTooltip;
 class CLabel;
-class CTextBox;
+class CMultiLineLabel;
 
 /// Info box which shows next week/day information, hold the current date
 class CInfoBar : public CIntObject
@@ -112,7 +112,7 @@ private:
 	class VisibleComponentInfo : public CVisibleInfo
 	{
 		std::shared_ptr<CComponentBox> comps;
-		std::shared_ptr<CTextBox> text;
+		std::shared_ptr<CMultiLineLabel> text;
 	public:
 		struct Cache 
 		{