summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
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/popups/popupmenu.cpp
parent76f9c784e2f850e2a9070eaf93488f7459c461ef (diff)
downloadplus-77e86790554d3a8cdad5b6d7df0d6171841e2229.tar.gz
plus-77e86790554d3a8cdad5b6d7df0d6171841e2229.tar.bz2
plus-77e86790554d3a8cdad5b6d7df0d6171841e2229.tar.xz
plus-77e86790554d3a8cdad5b6d7df0d6171841e2229.zip
Use staticbrowserbox in popupmenu.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r--src/gui/popups/popupmenu.cpp11
1 files changed, 6 insertions, 5 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);