summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/mobile
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/flickr/mobile')
-rw-r--r--demos/declarative/flickr/mobile/GridDelegate.qml8
-rw-r--r--demos/declarative/flickr/mobile/ImageDetails.qml18
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml15
-rw-r--r--demos/declarative/flickr/mobile/images/quit.pngbin0 -> 2369 bytes
4 files changed, 28 insertions, 13 deletions
diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml
index 5ab7b87..df608bc 100644
--- a/demos/declarative/flickr/mobile/GridDelegate.qml
+++ b/demos/declarative/flickr/mobile/GridDelegate.qml
@@ -21,7 +21,7 @@
Item {
anchors.centerIn: parent
scale: 0.0
- Behavior on scale { NumberAnimation { easing.type: "InOutQuad"} }
+ Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
id: scaleMe
Rectangle { height: 79; width: 79; id: blackRect; anchors.centerIn: parent; color: "black"; smooth: true }
@@ -38,7 +38,7 @@
states: [
State {
- name: "Show"; when: thumb.status == 1
+ name: "Show"; when: thumb.status == Image.Ready
PropertyChanges { target: scaleMe; scale: 1 }
},
State {
@@ -53,14 +53,14 @@
Transition {
from: "Show"; to: "Details"
ParentAnimation {
- NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
}
},
Transition {
from: "Details"; to: "Show"
SequentialAnimation {
ParentAnimation {
- NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
}
PropertyAction { targets: wrapper; properties: "z" }
}
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index 58b0b83..79d7cab 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -54,7 +54,11 @@ Flipable {
Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 }
- Common.Progress { anchors.centerIn: parent; width: 200; height: 18; progress: bigImage.progress; visible: bigImage.status!=1 }
+ Common.Progress {
+ anchors.centerIn: parent; width: 200; height: 18
+ progress: bigImage.progress; visible: bigImage.status != Image.Ready
+ }
+
Flickable {
id: flickable; anchors.fill: parent; clip: true
contentWidth: imageContainer.width; contentHeight: imageContainer.height
@@ -66,10 +70,10 @@ Flipable {
Image {
id: bigImage; source: container.photoUrl; scale: slider.value
- anchors.centerIn: parent; smooth: !flickable.moving
+ anchors.centerIn: parent; smooth: !flickable.movingVertically
onStatusChanged : {
// Default scale shows the entire image.
- if (status == 1 && width != 0) {
+ if (status == Image.Ready && width != 0) {
slider.minimum = Math.min(flickable.width / width, flickable.height / height);
prevScale = Math.min(slider.minimum, 1);
slider.value = prevScale;
@@ -81,12 +85,12 @@ Flipable {
Text {
text: "Image Unavailable"
- visible: bigImage.status == 'Error'
+ visible: bigImage.status == Image.Error
anchors.centerIn: parent; color: "white"; font.bold: true
}
Common.Slider {
- id: slider; visible: { bigImage.status == 1 && maximum > minimum }
+ id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum }
anchors {
bottom: parent.bottom; bottomMargin: 65
left: parent.left; leftMargin: 25
@@ -114,8 +118,8 @@ Flipable {
transitions: Transition {
SequentialAnimation {
PropertyAction { target: bigImage; property: "smooth"; value: false }
- NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 500 }
- PropertyAction { target: bigImage; property: "smooth"; value: !flickable.moving }
+ NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 500 }
+ PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically }
}
}
}
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index 71d9385..025b897 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -18,10 +18,21 @@ Item {
rssModel.tags = editor.text
}
+ Image {
+ id: quitButton
+ anchors.left: parent.left//; anchors.leftMargin: 0
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/quit.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
Text {
id: categoryText
anchors {
- left: parent.left; right: tagButton.left; leftMargin: 10; rightMargin: 10
+ left: quitButton.right; right: tagButton.left; leftMargin: 10; rightMargin: 10
verticalCenter: parent.verticalCenter
}
elide: Text.ElideLeft
@@ -70,6 +81,6 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
}
}
diff --git a/demos/declarative/flickr/mobile/images/quit.png b/demos/declarative/flickr/mobile/images/quit.png
new file mode 100644
index 0000000..5bda1b6
--- /dev/null
+++ b/demos/declarative/flickr/mobile/images/quit.png
Binary files differ