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:
parent
807b2cf637
commit
f4cf4b189b
@ -115,17 +115,17 @@ public:
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (viewTransform.isScaling()) {
|
||||
q->setIsToolbar(true);
|
||||
q->showToolBox();
|
||||
return true;
|
||||
} else {
|
||||
q->setIsToolbar(false);
|
||||
if (changed) {
|
||||
if (changed || q->isToolbar() != viewTransform.isScaling()) {
|
||||
if (!q->isToolbar()) {
|
||||
q->setIsToolbar(true);
|
||||
q->showToolBox();
|
||||
} else {
|
||||
q->setIsToolbar(false);
|
||||
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";
|
||||
|
Loading…
Reference in New Issue
Block a user