summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/guiButton.cpp1
-rw-r--r--src/gui/guiFormSpecMenu.cpp15
2 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/guiButton.cpp b/src/gui/guiButton.cpp
index ed79999cf..f7a0af2d9 100644
--- a/src/gui/guiButton.cpp
+++ b/src/gui/guiButton.cpp
@@ -53,7 +53,6 @@ GUIButton::GUIButton(IGUIEnvironment* environment, IGUIElement* parent,
core::clamp<u32>(Colors[i].getGreen() * COLOR_PRESSED_MOD, 0, 255),
core::clamp<u32>(Colors[i].getBlue() * COLOR_PRESSED_MOD, 0, 255));
}
-
StaticText = gui::StaticText::add(Environment, Text.c_str(), core::rect<s32>(0,0,rectangle.getWidth(),rectangle.getHeight()), false, false, this, id);
StaticText->setTextAlignment(EGUIA_CENTER, EGUIA_CENTER);
// END PATCH
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index a91623f96..d03ce4516 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -3417,19 +3417,16 @@ void GUIFormSpecMenu::drawMenu()
void GUIFormSpecMenu::showTooltip(const std::wstring &text,
const irr::video::SColor &color, const irr::video::SColor &bgcolor)
{
- const std::wstring ntext = translate_string(text);
- m_tooltip_element->setOverrideColor(color);
- m_tooltip_element->setBackgroundColor(bgcolor);
- setStaticText(m_tooltip_element, ntext.c_str());
+ EnrichedString ntext(text);
+ ntext.setDefaultColor(color);
+ ntext.setBackground(bgcolor);
+
+ setStaticText(m_tooltip_element, ntext);
// Tooltip size and offset
s32 tooltip_width = m_tooltip_element->getTextWidth() + m_btn_height;
-#if (IRRLICHT_VERSION_MAJOR <= 1 && IRRLICHT_VERSION_MINOR <= 8 && IRRLICHT_VERSION_REVISION < 2) || USE_FREETYPE == 1
- std::vector<std::wstring> text_rows = str_split(ntext, L'\n');
- s32 tooltip_height = m_tooltip_element->getTextHeight() * text_rows.size() + 5;
-#else
s32 tooltip_height = m_tooltip_element->getTextHeight() + 5;
-#endif
+
v2u32 screenSize = Environment->getVideoDriver()->getScreenSize();
int tooltip_offset_x = m_btn_height;
int tooltip_offset_y = m_btn_height;