clean this up a little bit

svn path=/trunk/KDE/kdelibs/; revision=885858
This commit is contained in:
Aaron J. Seigo 2008-11-18 00:43:11 +00:00
parent 5dbc0a7da0
commit 649057791d

View File

@ -284,11 +284,10 @@ void DesktopToolBox::showToolBox()
int maxwidth = 0;
foreach (QGraphicsItem *tool, QGraphicsItem::children()) {
if (!tool->isEnabled()) {
continue;
}
if (tool->isEnabled()) {
maxwidth = qMax(static_cast<int>(tool->boundingRect().width()), maxwidth);
}
}
// put tools 5px from icon edge
const int iconWidth = 32;
@ -334,28 +333,27 @@ void DesktopToolBox::showToolBox()
int startY = y;
x += 5;
//kDebug() << "starting at" << startX << startY;
Plasma::Animator *animdriver = Plasma::Animator::self();
foreach (QGraphicsItem *tool, QGraphicsItem::children()) {
if (tool == d->toolBacker) {
continue;
}
if (tool->isEnabled()) {
//kDebug() << tool << "is enabled";
y += 5;
if (!tool->isEnabled()) {
if (tool->isVisible()) {
const int height = static_cast<int>(tool->boundingRect().height());
animdriver->moveItem(tool, Plasma::Animator::SlideOutMovement,
toolPosition(height));
}
continue;
}
//kDebug() << "let's show and move" << tool << tool->boundingRect();
tool->show();
animdriver->moveItem(tool, Plasma::Animator::SlideInMovement, QPoint(x, y));
//x += 0;
y += static_cast<int>(tool->boundingRect().height());
} else if (tool->isVisible()) {
// disabled, but visible, so hide it!
const int height = static_cast<int>(tool->boundingRect().height());
animdriver->moveItem(tool, Plasma::Animator::SlideOutMovement,
toolPosition(height));
}
}
if (!d->toolBacker) {