summaryrefslogtreecommitdiff
path: root/src/gui/textpopup.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-26 22:20:07 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-26 22:23:15 +0200
commit2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118 (patch)
tree8e25c930ce9742b919b90f583d37445c1a81fa1d /src/gui/textpopup.cpp
parent8331284990b8d998a7e323e6fcf3c25f2f7d60d8 (diff)
downloadmana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.tar.gz
mana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.tar.bz2
mana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.tar.xz
mana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.zip
Fixed the dimensions of the popup/tooltip
Diffstat (limited to 'src/gui/textpopup.cpp')
-rw-r--r--src/gui/textpopup.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/textpopup.cpp b/src/gui/textpopup.cpp
index 57f80275..aca02a6d 100644
--- a/src/gui/textpopup.cpp
+++ b/src/gui/textpopup.cpp
@@ -43,10 +43,10 @@ TextPopup::TextPopup():
const int fontHeight = getFont()->getHeight();
mText1 = new Label;
- mText1->setPosition(getPadding(), getPadding());
+ mText1->setPosition(0, 0);
mText2 = new Label;
- mText2->setPosition(getPadding(), fontHeight + getPadding());
+ mText2->setPosition(0, fontHeight);
add(mText1);
add(mText2);
@@ -68,13 +68,10 @@ void TextPopup::show(int x, int y, const std::string &str1, const std::string &s
if (mText2->getWidth() > minWidth)
minWidth = mText2->getWidth();
- minWidth += 4 * getPadding();
- setWidth(minWidth);
-
if (!str2.empty())
- setHeight((getPadding() + mText1->getFont()->getHeight()) * 2);
+ setContentSize(minWidth, mText1->getFont()->getHeight() * 2);
else
- setHeight(2 * getPadding() + mText1->getFont()->getHeight());
+ setContentSize(minWidth, mText1->getFont()->getHeight());
const int distance = 20;