animate transitions when an svg is used as well.
This commit is contained in:
parent
c546b3d47d
commit
34376c31b1
@ -650,15 +650,25 @@ void IconWidget::setSvg(const QString &svgFilePath, const QString &elementId)
|
||||
if (!d->iconSvg) {
|
||||
d->iconSvg = new Plasma::Svg(this);
|
||||
connect(d->iconSvg, SIGNAL(repaintNeeded()), this, SLOT(svgChanged()));
|
||||
d->oldIcon = d->icon;
|
||||
} else {
|
||||
d->oldIcon = d->iconSvg->pixmap(d->iconSvgElement);
|
||||
}
|
||||
|
||||
d->iconSvg->setImagePath(svgFilePath);
|
||||
d->iconSvg->setContainsMultipleImages(!elementId.isNull());
|
||||
d->iconSvgElement = elementId;
|
||||
d->iconSvgElementChanged = true;
|
||||
d->icon = QIcon();
|
||||
updateGeometry();
|
||||
update();
|
||||
|
||||
if (!(d->states & IconWidgetPrivate::HoverState) && !d->iconChangeTimer->isActive() && !d->oldIcon.isNull()) {
|
||||
d->animateMainIcon(true, d->states);
|
||||
} else {
|
||||
d->oldIcon = QIcon();
|
||||
update();
|
||||
}
|
||||
d->iconChangeTimer->start(300);
|
||||
d->icon = QIcon();
|
||||
}
|
||||
|
||||
QString IconWidget::svg() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user