summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2015-12-30 13:47:59 +0100
committerRobin Burchell <robin.burchell@viroteck.net>2015-12-31 18:01:51 +0000
commita4a8ee48b09e578a1515dbea4fedace849c7e465 (patch)
treec040f026329118e63959a85d2bda1ac11a7ed430
parenta34a6de0b9f6adef67190c862bba971afd5456f5 (diff)
QQuickFlipable: Set enabled property on whichever side is considered active.
This fixes a regression in behavior whereby input is not blocked when the side changes. In QtQuick1, input was tied to opacity: items with a 0 opacity would not receive input. In QtQuick2, this is not the case. [ChangeLog][QtQuick][Flipable] Flipable now toggles the 'enabled' property on whichever side is active. This restores broken behavior compatibility with QtQuick1, and blocks input to whichever side is not active. Change-Id: I36e29089cd7ffd05bf1f415490e0e0816a86bf30 Task-number: QTBUG-37072 Reviewed-by: Michael Brasser <michael.brasser@live.com>
-rw-r--r--src/quick/items/qquickflipable.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/quick/items/qquickflipable.cpp b/src/quick/items/qquickflipable.cpp
index 4fd146f0e4..b0bacf0eb6 100644
--- a/src/quick/items/qquickflipable.cpp
+++ b/src/quick/items/qquickflipable.cpp
@@ -152,8 +152,10 @@ void QQuickFlipable::setFront(QQuickItem *front)
}
d->front = front;
d->front->setParentItem(this);
- if (Back == d->current)
+ if (Back == d->current) {
d->front->setOpacity(0.);
+ d->front->setEnabled(false);
+ }
emit frontChanged();
}
@@ -178,8 +180,11 @@ void QQuickFlipable::setBack(QQuickItem *back)
d->backTransform = new QQuickLocalTransform(d->back);
d->backTransform->prependToItem(d->back);
- if (Front == d->current)
+ if (Front == d->current) {
d->back->setOpacity(0.);
+ d->back->setEnabled(false);
+ }
+
connect(back, SIGNAL(widthChanged()),
this, SLOT(retransformBack()));
connect(back, SIGNAL(heightChanged()),
@@ -271,10 +276,14 @@ void QQuickFlipablePrivate::updateSide()
current = newSide;
if (current == QQuickFlipable::Back && back)
setBackTransform();
- if (front)
+ if (front) {
front->setOpacity((current==QQuickFlipable::Front)?1.:0.);
- if (back)
+ front->setEnabled((current==QQuickFlipable::Front)?true:false);
+ }
+ if (back) {
back->setOpacity((current==QQuickFlipable::Back)?1.:0.);
+ back->setEnabled((current==QQuickFlipable::Back)?true:false);
+ }
emit q->sideChanged();
}
}