summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-19 19:33:49 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-19 19:33:49 +0300
commit77e86790554d3a8cdad5b6d7df0d6171841e2229 (patch)
treebe775746b0be8bd18e11f71b8398ba8cc36fcf81 /src/gui
parent76f9c784e2f850e2a9070eaf93488f7459c461ef (diff)
downloadmanaplus-77e86790554d3a8cdad5b6d7df0d6171841e2229.tar.gz
manaplus-77e86790554d3a8cdad5b6d7df0d6171841e2229.tar.bz2
manaplus-77e86790554d3a8cdad5b6d7df0d6171841e2229.tar.xz
manaplus-77e86790554d3a8cdad5b6d7df0d6171841e2229.zip
Use staticbrowserbox in popupmenu.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/popupmenu.cpp11
-rw-r--r--src/gui/popups/popupmenu.h6
2 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index a01ab6bf8..06a8edc54 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -59,6 +59,7 @@
#include "gui/widgets/createwidget.h"
#include "gui/widgets/progressbar.h"
#include "gui/widgets/scrollarea.h"
+#include "gui/widgets/staticbrowserbox.h"
#include "gui/widgets/textfield.h"
#include "gui/widgets/tabs/chat/whispertab.h"
@@ -100,7 +101,7 @@ PopupMenu *popupMenu = nullptr;
PopupMenu::PopupMenu() :
Popup("PopupMenu", "popupmenu.xml"),
- mBrowserBox(new BrowserBox(this, BrowserBoxMode::AUTO_SIZE, Opaque_true,
+ mBrowserBox(new StaticBrowserBox(this, Opaque_true,
"popupbrowserbox.xml")),
mScrollArea(nullptr),
mBeingId(BeingId_zero),
@@ -2348,22 +2349,22 @@ void PopupMenu::showSkillTypePopup(const SkillInfo *const info)
void PopupMenu::showPopup(int x, int y)
{
const int pad2 = 2 * mPadding;
- const int bPad2 = 2 * mBrowserBox->getPadding();
mBrowserBox->setPosition(mPadding, mPadding);
mScrollArea->setPosition(mPadding, mPadding);
+ mBrowserBox->updateHeight();
// add padding to initial size before draw browserbox
int height = mBrowserBox->getHeight();
if (height + pad2 >= mainGraphics->getHeight())
{
- height = mainGraphics->getHeight() - bPad2 - pad2;
- mBrowserBox->setWidth(mBrowserBox->getWidth() + bPad2 + 5);
+ height = mainGraphics->getHeight() - pad2;
+ mBrowserBox->setWidth(mBrowserBox->getWidth() + 5);
mScrollArea->setWidth(mBrowserBox->getWidth() + pad2 + 10);
setContentSize(mBrowserBox->getWidth() + pad2 + 20,
height + pad2);
}
else
{
- mBrowserBox->setWidth(mBrowserBox->getWidth() + bPad2);
+ mBrowserBox->setWidth(mBrowserBox->getWidth());
mScrollArea->setWidth(mBrowserBox->getWidth() + pad2);
setContentSize(mBrowserBox->getWidth() + pad2,
height + pad2);
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index 539424592..8c090d1f9 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -43,18 +43,18 @@
class ActorSprite;
class Being;
-class BrowserBox;
class Button;
class ChatTab;
class FloorItem;
class Item;
class ListModel;
class MapItem;
+class ProgressBar;
class ScrollArea;
+class StaticBrowserBox;
class TextCommand;
class TextDialog;
class TextField;
-class ProgressBar;
class Window;
struct SkillInfo;
@@ -268,7 +268,7 @@ class PopupMenu final : public Popup, public LinkHandler
bool addBeingMenu();
- BrowserBox *mBrowserBox A_NONNULLPOINTER;
+ StaticBrowserBox *mBrowserBox A_NONNULLPOINTER;
ScrollArea *mScrollArea A_NONNULLPOINTER;
BeingId mBeingId;