update the icon when the svg changes

svn path=/trunk/KDE/kdelibs/; revision=906159
This commit is contained in:
Aaron J. Seigo 2009-01-05 17:34:40 +00:00
parent 7648db2c3a
commit d8c68f8d5f
3 changed files with 10 additions and 1 deletions

View File

@ -55,7 +55,7 @@ namespace Plasma
IconWidgetPrivate::IconWidgetPrivate(IconWidget *i)
: q(i),
iconSvg(0),
iconSvgElementChanged(0),
iconSvgElementChanged(false),
m_fadeIn(false),
m_hoverAnimId(-1),
m_hoverAlpha(20 / 255),
@ -503,6 +503,7 @@ 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->iconSvg->setImagePath(svgFilePath);
@ -1181,6 +1182,12 @@ void IconWidgetPrivate::clearAction()
emit q->changed();
}
void IconWidgetPrivate::svgChanged()
{
iconSvgElementChanged = true;
q->update();
}
void IconWidgetPrivate::syncToAction()
{
if (!action) {

View File

@ -279,6 +279,7 @@ public:
private:
Q_PRIVATE_SLOT(d, void syncToAction())
Q_PRIVATE_SLOT(d, void clearAction())
Q_PRIVATE_SLOT(d, void svgChanged())
void init();
void layoutIcons(const QStyleOptionGraphicsItem *option);
void hoverEffect(bool);

View File

@ -176,6 +176,7 @@ public:
*/
void syncToAction();
void clearAction();
void svgChanged();
IconWidget *q;
QString text;