Prevent horizontal panels from bleeding over into positive coordinates by creating a positioning offset, much like that given to vertical panels.

CCBUG: 176280

svn path=/trunk/KDE/kdelibs/; revision=927169
This commit is contained in:
Joshua Levesque 2009-02-16 22:55:24 +00:00
parent f4514950f4
commit fcb0f36d7f
2 changed files with 3 additions and 2 deletions

View File

@ -1841,7 +1841,7 @@ void ContainmentPrivate::positionPanel(bool force)
//TODO: research how non-Horizontal, non-Vertical (e.g. Planar) panels behave here
bool horiz = q->formFactor() == Plasma::Horizontal;
qreal bottom = horiz ? 0 : VERTICAL_STACKING_OFFSET;
qreal bottom = horiz ? -HORIZONTAL_STACKING_OFFSET : VERTICAL_STACKING_OFFSET;
qreal lastHeight = 0;
// this should be ok for small numbers of panels, but if we ever end
@ -1857,7 +1857,7 @@ void ContainmentPrivate::positionPanel(bool force)
}
if (horiz) {
qreal y = other->pos().y();
qreal y = other->pos().y() - HORIZONTAL_STACKING_OFFSET;
if (y < bottom) {
lastHeight = other->size().height();
bottom = y;

View File

@ -27,6 +27,7 @@ static const int INTER_CONTAINMENT_MARGIN = 6;
static const int TOOLBOX_MARGIN = 150;
static const int CONTAINMENT_COLUMNS = 2;
static const int VERTICAL_STACKING_OFFSET = 10000;
static const int HORIZONTAL_STACKING_OFFSET = 900;
namespace Plasma
{