summaryrefslogtreecommitdiff
path: root/src/gui/textpopup.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-04 12:00:17 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-04 12:00:17 +0300
commit66d469fe20cff2749316afe3ba44ad74acfc1557 (patch)
tree15267204b4ab85be7b3e2ad64e7d7be6290be1bc /src/gui/textpopup.cpp
parenta78b3a34de86d181f845f352b3c4a58e6ff03872 (diff)
downloadmanaverse-66d469fe20cff2749316afe3ba44ad74acfc1557.tar.gz
manaverse-66d469fe20cff2749316afe3ba44ad74acfc1557.tar.bz2
manaverse-66d469fe20cff2749316afe3ba44ad74acfc1557.tar.xz
manaverse-66d469fe20cff2749316afe3ba44ad74acfc1557.zip
Fix popups sizes and padding.
Diffstat (limited to 'src/gui/textpopup.cpp')
-rw-r--r--src/gui/textpopup.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/textpopup.cpp b/src/gui/textpopup.cpp
index d542bdcde..02b330b9a 100644
--- a/src/gui/textpopup.cpp
+++ b/src/gui/textpopup.cpp
@@ -28,6 +28,7 @@
#include "gui/theme.h"
#include "gui/widgets/label.h"
+#include "gui/widgets/layouthelper.h"
#include "units.h"
@@ -45,11 +46,11 @@ TextPopup::TextPopup():
{
const int fontHeight = getFont()->getHeight();
- mText1->setPosition(getPadding(), getPadding());
+ mText1->setPosition(0, 0);
mText1->setForegroundColor(Theme::getThemeColor(Theme::POPUP));
- mText2->setPosition(getPadding(), fontHeight + 2 * getPadding());
+ mText2->setPosition(0, fontHeight);
mText2->setForegroundColor(Theme::getThemeColor(Theme::POPUP));
- mText3->setPosition(getPadding(), (2 * fontHeight) + 2 * getPadding());
+ mText3->setPosition(0, 2 * fontHeight);
mText3->setForegroundColor(Theme::getThemeColor(Theme::POPUP));
add(mText1);
@@ -78,7 +79,7 @@ void TextPopup::show(const int x, const int y, const std::string &str1,
if (mText3->getWidth() > minWidth)
minWidth = mText3->getWidth();
- minWidth += 4 * getPadding();
+ minWidth += 2 * getPadding();
setWidth(minWidth);
int cnt = 1;
@@ -87,8 +88,7 @@ void TextPopup::show(const int x, const int y, const std::string &str1,
if (!str3.empty())
cnt ++;
- setHeight((2 * getPadding() + mText1->getFont()->getHeight()) * cnt);
-
+ setHeight(2 * getPadding() + mText1->getFont()->getHeight() * cnt);
const int distance = 20;
int posX = std::max(0, x - getWidth() / 2);