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
svn path=/trunk/KDE/kdelibs/; revision=1215443
This commit is contained in:
parent
ef64072b4a
commit
fc8f66f498
@ -23,6 +23,7 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QTimer>
|
||||||
#include <QtGui/QGraphicsWidget>
|
#include <QtGui/QGraphicsWidget>
|
||||||
#include <QtGui/QGraphicsLinearLayout>
|
#include <QtGui/QGraphicsLinearLayout>
|
||||||
#include <QtGui/QGraphicsSceneDragDropEvent>
|
#include <QtGui/QGraphicsSceneDragDropEvent>
|
||||||
@ -49,6 +50,10 @@ ExtenderGroup::ExtenderGroup(Extender *parent, uint groupId)
|
|||||||
connect(extender(), SIGNAL(itemDetached(Plasma::ExtenderItem*)),
|
connect(extender(), SIGNAL(itemDetached(Plasma::ExtenderItem*)),
|
||||||
this, SLOT(removeItemFromGroup(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);
|
config().writeEntry("isGroup", true);
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
@ -217,8 +222,11 @@ bool ExtenderGroup::eventFilter(QObject *watched, QEvent *event)
|
|||||||
{
|
{
|
||||||
if (watched == d->childsWidget && event->type() == QEvent::GraphicsSceneResize) {
|
if (watched == d->childsWidget && event->type() == QEvent::GraphicsSceneResize) {
|
||||||
static_cast<QGraphicsLayoutItem *>(extender()->d->scrollWidget)->updateGeometry();
|
static_cast<QGraphicsLayoutItem *>(extender()->d->scrollWidget)->updateGeometry();
|
||||||
static_cast<QGraphicsLayoutItem *>(extender())->updateGeometry();
|
if (!d->resizeTimer->isActive()) {
|
||||||
extender()->d->adjustSize();
|
static_cast<QGraphicsLayoutItem *>(extender())->updateGeometry();
|
||||||
|
extender()->d->adjustSize();
|
||||||
|
d->resizeTimer->start(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ExtenderItem::eventFilter(watched, event);
|
return ExtenderItem::eventFilter(watched, event);
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#ifndef PLASMA_EXTENDERGROUPPRIVATE_H
|
#ifndef PLASMA_EXTENDERGROUPPRIVATE_H
|
||||||
#define PLASMA_EXTENDERGROUPPRIVATE_H
|
#define PLASMA_EXTENDERGROUPPRIVATE_H
|
||||||
|
|
||||||
|
class QTimer;
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -45,6 +47,7 @@ class ExtenderGroupPrivate
|
|||||||
Plasma::Svg *svg;
|
Plasma::Svg *svg;
|
||||||
QGraphicsWidget *childsWidget;
|
QGraphicsWidget *childsWidget;
|
||||||
QGraphicsLinearLayout *layout;
|
QGraphicsLinearLayout *layout;
|
||||||
|
QTimer *resizeTimer;
|
||||||
bool collapsed;
|
bool collapsed;
|
||||||
bool autoHide;
|
bool autoHide;
|
||||||
bool autoCollapse;
|
bool autoCollapse;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user