set the proper margins

svn path=/trunk/KDE/kdelibs/; revision=932540
This commit is contained in:
Marco Martin 2009-02-26 21:21:05 +00:00
parent 3adfa46823
commit 00f6d85a35

View File

@ -445,17 +445,24 @@ void DesktopToolBox::showToolBox()
x -= maxWidth; x -= maxWidth;
} }
y += 5; //y += 5;
// the rect the tools back should have
QRectF backerRect = QRectF(QPointF(x, startY), QSizeF(maxWidth + 10, y - startY));
if (!d->toolBacker) { if (!d->toolBacker) {
d->toolBacker = new EmptyGraphicsItem(this); d->toolBacker = new EmptyGraphicsItem(this);
d->toolBacker->setZValue(zValue() + 1); d->toolBacker->setZValue(zValue() + 1);
} }
qreal left, top, right, bottom;
d->toolBacker->getContentsMargins(left, top, right, bottom);
// the rect the tools back should have
QRectF backerRect = QRectF(QPointF(x, startY), QSizeF(maxWidth + left+right, y - startY + top + bottom));
d->toolBacker->setIsToolbar(isToolbar()); d->toolBacker->setIsToolbar(isToolbar());
if (isToolbar()) { if (isToolbar()) {
QPointF topRight; QPointF topRight;
@ -466,9 +473,6 @@ void DesktopToolBox::showToolBox()
topRight = boundingRect().topRight(); topRight = boundingRect().topRight();
} }
qreal left, top, right, bottom;
d->toolBacker->getContentsMargins(left, top, right, bottom);
x -= left;
backerRect.setSize(QSize(totalWidth+left+right, maxHeight+top+bottom)); backerRect.setSize(QSize(totalWidth+left+right, maxHeight+top+bottom));
backerRect.moveTopRight(topRight); backerRect.moveTopRight(topRight);
@ -493,8 +497,8 @@ void DesktopToolBox::showToolBox()
// re-map our starting points back to our coordinate system // re-map our starting points back to our coordinate system
backerRect = mapFromParent(backerRect).boundingRect(); backerRect = mapFromParent(backerRect).boundingRect();
} }
x = backerRect.x() + 5; x = backerRect.x() + left;
y = backerRect.y(); y = backerRect.y() + top;
// now move the items // now move the items
Plasma::Animator *animdriver = Plasma::Animator::self(); Plasma::Animator *animdriver = Plasma::Animator::self();