update the icon when the svg changes
svn path=/trunk/KDE/kdelibs/; revision=906159
This commit is contained in:
parent
7648db2c3a
commit
d8c68f8d5f
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -176,6 +176,7 @@ public:
|
||||
*/
|
||||
void syncToAction();
|
||||
void clearAction();
|
||||
void svgChanged();
|
||||
|
||||
IconWidget *q;
|
||||
QString text;
|
||||
|
Loading…
Reference in New Issue
Block a user