summaryrefslogtreecommitdiff
path: root/examples/declarative/places/content/places/PlaceDialog.qml
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2012-03-20 13:21:29 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-20 06:39:42 +0100
commit65e7c9757520b689611e5f825936a0d85d76df7e (patch)
treed083ba19d565e46d902058b33abef78e2d85efb8 /examples/declarative/places/content/places/PlaceDialog.qml
parentc263bfdeb47624f0e782789cd4c0eb6c1e802c0e (diff)
downloadqtlocation-65e7c9757520b689611e5f825936a0d85d76df7e.tar.gz
Reset view index when PlaceDialog is closed
Previously if a user switched to the categories page and clicked close the dialog stayed on that page. So now reset to the initial page whenever the opacity reaches 0. An immediate switch to the initial page is not done because the transition is viewable as the close button is pressed, so wait until the dialog has faded out of view before switching. Change-Id: I1b96fc95a309edbc1a739e4ceddb38a6b25b6cba Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'examples/declarative/places/content/places/PlaceDialog.qml')
-rw-r--r--examples/declarative/places/content/places/PlaceDialog.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/declarative/places/content/places/PlaceDialog.qml b/examples/declarative/places/content/places/PlaceDialog.qml
index 15441650..d983f8fa 100644
--- a/examples/declarative/places/content/places/PlaceDialog.qml
+++ b/examples/declarative/places/content/places/PlaceDialog.qml
@@ -51,7 +51,6 @@ Dialog {
signal completed;
function prepareDialog(inputPlace) {
-
if (!inputPlace) {
__place = Qt.createQmlObject('import QtLocation 5.0; Place { }', root);
__createdPlace = true;
@@ -111,6 +110,8 @@ Dialog {
processStatus.prevStatus = __place.status;
}
+ Behavior on opacity { NumberAnimation { duration: 500 } }
+
ErrorDialog {
id: errorDialog
title: "Save Place Failed"
@@ -171,12 +172,18 @@ Dialog {
__place.destroy();
}
+ onOpacityChanged: {
+ if (opacity == 0)
+ customLoader.item.currentIndex = 0
+ }
+
ListModel {
id: dataFieldsModel
}
- customComponent: ListView {
+ customLoader.sourceComponent: ListView {
id: view
+
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 10