1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

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

InfoBar: disable scrollbar
This commit is contained in:
Ivan Savenko
2023-04-08 19:12:48 +03:00
committed by GitHub
2 changed files with 4 additions and 6 deletions

View File

@@ -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()

View File

@@ -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
{