[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.6/kdelibs/plasma
From: Marco Martin <notmart () gmail ! com>
Date: 2011-01-18 19:06:43
Message-ID: 20110118190643.C6C0CAC8B6 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1215445 by mart:
backport resize loop fix
M +8 -0 extenders/extendergroup.cpp
M +3 -0 private/extendergroup_p.h
--- branches/KDE/4.6/kdelibs/plasma/extenders/extendergroup.cpp #1215444:1215445
@@ -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);
}
--- branches/KDE/4.6/kdelibs/plasma/private/extendergroup_p.h #1215444:1215445
@@ -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