summaryrefslogtreecommitdiff
path: root/src/gui/beingpopup.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-01 20:41:41 -0700
committerJared Adams <jaxad0127@gmail.com>2010-03-01 20:46:17 -0700
commit76b306a5a2eff9f9a6bb65b3d784cc8e31ba6cce (patch)
tree7a7c43fb950add7ab991459cf91af23c02cb4309 /src/gui/beingpopup.cpp
parent67e678094b9fddd21fb3c690130e772937ab2746 (diff)
downloadmana-76b306a5a2eff9f9a6bb65b3d784cc8e31ba6cce.tar.gz
mana-76b306a5a2eff9f9a6bb65b3d784cc8e31ba6cce.tar.bz2
mana-76b306a5a2eff9f9a6bb65b3d784cc8e31ba6cce.tar.xz
mana-76b306a5a2eff9f9a6bb65b3d784cc8e31ba6cce.zip
Simplify BeignPopup and therefore Viewport
Diffstat (limited to 'src/gui/beingpopup.cpp')
-rw-r--r--src/gui/beingpopup.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp
index 7fd99371..33fdff44 100644
--- a/src/gui/beingpopup.cpp
+++ b/src/gui/beingpopup.cpp
@@ -27,7 +27,7 @@
#include "gui/gui.h"
#include "gui/palette.h"
-#include "gui/widgets/textbox.h"
+#include "gui/widgets/label.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -39,14 +39,14 @@ BeingPopup::BeingPopup():
Popup("BeingPopup")
{
// Being Name
- mBeingName = new TextBox();
+ mBeingName = new Label("A");
mBeingName->setFont(boldFont);
mBeingName->setPosition(getPadding(), getPadding());
- const int fontHeight = getFont()->getHeight();
+ const int fontHeight = mBeingName->getHeight() + getPadding();
// Being's party
- mBeingParty = new TextBox();
+ mBeingParty = new Label("A");
mBeingParty->setPosition(getPadding(), fontHeight);
add(mBeingName);
@@ -69,12 +69,15 @@ void BeingPopup::show(int x, int y, Player *p)
if (!(p->getPartyName().empty()))
{
- mBeingName->setTextWrapped(p->getName(), 196);
- mBeingParty->setTextWrapped(strprintf(_("Party: %s"),
- p->getPartyName().c_str()), 196);
+ mBeingName->setCaption(p->getName());
+ mBeingName->adjustSize();
- int minWidth = std::max(mBeingName->getMinWidth(),
- mBeingParty->getMinWidth());
+ mBeingParty->setCaption(strprintf(_("Party: %s"),
+ p->getPartyName().c_str()));
+ mBeingParty->adjustSize();
+
+ int minWidth = std::max(mBeingName->getWidth(),
+ mBeingParty->getWidth());
const int height = getFont()->getHeight();