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:
parent
f4514950f4
commit
fcb0f36d7f
@ -1841,7 +1841,7 @@ void ContainmentPrivate::positionPanel(bool force)
|
|||||||
|
|
||||||
//TODO: research how non-Horizontal, non-Vertical (e.g. Planar) panels behave here
|
//TODO: research how non-Horizontal, non-Vertical (e.g. Planar) panels behave here
|
||||||
bool horiz = q->formFactor() == Plasma::Horizontal;
|
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;
|
qreal lastHeight = 0;
|
||||||
|
|
||||||
// this should be ok for small numbers of panels, but if we ever end
|
// 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) {
|
if (horiz) {
|
||||||
qreal y = other->pos().y();
|
qreal y = other->pos().y() - HORIZONTAL_STACKING_OFFSET;
|
||||||
if (y < bottom) {
|
if (y < bottom) {
|
||||||
lastHeight = other->size().height();
|
lastHeight = other->size().height();
|
||||||
bottom = y;
|
bottom = y;
|
||||||
|
@ -27,6 +27,7 @@ static const int INTER_CONTAINMENT_MARGIN = 6;
|
|||||||
static const int TOOLBOX_MARGIN = 150;
|
static const int TOOLBOX_MARGIN = 150;
|
||||||
static const int CONTAINMENT_COLUMNS = 2;
|
static const int CONTAINMENT_COLUMNS = 2;
|
||||||
static const int VERTICAL_STACKING_OFFSET = 10000;
|
static const int VERTICAL_STACKING_OFFSET = 10000;
|
||||||
|
static const int HORIZONTAL_STACKING_OFFSET = 900;
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user