Fix element ids for east orientation.

This commit is contained in:
Eike Hein 2015-12-22 05:03:44 +01:00
parent 5c1d2ed01c
commit 283ab4a634
2 changed files with 4 additions and 15 deletions

View File

@ -48,10 +48,6 @@ IconItem::IconItem(QQuickItem *parent)
m_colorGroup(Plasma::Theme::NormalColorGroup), m_colorGroup(Plasma::Theme::NormalColorGroup),
m_animValue(0) m_animValue(0)
{ {
m_loadPixmapTimer.setSingleShot(true);
m_loadPixmapTimer.setInterval(150);
connect(&m_loadPixmapTimer, &QTimer::timeout, this, &IconItem::loadPixmap);
m_animation = new QPropertyAnimation(this); m_animation = new QPropertyAnimation(this);
connect(m_animation, SIGNAL(valueChanged(QVariant)), connect(m_animation, SIGNAL(valueChanged(QVariant)),
this, SLOT(valueChanged(QVariant))); this, SLOT(valueChanged(QVariant)));
@ -69,7 +65,7 @@ IconItem::IconItem(QQuickItem *parent)
this, SIGNAL(implicitHeightChanged())); this, SIGNAL(implicitHeightChanged()));
connect(this, SIGNAL(enabledChanged()), connect(this, SIGNAL(enabledChanged()),
&m_loadPixmapTimer, SLOT(start())); this, SLOT(loadPixmap()));
//initialize implicit size to the Dialog size //initialize implicit size to the Dialog size
setImplicitWidth(KIconLoader::global()->currentSize(KIconLoader::Dialog)); setImplicitWidth(KIconLoader::global()->currentSize(KIconLoader::Dialog));
@ -88,8 +84,6 @@ void IconItem::setSource(const QVariant &source)
m_source = source; m_source = source;
const bool oldValid = isValid();
if (source.canConvert<QIcon>()) { if (source.canConvert<QIcon>()) {
m_icon = source.value<QIcon>(); m_icon = source.value<QIcon>();
m_imageIcon = QImage(); m_imageIcon = QImage();
@ -182,11 +176,7 @@ void IconItem::setSource(const QVariant &source)
} }
if (width() > 0 && height() > 0) { if (width() > 0 && height() > 0) {
if (!oldValid) {
loadPixmap(); loadPixmap();
} else {
m_loadPixmapTimer.start();
}
} }
emit sourceChanged(); emit sourceChanged();
@ -403,8 +393,8 @@ void IconItem::geometryChanged(const QRectF &newGeometry,
m_sizeChanged = true; m_sizeChanged = true;
update(); update();
if (newGeometry.width() > 0 && newGeometry.height() > 0) { if (newGeometry.width() > 0 && newGeometry.height() > 0) {
if (!m_loadPixmapTimer.isActive() && isComponentComplete()) { if (isComponentComplete()) {
m_loadPixmapTimer.start(); loadPixmap();
} }
} }
} }
@ -417,4 +407,3 @@ void IconItem::componentComplete()
QQuickItem::componentComplete(); QQuickItem::componentComplete();
loadPixmap(); loadPixmap();
} }