diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-07 23:12:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-09 18:54:45 +0300 |
commit | 352409f22230698bc32661b916f708663a4179b5 (patch) | |
tree | ae61ad48814a076ae5f32137c297fc1b3198ab7c /src/gui/widgets/browserbox.cpp | |
parent | 59ce7917ffb4e6b89593a54fed590d439585ae5f (diff) | |
download | manaverse-352409f22230698bc32661b916f708663a4179b5.tar.gz manaverse-352409f22230698bc32661b916f708663a4179b5.tar.bz2 manaverse-352409f22230698bc32661b916f708663a4179b5.tar.xz manaverse-352409f22230698bc32661b916f708663a4179b5.zip |
Add "did you know?" dialog and some messages for it.
Fix browserbox images position and size.
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index f3ee7270b..140a72770 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -368,6 +368,8 @@ int BrowserBox::calcHeight() { unsigned x = 0, y = 0; int wrappedLines = 0; + int moreHeight = 0; + int maxWidth = getWidth(); int link = 0; if (getWidth() < 0) return 1; @@ -412,8 +414,12 @@ int BrowserBox::calcHeight() Image *img = resman->getImage(str); if (img) { + img->incRef(); mLineParts.push_back(LinePart(x, y, selColor, img)); - y += img->getHeight(); + y += img->getHeight() + 2; + moreHeight += img->getHeight(); + if (img->getWidth() > maxWidth) + maxWidth = img->getWidth() + 2; } continue; } @@ -570,7 +576,11 @@ int BrowserBox::calcHeight() } y += fontHeight; } - return (static_cast<int>(mTextRows.size()) + wrappedLines) * fontHeight; + if (getWidth() != maxWidth) + setWidth(maxWidth); + + return (static_cast<int>(mTextRows.size()) + wrappedLines) + * fontHeight + moreHeight; } void BrowserBox::updateHeight() |