[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/plasma
From: Marco Martin <notmart () gmail ! com>
Date: 2011-01-18 19:03:33
Message-ID: 20110118190333.DDDA0AC8B7 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1215443 by mart:
with a new singleshot don't adjust the extender size due to a sub widget resize until \
the next turn of the eventloop: avoids container that resizes the ontent that resizes \
the container loops
M +8 -0 extenders/extendergroup.cpp
M +3 -0 private/extendergroup_p.h
--- trunk/KDE/kdelibs/plasma/extenders/extendergroup.cpp #1215442:1215443
@@ -23,6 +23,7 @@
#include <QApplication>
#include <QString>
#include <QList>
+#include <QTimer>
#include <QtGui/QGraphicsWidget>
#include <QtGui/QGraphicsLinearLayout>
#include <QtGui/QGraphicsSceneDragDropEvent>
@@ -49,6 +50,10 @@
connect(extender(), SIGNAL(itemDetached(Plasma::ExtenderItem*)),
this, SLOT(removeItemFromGroup(Plasma::ExtenderItem*)));
+ //this isn't actually connected to anything, we will just check if it's running \
or not + d->resizeTimer = new QTimer(this);
+ d->resizeTimer->setSingleShot(true);
+
config().writeEntry("isGroup", true);
setAcceptDrops(true);
@@ -217,9 +222,12 @@
{
if (watched == d->childsWidget && event->type() == QEvent::GraphicsSceneResize) \
{
static_cast<QGraphicsLayoutItem \
*>(extender()->d->scrollWidget)->updateGeometry(); + if \
(!d->resizeTimer->isActive()) { static_cast<QGraphicsLayoutItem \
*>(extender())->updateGeometry(); extender()->d->adjustSize();
+ d->resizeTimer->start(0);
}
+ }
return ExtenderItem::eventFilter(watched, event);
}
--- trunk/KDE/kdelibs/plasma/private/extendergroup_p.h #1215442:1215443
@@ -20,6 +20,8 @@
#ifndef PLASMA_EXTENDERGROUPPRIVATE_H
#define PLASMA_EXTENDERGROUPPRIVATE_H
+class QTimer;
+
namespace Plasma
{
@@ -45,6 +47,7 @@
Plasma::Svg *svg;
QGraphicsWidget *childsWidget;
QGraphicsLinearLayout *layout;
+ QTimer *resizeTimer;
bool collapsed;
bool autoHide;
bool autoCollapse;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic