reset any svg icon if a normal one gets set
svn path=/trunk/KDE/kdelibs/; revision=1117890
This commit is contained in:
parent
93949358d3
commit
5d9b77ed76
@ -626,6 +626,14 @@ void IconWidgetPrivate::layoutIcons(const QStyleOptionGraphicsItem *option)
|
|||||||
|
|
||||||
void IconWidget::setSvg(const QString &svgFilePath, const QString &elementId)
|
void IconWidget::setSvg(const QString &svgFilePath, const QString &elementId)
|
||||||
{
|
{
|
||||||
|
if (svgFilePath.isEmpty()) {
|
||||||
|
if (d->iconSvg) {
|
||||||
|
d->iconSvg->deleteLater();
|
||||||
|
d->iconSvg = 0;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!d->iconSvg) {
|
if (!d->iconSvg) {
|
||||||
d->iconSvg = new Plasma::Svg(this);
|
d->iconSvg = new Plasma::Svg(this);
|
||||||
connect(d->iconSvg, SIGNAL(repaintNeeded()), this, SLOT(svgChanged()));
|
connect(d->iconSvg, SIGNAL(repaintNeeded()), this, SLOT(svgChanged()));
|
||||||
@ -1219,6 +1227,8 @@ void IconWidget::setIcon(const QString &icon)
|
|||||||
|
|
||||||
void IconWidget::setIcon(const QIcon &icon)
|
void IconWidget::setIcon(const QIcon &icon)
|
||||||
{
|
{
|
||||||
|
setSvg(QString());
|
||||||
|
|
||||||
/*fade to the new icon, but to not bee a too big hog, not do that when:
|
/*fade to the new icon, but to not bee a too big hog, not do that when:
|
||||||
- the fade animation is already running
|
- the fade animation is already running
|
||||||
- the icon is under mouse
|
- the icon is under mouse
|
||||||
|
Loading…
x
Reference in New Issue
Block a user