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,10 +284,9 @@ 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
@ -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;
} }
y += 5; if (tool->isEnabled()) {
//kDebug() << tool << "is enabled";
if (!tool->isEnabled()) { y += 5;
if (tool->isVisible()) { //kDebug() << "let's show and move" << tool << tool->boundingRect();
const int height = static_cast<int>(tool->boundingRect().height()); tool->show();
animdriver->moveItem(tool, Plasma::Animator::SlideOutMovement, animdriver->moveItem(tool, Plasma::Animator::SlideInMovement, QPoint(x, y));
toolPosition(height)); //x += 0;
} y += static_cast<int>(tool->boundingRect().height());
continue; } 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));
} }
//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());
} }
if (!d->toolBacker) { if (!d->toolBacker) {