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>
This commit is contained in:
parent
a34a6de0b9
commit
a4a8ee48b0
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue