actually disable the fade when a bunch of fast changes (animation frames) happen
svn path=/trunk/KDE/kdelibs/; revision=1093280
This commit is contained in:
parent
05d70e7add
commit
3a2a21d34a
@ -387,6 +387,10 @@ IconWidget::~IconWidget()
|
|||||||
void IconWidgetPrivate::init()
|
void IconWidgetPrivate::init()
|
||||||
{
|
{
|
||||||
readColors();
|
readColors();
|
||||||
|
|
||||||
|
iconChangeTimer = new QTimer(q);
|
||||||
|
iconChangeTimer->setSingleShot(true);
|
||||||
|
|
||||||
QObject::connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(colorConfigChanged()));
|
QObject::connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(colorConfigChanged()));
|
||||||
QObject::connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorConfigChanged()));
|
QObject::connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorConfigChanged()));
|
||||||
QObject::connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), q, SLOT(iconConfigChanged()));
|
QObject::connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), q, SLOT(iconConfigChanged()));
|
||||||
@ -1220,9 +1224,12 @@ void IconWidget::setIcon(const QIcon &icon)
|
|||||||
- the fade animation is already running
|
- the fade animation is already running
|
||||||
- the icon is under mouse
|
- the icon is under mouse
|
||||||
- one betwen the old and new icon is null*/
|
- one betwen the old and new icon is null*/
|
||||||
if (!(d->states & IconWidgetPrivate::HoverState) && d->oldIcon.isNull() && !d->icon.isNull() && !icon.isNull()) {
|
if (!(d->states & IconWidgetPrivate::HoverState) && !d->iconChangeTimer->isActive() && d->oldIcon.isNull() && !d->icon.isNull() && !icon.isNull()) {
|
||||||
d->oldIcon = d->icon;
|
d->oldIcon = d->icon;
|
||||||
d->animateMainIcon(true, d->states);
|
d->animateMainIcon(true, d->states);
|
||||||
|
d->iconChangeTimer->start(300);
|
||||||
|
} else {
|
||||||
|
d->oldIcon = QIcon();
|
||||||
}
|
}
|
||||||
d->icon = icon;
|
d->icon = icon;
|
||||||
update();
|
update();
|
||||||
|
@ -217,6 +217,7 @@ public:
|
|||||||
QSizeF currentSize;
|
QSizeF currentSize;
|
||||||
QPointF clickStartPos;
|
QPointF clickStartPos;
|
||||||
mutable QList<QRect> haloRects;
|
mutable QList<QRect> haloRects;
|
||||||
|
QTimer *iconChangeTimer;
|
||||||
|
|
||||||
QList<IconAction*> cornerActions;
|
QList<IconAction*> cornerActions;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user