summaryrefslogtreecommitdiff
path: root/src/gui/beingpopup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/beingpopup.cpp')
-rw-r--r--src/gui/beingpopup.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp
index ee9fd66d..ae0b43fd 100644
--- a/src/gui/beingpopup.cpp
+++ b/src/gui/beingpopup.cpp
@@ -65,25 +65,28 @@ void BeingPopup::show(int x, int y, Being *b)
return;
}
+ mBeingName->setCaption(b->getName());
+ mBeingName->adjustSize();
+
+ int minWidth = mBeingName->getWidth();
+ const int height = getFont()->getHeight();
+
if (!(b->getPartyName().empty()))
{
- mBeingName->setCaption(b->getName());
- mBeingName->adjustSize();
-
mBeingParty->setCaption(strprintf(_("Party: %s"),
b->getPartyName().c_str()));
mBeingParty->adjustSize();
- int minWidth = std::max(mBeingName->getWidth(),
- mBeingParty->getWidth());
-
- const int height = getFont()->getHeight();
+ if (minWidth < mBeingParty->getWidth())
+ minWidth = mBeingParty->getWidth();
setContentSize(minWidth + 10, (height * 2) + 10);
-
- position(x, y);
- return;
+ }
+ else
+ {
+ mBeingParty->setCaption("");
+ setContentSize(minWidth + 10, height + 10);
}
- setVisible(false);
+ position(x, y);
}