From 00f6d85a3562eb001b224bd77dd73976364af8c1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 26 Feb 2009 21:21:05 +0000 Subject: [PATCH] set the proper margins svn path=/trunk/KDE/kdelibs/; revision=932540 --- private/desktoptoolbox.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index e417fc6a1..c1cf49c34 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -445,17 +445,24 @@ void DesktopToolBox::showToolBox() x -= maxWidth; } - y += 5; - // the rect the tools back should have - QRectF backerRect = QRectF(QPointF(x, startY), QSizeF(maxWidth + 10, y - startY)); + //y += 5; + if (!d->toolBacker) { d->toolBacker = new EmptyGraphicsItem(this); 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()); + if (isToolbar()) { QPointF topRight; @@ -466,9 +473,6 @@ void DesktopToolBox::showToolBox() 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.moveTopRight(topRight); @@ -493,8 +497,8 @@ void DesktopToolBox::showToolBox() // re-map our starting points back to our coordinate system backerRect = mapFromParent(backerRect).boundingRect(); } - x = backerRect.x() + 5; - y = backerRect.y(); + x = backerRect.x() + left; + y = backerRect.y() + top; // now move the items Plasma::Animator *animdriver = Plasma::Animator::self();