diff options
Diffstat (limited to 'src/gui/textbox.cpp')
-rw-r--r-- | src/gui/textbox.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp index ee03c79d..fb5a39e6 100644 --- a/src/gui/textbox.cpp +++ b/src/gui/textbox.cpp @@ -31,9 +31,10 @@ TextBox::TextBox(): { setOpaque(false); setFrameSize(0); + mMinWidth = getWidth(); } -void TextBox::setTextWrapped(const std::string &text) +void TextBox::setTextWrapped(const std::string &text, int minDimension) { // Make sure parent scroll area sets width of this widget if (getParent()) @@ -41,6 +42,9 @@ void TextBox::setTextWrapped(const std::string &text) getParent()->logic(); } + // Take the supplied minimum dimension as a starting point and try to beat it + mMinWidth = minDimension; + std::stringstream wrappedStream; std::string::size_type newlinePos, lastNewlinePos = 0; int minWidth = 0; |