summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-07 02:29:22 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-07 02:29:22 +0300
commit041a366637449587148dbc263e80340ee5995893 (patch)
tree8061ae588df910fcb7c42f59189e1891c38157f5 /src/gui
parent00ed76a265c1ee4ea4989f5de32ab80b6adb6623 (diff)
downloadmv-041a366637449587148dbc263e80340ee5995893.tar.gz
mv-041a366637449587148dbc263e80340ee5995893.tar.bz2
mv-041a366637449587148dbc263e80340ee5995893.tar.xz
mv-041a366637449587148dbc263e80340ee5995893.zip
Fix popup menu scrolling padding by hardcoded numbers.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popupmenu.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index e80158227..e88322d97 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -2160,30 +2160,32 @@ void PopupMenu::showWindowsPopup(const int x, const int y)
void PopupMenu::showPopup(int x, int y)
{
- const int pad2 = 2 * getPadding();
+ const int pad2 = 2 * mPadding;
const int bPad2 = 2 * mBrowserBox->getPadding();
mBrowserBox->setPosition(mPadding, mPadding);
mScrollArea->setPosition(mPadding, mPadding);
// add padding to initial size before draw browserbox
- mBrowserBox->setWidth(mBrowserBox->getWidth() + bPad2);
int height = mBrowserBox->getHeight();
if (height + pad2 >= mainGraphics->getHeight())
{
- height = mainGraphics->getHeight() - pad2;
- mBrowserBox->setWidth(mBrowserBox->getWidth() + bPad2 + 10);
+ height = mainGraphics->getHeight() - bPad2 - pad2;
+ mBrowserBox->setWidth(mBrowserBox->getWidth() + bPad2 + 5);
+ mScrollArea->setWidth(mBrowserBox->getWidth() + pad2 + 10);
+ setContentSize(mBrowserBox->getWidth() + pad2 + 20,
+ height + pad2);
}
else
{
mBrowserBox->setWidth(mBrowserBox->getWidth() + bPad2);
+ mScrollArea->setWidth(mBrowserBox->getWidth() + pad2);
+ setContentSize(mBrowserBox->getWidth() + pad2,
+ height + pad2);
}
- setContentSize(mBrowserBox->getWidth() + pad2,
- height + pad2);
if (mainGraphics->mWidth < (x + getWidth() + 5))
x = mainGraphics->mWidth - getWidth();
if (mainGraphics->mHeight < (y + getHeight() + 5))
y = mainGraphics->mHeight - getHeight();
- mScrollArea->setWidth(mBrowserBox->getWidth() + pad2);
- mScrollArea->setHeight(height + pad2);
+ mScrollArea->setHeight(height);
setPosition(x, y);
setVisible(true);
requestMoveToTop();