diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-07 02:29:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-07 02:29:22 +0300 |
commit | 041a366637449587148dbc263e80340ee5995893 (patch) | |
tree | 8061ae588df910fcb7c42f59189e1891c38157f5 /src/gui/popupmenu.cpp | |
parent | 00ed76a265c1ee4ea4989f5de32ab80b6adb6623 (diff) | |
download | plus-041a366637449587148dbc263e80340ee5995893.tar.gz plus-041a366637449587148dbc263e80340ee5995893.tar.bz2 plus-041a366637449587148dbc263e80340ee5995893.tar.xz plus-041a366637449587148dbc263e80340ee5995893.zip |
Fix popup menu scrolling padding by hardcoded numbers.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 18 |
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(); |