diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index db15d0fdd..9129aa1a4 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -42,6 +42,7 @@ IconItem::IconItem(QQuickItem *parent) m_svgIcon(0), m_smooth(false), m_active(false), + m_animated(true), m_textureChanged(false), m_sizeChanged(false), m_svgFromIconLoader(false), @@ -241,6 +242,21 @@ bool IconItem::smooth() const return m_smooth; } +bool IconItem::isAnimated() const +{ + return m_animated; +} + +void IconItem::setAnimated(bool animated) +{ + if (m_animated == animated) { + return; + } + + m_animated = animated; + emit animatedChanged(); +} + bool IconItem::isValid() const { return !m_icon.isNull() || m_svgIcon || !m_pixmapIcon.isNull() || !m_imageIcon.isNull(); @@ -397,7 +413,7 @@ void IconItem::loadPixmap() m_textureChanged = true; //don't animate initial setting - if (!m_oldIconPixmap.isNull() && !m_sizeChanged) { + if (m_animated && !m_oldIconPixmap.isNull() && !m_sizeChanged) { m_animation->setStartValue((qreal)0); m_animation->setEndValue((qreal)1); m_animation->start(); diff --git a/src/declarativeimports/core/iconitem.h b/src/declarativeimports/core/iconitem.h index 366edf38b..6486a8c08 100644 --- a/src/declarativeimports/core/iconitem.h +++ b/src/declarativeimports/core/iconitem.h @@ -43,6 +43,7 @@ class IconItem : public QQuickItem Q_PROPERTY(Plasma::Theme::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY colorGroupChanged) Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged) Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged) + Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated NOTIFY animatedChanged) Q_PROPERTY(bool valid READ isValid NOTIFY validChanged) Q_PROPERTY(int paintedWidth READ paintedWidth NOTIFY paintedSizeChanged) Q_PROPERTY(int paintedHeight READ paintedHeight NOTIFY paintedSizeChanged) @@ -64,6 +65,9 @@ public: void setSmooth(const bool smooth); bool smooth() const; + bool isAnimated() const; + void setAnimated(bool animated); + bool isValid() const; int paintedWidth() const; @@ -81,6 +85,7 @@ Q_SIGNALS: void activeChanged(); void sourceChanged(); void smoothChanged(); + void animatedChanged(); void validChanged(); void colorGroupChanged(); void paintedSizeChanged(); @@ -105,6 +110,7 @@ private: bool m_smooth; bool m_active; + bool m_animated; bool m_textureChanged; bool m_sizeChanged;