summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-03-11 18:06:30 -0600
committerIra Rice <irarice@gmail.com>2009-03-11 18:06:30 -0600
commitc2ae6d9cea9fc3d861e73d4cf7eca5284519758e (patch)
treee52abe836ff96446ec3109cf7c273dd7ee35c1e8 /src/gui/popupmenu.cpp
parent6b538196a799525d8ad4bf5cb5affe87745d4242 (diff)
downloadmana-client-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.tar.gz
mana-client-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.tar.bz2
mana-client-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.tar.xz
mana-client-c2ae6d9cea9fc3d861e73d4cf7eca5284519758e.zip
Added a new Popup class, which overall is functionally similar to the
Window class, but stripped down to the bare essential functionality to just draw and position them. This means no resizing, no close buttons, no ability to move them, etc. This should help reduce the overhead in drawing speech bubbles, as well as other popup type dialogs, but is also not a drop in replacement for the Window class as well. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index cead20ed..02be3055 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -27,11 +27,11 @@
#include "inventorywindow.h"
#include "item_amount.h"
#include "popupmenu.h"
-#include "windowcontainer.h"
#include "../being.h"
#include "../beingmanager.h"
#include "../floor_item.h"
+#include "../graphics.h"
#include "../item.h"
#include "../localplayer.h"
#include "../npc.h"
@@ -292,10 +292,10 @@ void PopupMenu::showPopup(int x, int y, Item *item)
void PopupMenu::showPopup(int x, int y)
{
setContentSize(mBrowserBox->getWidth() + 8, mBrowserBox->getHeight() + 8);
- if (windowContainer->getWidth() < (x + getWidth() + 5))
- x = windowContainer->getWidth() - getWidth();
- if (windowContainer->getHeight() < (y + getHeight() + 5))
- y = windowContainer->getHeight() - getHeight();
+ if (graphics->getWidth() < (x + getWidth() + 5))
+ x = graphics->getWidth() - getWidth();
+ if (graphics->getHeight() < (y + getHeight() + 5))
+ y = graphics->getHeight() - getHeight();
setPosition(x, y);
setVisible(true);
requestMoveToTop();