summaryrefslogtreecommitdiffstats
path: root/demos/declarative/photoviewer
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-03-15 03:23:38 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-03-15 03:23:38 (GMT)
commit8ff26d85a4eb7ff937f9ecdcd3b71133d6478e15 (patch)
tree5c72214cbe4327a3f8e31bdf488873a7cd91a679 /demos/declarative/photoviewer
parent6a536a8750bf0c82d9bfd557c09827bf61e9986a (diff)
downloadQt-8ff26d85a4eb7ff937f9ecdcd3b71133d6478e15.zip
Qt-8ff26d85a4eb7ff937f9ecdcd3b71133d6478e15.tar.gz
Qt-8ff26d85a4eb7ff937f9ecdcd3b71133d6478e15.tar.bz2
Add busy indicator to photoviewer demo
Diffstat (limited to 'demos/declarative/photoviewer')
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml7
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml9
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml3
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/qmldir1
5 files changed, 18 insertions, 2 deletions
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
index 0821cea..d71834e 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
@@ -30,7 +30,12 @@ Component {
VisualDataModel {
id: visualModel; delegate: PhotoDelegate { }
- model: RssModel { tags: tag }
+ model: RssModel { id: rssModel; tags: tag }
+ }
+
+ BusyIndicator {
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ on: rssModel.status != XmlListModel.Ready
}
PathView {
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml b/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml
new file mode 100644
index 0000000..919ac43
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml
@@ -0,0 +1,9 @@
+import Qt 4.6
+
+Image {
+ id: container
+ property bool on: false
+
+ source: "images/busy.png"; visible: container.on
+ NumberAnimation on rotation { running: container.on; from: 0; to: 360; repeat: true; duration: 1200 }
+}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
index 5a4e63e..89fe3e8 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
@@ -32,7 +32,7 @@ Package {
property int h: getHeight(content)
property double s: calculateScale(w, h, photoWrapper.width)
- color: '#898989'; anchors.centerIn: parent; smooth: true; border.color: 'white'; border.width: 3
+ color: '#878787'; anchors.centerIn: parent; smooth: true; border.color: 'white'; border.width: 3
width: w * s; height: h * s; visible: originalImage.status != Image.Ready
}
Rectangle {
@@ -40,6 +40,7 @@ Package {
width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6
visible: !placeHolder.visible
}
+ BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready }
Image {
id: originalImage; smooth: true; source: "http://" + getImagePath(content)
fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/images/busy.png b/demos/declarative/photoviewer/PhotoViewerCore/images/busy.png
new file mode 100644
index 0000000..664c2b1
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/images/busy.png
Binary files differ
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/qmldir b/demos/declarative/photoviewer/PhotoViewerCore/qmldir
index 1adce10..4821faa 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/qmldir
+++ b/demos/declarative/photoviewer/PhotoViewerCore/qmldir
@@ -3,3 +3,4 @@ PhotoDelegate PhotoDelegate.qml
ProgressBar ProgressBar.qml
RssModel RssModel.qml
Tag Tag.qml
+BusyIndicator BusyIndicator.qml