mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 22:13:27 +02:00
implement line wrap for text messages
This commit is contained in:
@@ -434,6 +434,7 @@ protected:
|
||||
public:
|
||||
void resizeToText() { setSize(getTextSize()); }
|
||||
void clearText() { setText(""); }
|
||||
void wrapText();
|
||||
|
||||
void setText(const std::string& text);
|
||||
void setTextAlign(Fw::AlignmentFlag align) { m_textAlign = align; m_textMustRecache = true; }
|
||||
|
@@ -84,6 +84,11 @@ void UIWidget::onFontChange(const std::string& font)
|
||||
callLuaField("onFontChange", font);
|
||||
}
|
||||
|
||||
void UIWidget::wrapText()
|
||||
{
|
||||
setText(m_font->wrapText(m_text, getWidth()));
|
||||
}
|
||||
|
||||
void UIWidget::setText(const std::string& text)
|
||||
{
|
||||
if(m_text == text)
|
||||
|
Reference in New Issue
Block a user