This almost fix the performance issue when zooming out on plasma-desktop.
We don't need to call prepareGeometryChange if the geometry will not change, this mistake end up with a new paint event that will paint for nothing. This should be backported into 4.3 svn path=/trunk/KDE/kdelibs/; revision=997763
This commit is contained in:
parent
b73625fbfc
commit
d4ca38b20f
@ -108,6 +108,8 @@ class EmptyGraphicsItem : public QGraphicsItem
|
|||||||
|
|
||||||
void setRect(const QRectF &rect)
|
void setRect(const QRectF &rect)
|
||||||
{
|
{
|
||||||
|
if (m_rect == rect)
|
||||||
|
return;
|
||||||
//kDebug() << "setting rect to" << rect;
|
//kDebug() << "setting rect to" << rect;
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
m_rect = rect;
|
m_rect = rect;
|
||||||
@ -510,9 +512,8 @@ void DesktopToolBox::showToolBox()
|
|||||||
{
|
{
|
||||||
setFlag(ItemIgnoresTransformations, isToolbar());
|
setFlag(ItemIgnoresTransformations, isToolbar());
|
||||||
|
|
||||||
if (showing() && !isToolbar()) {
|
if (showing() && !isToolbar())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// put tools 5px from icon edge
|
// put tools 5px from icon edge
|
||||||
const int iconWidth = KIconLoader::SizeMedium;
|
const int iconWidth = KIconLoader::SizeMedium;
|
||||||
@ -696,7 +697,6 @@ void DesktopToolBox::showToolBox()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
d->toolBacker->setRect(backerRect);
|
d->toolBacker->setRect(backerRect);
|
||||||
d->toolBacker->show();
|
d->toolBacker->show();
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ QTransform ToolBox::viewTransform() const
|
|||||||
return d->viewTransform;
|
return d->viewTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolBox::setViewTransform(QTransform transform)
|
void ToolBox::setViewTransform(const QTransform &transform)
|
||||||
{
|
{
|
||||||
if (transform.isScaling()) {
|
if (transform.isScaling()) {
|
||||||
d->toolbar = true;
|
d->toolbar = true;
|
||||||
|
@ -84,7 +84,7 @@ public:
|
|||||||
void setIsToolbar(bool toolbar);
|
void setIsToolbar(bool toolbar);
|
||||||
|
|
||||||
QTransform viewTransform() const;
|
QTransform viewTransform() const;
|
||||||
void setViewTransform(QTransform transforn);
|
void setViewTransform(const QTransform &transform);
|
||||||
|
|
||||||
void save(KConfigGroup &cg) const;
|
void save(KConfigGroup &cg) const;
|
||||||
void load(const KConfigGroup &containmentGroup = KConfigGroup());
|
void load(const KConfigGroup &containmentGroup = KConfigGroup());
|
||||||
|
Loading…
Reference in New Issue
Block a user