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