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;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewTransform.isScaling()) {
|
if (changed || q->isToolbar() != viewTransform.isScaling()) {
|
||||||
|
if (!q->isToolbar()) {
|
||||||
q->setIsToolbar(true);
|
q->setIsToolbar(true);
|
||||||
q->showToolBox();
|
q->showToolBox();
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
q->setIsToolbar(false);
|
q->setIsToolbar(false);
|
||||||
if (changed) {
|
|
||||||
q->hideToolBox();
|
q->hideToolBox();
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return q->isToolbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
DesktopToolBox *q;
|
DesktopToolBox *q;
|
||||||
@ -374,6 +374,17 @@ void DesktopToolBox::showToolBox()
|
|||||||
continue;
|
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 (tool->isEnabled()) {
|
||||||
//kDebug() << tool << "is enabled";
|
//kDebug() << tool << "is enabled";
|
||||||
y += 5;
|
y += 5;
|
||||||
@ -436,17 +447,6 @@ void DesktopToolBox::showToolBox()
|
|||||||
continue;
|
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 (tool->isEnabled()) {
|
||||||
if (isToolbar()) {
|
if (isToolbar()) {
|
||||||
//kDebug() << tool << "is enabled";
|
//kDebug() << tool << "is enabled";
|
||||||
|
Loading…
Reference in New Issue
Block a user