summaryrefslogtreecommitdiff
path: root/src/gui/textpopup.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-10 04:36:19 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-10 04:36:19 +0200
commiteb1428dded5d2be98eff034fd26a08c109d2376c (patch)
tree3672f9023151e496d1066a1fcdf9ae03ec478917 /src/gui/textpopup.cpp
parentf74cf5eb61deccc478d2a4cbc7a352748d96c65e (diff)
downloadplus-eb1428dded5d2be98eff034fd26a08c109d2376c.tar.gz
plus-eb1428dded5d2be98eff034fd26a08c109d2376c.tar.bz2
plus-eb1428dded5d2be98eff034fd26a08c109d2376c.tar.xz
plus-eb1428dded5d2be98eff034fd26a08c109d2376c.zip
Add to text popups bar name in top left corner.
Diffstat (limited to 'src/gui/textpopup.cpp')
-rw-r--r--src/gui/textpopup.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/gui/textpopup.cpp b/src/gui/textpopup.cpp
index 270b0f759..695319647 100644
--- a/src/gui/textpopup.cpp
+++ b/src/gui/textpopup.cpp
@@ -46,8 +46,12 @@ TextPopup::TextPopup():
mText2 = new gcn::Label;
mText2->setPosition(getPadding(), fontHeight + 2 * getPadding());
+ mText3 = new gcn::Label;
+ mText3->setPosition(getPadding(), (2 * fontHeight) + 2 * getPadding());
+
add(mText1);
add(mText2);
+ add(mText3);
addMouseListener(this);
}
@@ -56,24 +60,31 @@ TextPopup::~TextPopup()
}
void TextPopup::show(int x, int y, const std::string &str1,
- const std::string &str2)
+ const std::string &str2, const std::string &str3)
{
mText1->setCaption(str1);
mText1->adjustSize();
mText2->setCaption(str2);
mText2->adjustSize();
+ mText3->setCaption(str3);
+ mText3->adjustSize();
int minWidth = mText1->getWidth();
if (mText2->getWidth() > minWidth)
minWidth = mText2->getWidth();
+ if (mText3->getWidth() > minWidth)
+ minWidth = mText3->getWidth();
minWidth += 4 * getPadding();
setWidth(minWidth);
+ int cnt = 1;
if (!str2.empty())
- setHeight((2 * getPadding() + mText1->getFont()->getHeight()) * 2);
- else
- setHeight(2 * getPadding() + mText1->getFont()->getHeight());
+ cnt ++;
+ if (!str3.empty())
+ cnt ++;
+
+ setHeight((2 * getPadding() + mText1->getFont()->getHeight()) * cnt);
const int distance = 20;