summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2014-10-09 13:14:12 +0200
committerCaroline Chao <caroline.chao@digia.com>2014-10-10 12:57:03 +0200
commit954fca6eda1378756fe5d33936ae6e88fded3cc3 (patch)
treea166f751bdc5402ac2a85fae96ca5b479901f51c
parenteba86be60e546e766790ba0a6649665c8f275d5e (diff)
Enable reload of upcoming events from HomeScreen
Change-Id: I28c2bb9bd75ee49882a3a58f803ad889ec1d052e Reviewed-by: Niels Weber <niels.weber@digia.com>
-rw-r--r--qml/components/HomeScreen.qml43
-rw-r--r--qml/components/images/icon-loading.svg35
2 files changed, 60 insertions, 18 deletions
diff --git a/qml/components/HomeScreen.qml b/qml/components/HomeScreen.qml
index de67f43..4e8b40c 100644
--- a/qml/components/HomeScreen.qml
+++ b/qml/components/HomeScreen.qml
@@ -149,6 +149,31 @@ Rectangle {
z: -1
color: Theme.colors.smokewhite
}
+ Image {
+ id: reloadUpcoming
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: Theme.margins.fifteen
+ source: Theme.images.loading
+ sourceSize.height: Theme.sizes.reloadButtonSize
+ sourceSize.width: Theme.sizes.reloadButtonSize
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ rotationUpcoming.running = true
+ homeScreenListView.reloadUpcoming()
+ }
+ }
+ RotationAnimation {
+ id: rotationUpcoming
+ target: reloadUpcoming
+ property: "rotation"
+ running: false
+ duration: 800
+ from: 0
+ to: 360
+ }
+ }
}
ListView {
id: homeScreenListView
@@ -159,7 +184,7 @@ Rectangle {
anchors.margins: Theme.margins.ten
model: sortModelNextEvents
clip: true
- onVisibleChanged: {
+ function reloadUpcoming() {
emptyUpcoming.visible = false
if (visible && sortModelNextEvents.rowCount() > 0) {
sortModelNextEvents.filter()
@@ -168,6 +193,8 @@ Rectangle {
if (sortModelNextEvents.rowCount() === 0)
emptyUpcoming.visible = true
}
+
+ onVisibleChanged: homeScreenListView.reloadUpcoming()
Text {
id: emptyUpcoming
visible: false
@@ -278,10 +305,22 @@ Rectangle {
source: Theme.images.loading
sourceSize.height: Theme.sizes.reloadButtonSize
sourceSize.width: Theme.sizes.reloadButtonSize
+ RotationAnimation {
+ id: rotationNews
+ target: reloadNews
+ property: "rotation"
+ running: false
+ duration: 800
+ from: 0
+ to: 360
+ }
}
MouseArea {
anchors.fill: reloadNews
- onClicked: tweetModel.reload()
+ onClicked: {
+ rotationNews.running = true
+ tweetModel.reload()
+ }
}
}
diff --git a/qml/components/images/icon-loading.svg b/qml/components/images/icon-loading.svg
index 5fc315e..de83f50 100644
--- a/qml/components/images/icon-loading.svg
+++ b/qml/components/images/icon-loading.svg
@@ -1,16 +1,19 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="42px" height="42px" viewBox="0 0 42 42" enable-background="new 0 0 42 42" xml:space="preserve">
-<g>
- <rect fill="none" width="42" height="42"/>
- <g>
- <path fill="#808080" d="M29.368,23.887c0.237-0.928,0.401-1.886,0.401-2.887c0-6.49-5.279-11.769-11.77-11.769
- C11.508,9.231,6.23,14.51,6.23,21c0,6.49,5.277,11.77,11.77,11.77c2.475,0,4.766-0.777,6.664-2.086l2.265,4.762
- C24.329,37.055,21.279,38,18,38C8.616,38,1,30.389,1,21S8.616,4,18,4s17,7.611,17,17c0,1.142-0.117,2.256-0.332,3.336
- L29.368,23.887z"/>
- <polygon fill="#808080" points="23.088,18.99 40.604,13.676 35.639,28.846 "/>
- </g>
-</g>
-</svg>
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="42px" height="42px" viewBox="0 0 42 42" enable-background="new 0 0 42 42" xml:space="preserve" inkscape:version="0.48.4 r9939">
+ <metadata id="metadata3090">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs id="defs3088"/>
+ <g id="g3076" transform="matrix(0.86,0,0,0.86,5.747,3.013)">
+ <rect width="42" height="42" id="rect3078" x="0" y="0" style="fill:none"/>
+ <g id="g3080">
+ <path d="M 29.4 23.9 C 29.6 23 29.8 22 29.8 21 29.8 14.5 24.5 9.2 18 9.2 11.5 9.2 6.2 14.5 6.2 21 c 0 6.5 5.3 11.8 11.8 11.8 2.5 0 4.8 -0.8 6.7 -2.1 l 2.3 4.8 C 24.3 37.1 21.3 38 18 38 8.6 38 1 30.4 1 21 1 11.6 8.6 4 18 4 c 9.4 0 17 7.6 17 17 0 1.1 -0.1 2.3 -0.3 3.3 l -5.3 -0.4 z" id="path3082" inkscape:connector-curvature="0" style="fill:#808080"/>
+ <polygon points="35.6,28.8 23.1,19 40.6,13.7" id="polygon3084" style="fill:#808080"/>
+ </g>
+ </g>
+</svg>