avoid an endless repaint loop

condition is still very convoluted but at least a lot faster

svn path=/trunk/KDE/kdelibs/; revision=890462
This commit is contained in:
Marco Martin 2008-11-29 13:06:12 +00:00
parent 807b2cf637
commit f4cf4b189b

View File

@ -115,17 +115,17 @@ public:
changed = true;
}
if (viewTransform.isScaling()) {
if (changed || q->isToolbar() != viewTransform.isScaling()) {
if (!q->isToolbar()) {
q->setIsToolbar(true);
q->showToolBox();
return true;
} else {
q->setIsToolbar(false);
if (changed) {
q->hideToolBox();
}
return false;
}
return q->isToolbar();
}
DesktopToolBox *q;
@ -374,6 +374,17 @@ void DesktopToolBox::showToolBox()
continue;
}
Plasma::IconWidget *icon = qgraphicsitem_cast<Plasma::IconWidget *>(tool);
if (icon) {
if (d->viewTransform.isScaling() && d->viewTransform.m11() < Plasma::scalingFactor(Plasma::GroupZoom)) {
icon->setText(QString());
icon->resize(icon->sizeFromIconSize(22));
} else {
icon->setText(icon->action()->text());
icon->resize(icon->sizeFromIconSize(22));
}
}
if (tool->isEnabled()) {
//kDebug() << tool << "is enabled";
y += 5;
@ -436,17 +447,6 @@ void DesktopToolBox::showToolBox()
continue;
}
Plasma::IconWidget *icon = qgraphicsitem_cast<Plasma::IconWidget *>(tool);
if (icon) {
if (d->viewTransform.isScaling() && d->viewTransform.m11() < Plasma::scalingFactor(Plasma::GroupZoom)) {
icon->setText(QString());
icon->resize(icon->sizeFromIconSize(22));
} else {
icon->setText(icon->action()->text());
icon->resize(icon->sizeFromIconSize(22));
}
}
if (tool->isEnabled()) {
if (isToolbar()) {
//kDebug() << tool << "is enabled";