diff options
Diffstat (limited to 'src/gui/itempopup.cpp')
-rw-r--r-- | src/gui/itempopup.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index c0a75193..81e4607b 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -24,6 +24,7 @@ #include "gui.h" #include "itempopup.h" +#include "windowcontainer.h" #include "widgets/layout.h" @@ -116,3 +117,16 @@ unsigned int ItemPopup::getNumRows() { return mItemDesc->getNumberOfRows(), mItemEffect->getNumberOfRows(); } + +void ItemPopup::view(int x, int y) +{ + if (windowContainer->getWidth() < (x + getWidth() + 5)) + x = windowContainer->getWidth() - getWidth(); + if (windowContainer->getHeight() < (y + getHeight() + 5)) + y = windowContainer->getHeight() - getHeight(); + else + y = y - getHeight() - 5; + setPosition(x, y); + setVisible(true); + requestMoveToTop(); +} |