summaryrefslogtreecommitdiff
path: root/src/gui/statuspopup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/statuspopup.cpp')
-rw-r--r--src/gui/statuspopup.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/statuspopup.cpp b/src/gui/statuspopup.cpp
index bb7a295ab..fee6450df 100644
--- a/src/gui/statuspopup.cpp
+++ b/src/gui/statuspopup.cpp
@@ -46,7 +46,7 @@
#include "debug.h"
StatusPopup::StatusPopup():
- Popup("StatusPopup")
+ Popup("StatusPopup", "statuspopup.xml")
{
const int fontHeight = getFont()->getHeight();
@@ -157,9 +157,8 @@ void StatusPopup::update()
minWidth += 16 + 2 * getPadding();
setWidth(minWidth);
- const int fontHeight = getFont()->getHeight();
-
- setHeight(24 + 8 + 14 * fontHeight + getPadding());
+ setHeight(mDisableGameModifiers->getY()
+ + mDisableGameModifiers->getHeight() + 2 * getPadding());
}
void StatusPopup::view(int x, int y)
@@ -169,9 +168,9 @@ void StatusPopup::view(int x, int y)
int posX = std::max(0, x - getWidth() / 2);
int posY = y + distance;
- if (posX + getWidth() > graphics->mWidth)
- posX = graphics->mWidth - getWidth();
- if (posY + getHeight() > graphics->mHeight)
+ if (posX + getWidth() > mainGraphics->mWidth)
+ posX = mainGraphics->mWidth - getWidth();
+ if (posY + getHeight() > mainGraphics->mHeight)
posY = y - getHeight() - distance;
update();