Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/core/iconitem.h
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 39 | { | |||
---|---|---|---|---|---|
114 | Q_PROPERTY(int paintedWidth READ paintedWidth NOTIFY paintedSizeChanged) | 114 | Q_PROPERTY(int paintedWidth READ paintedWidth NOTIFY paintedSizeChanged) | ||
115 | 115 | | |||
116 | /** | 116 | /** | ||
117 | * The height of the icon actually being drawn. | 117 | * The height of the icon actually being drawn. | ||
118 | * Icons are drawn at standard icon sizes (eg. 16,32,64) centered within the item | 118 | * Icons are drawn at standard icon sizes (eg. 16,32,64) centered within the item | ||
119 | */ | 119 | */ | ||
120 | Q_PROPERTY(int paintedHeight READ paintedHeight NOTIFY paintedSizeChanged) | 120 | Q_PROPERTY(int paintedHeight READ paintedHeight NOTIFY paintedSizeChanged) | ||
121 | 121 | | |||
122 | Q_PROPERTY(int implicitHeight READ implicitHeight WRITE setImplicitHeight2 NOTIFY implicitHeightChanged2) | ||||
123 | | ||||
124 | Q_PROPERTY(int implicitWidth READ implicitWidth WRITE setImplicitWidth2 NOTIFY implicitWidthChanged2) | ||||
125 | | ||||
122 | public: | 126 | public: | ||
123 | IconItem(QQuickItem *parent = 0); | 127 | IconItem(QQuickItem *parent = 0); | ||
124 | ~IconItem(); | 128 | ~IconItem(); | ||
125 | 129 | | |||
126 | void setSource(const QVariant &source); | 130 | void setSource(const QVariant &source); | ||
127 | QVariant source() const; | 131 | QVariant source() const; | ||
128 | 132 | | |||
129 | void setColorGroup(Plasma::Theme::ColorGroup group); | 133 | void setColorGroup(Plasma::Theme::ColorGroup group); | ||
Show All 20 Lines | |||||
150 | bool isValid() const; | 154 | bool isValid() const; | ||
151 | 155 | | |||
152 | int paintedWidth() const; | 156 | int paintedWidth() const; | ||
153 | int paintedHeight() const; | 157 | int paintedHeight() const; | ||
154 | 158 | | |||
155 | void setStatus(Plasma::Svg::Status status); | 159 | void setStatus(Plasma::Svg::Status status); | ||
156 | Plasma::Svg::Status status() const; | 160 | Plasma::Svg::Status status() const; | ||
157 | 161 | | |||
162 | void setImplicitHeight2(int height); | ||||
163 | void setImplicitWidth2(int height); | ||||
164 | | ||||
158 | void updatePolish() Q_DECL_OVERRIDE; | 165 | void updatePolish() Q_DECL_OVERRIDE; | ||
159 | QSGNode* updatePaintNode(QSGNode * oldNode, UpdatePaintNodeData * updatePaintNodeData) Q_DECL_OVERRIDE; | 166 | QSGNode* updatePaintNode(QSGNode * oldNode, UpdatePaintNodeData * updatePaintNodeData) Q_DECL_OVERRIDE; | ||
160 | 167 | | |||
161 | void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; | 168 | void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; | ||
162 | void geometryChanged(const QRectF &newGeometry, | 169 | void geometryChanged(const QRectF &newGeometry, | ||
163 | const QRectF &oldGeometry) Q_DECL_OVERRIDE; | 170 | const QRectF &oldGeometry) Q_DECL_OVERRIDE; | ||
164 | 171 | | |||
165 | void componentComplete() Q_DECL_OVERRIDE; | 172 | void componentComplete() Q_DECL_OVERRIDE; | ||
166 | 173 | | |||
167 | Q_SIGNALS: | 174 | Q_SIGNALS: | ||
168 | void overlaysChanged(); | 175 | void overlaysChanged(); | ||
169 | void activeChanged(); | 176 | void activeChanged(); | ||
170 | void sourceChanged(); | 177 | void sourceChanged(); | ||
171 | void smoothChanged(); | 178 | void smoothChanged(); | ||
172 | void animatedChanged(); | 179 | void animatedChanged(); | ||
173 | void usesPlasmaThemeChanged(); | 180 | void usesPlasmaThemeChanged(); | ||
174 | void roundToIconSizeChanged(); | 181 | void roundToIconSizeChanged(); | ||
175 | void validChanged(); | 182 | void validChanged(); | ||
176 | void colorGroupChanged(); | 183 | void colorGroupChanged(); | ||
177 | void paintedSizeChanged(); | 184 | void paintedSizeChanged(); | ||
178 | void statusChanged(); | 185 | void statusChanged(); | ||
186 | void implicitHeightChanged2(); | ||||
187 | void implicitWidthChanged2(); | ||||
179 | 188 | | |||
180 | private Q_SLOTS: | 189 | private Q_SLOTS: | ||
181 | void schedulePixmapUpdate(); | 190 | void schedulePixmapUpdate(); | ||
182 | void animationFinished(); | 191 | void animationFinished(); | ||
183 | void valueChanged(const QVariant &value); | 192 | void valueChanged(const QVariant &value); | ||
184 | void enabledChanged(); | 193 | void enabledChanged(); | ||
185 | 194 | | |||
186 | private: | 195 | private: | ||
Show All 18 Lines | |||||
205 | bool m_animated; | 214 | bool m_animated; | ||
206 | bool m_usesPlasmaTheme; | 215 | bool m_usesPlasmaTheme; | ||
207 | bool m_roundToIconSize; | 216 | bool m_roundToIconSize; | ||
208 | 217 | | |||
209 | bool m_textureChanged; | 218 | bool m_textureChanged; | ||
210 | bool m_sizeChanged; | 219 | bool m_sizeChanged; | ||
211 | bool m_allowNextAnimation; | 220 | bool m_allowNextAnimation; | ||
212 | bool m_blockNextAnimation; | 221 | bool m_blockNextAnimation; | ||
222 | bool m_implicitHeightSetByUser; | ||||
223 | bool m_implicitWidthSetByUser; | ||||
213 | 224 | | |||
214 | QPixmap m_iconPixmap; | 225 | QPixmap m_iconPixmap; | ||
215 | QPixmap m_oldIconPixmap; | 226 | QPixmap m_oldIconPixmap; | ||
216 | 227 | | |||
217 | QStringList m_overlays; | 228 | QStringList m_overlays; | ||
218 | 229 | | |||
219 | Plasma::Theme::ColorGroup m_colorGroup; | 230 | Plasma::Theme::ColorGroup m_colorGroup; | ||
220 | 231 | | |||
221 | //animation on pixmap change | 232 | //animation on pixmap change | ||
222 | QPropertyAnimation *m_animation; | 233 | QPropertyAnimation *m_animation; | ||
223 | qreal m_animValue; | 234 | qreal m_animValue; | ||
224 | }; | 235 | }; | ||
225 | 236 | | |||
226 | #endif | 237 | #endif |