summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/common
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/flickr/common')
-rw-r--r--demos/declarative/flickr/common/ImageDetails.qml160
-rw-r--r--demos/declarative/flickr/common/LikeOMeter.qml2
-rw-r--r--demos/declarative/flickr/common/Loading.qml2
-rw-r--r--demos/declarative/flickr/common/MediaButton.qml41
-rw-r--r--demos/declarative/flickr/common/MediaLineEdit.qml104
-rw-r--r--demos/declarative/flickr/common/Progress.qml4
-rw-r--r--demos/declarative/flickr/common/RssModel.qml2
-rw-r--r--demos/declarative/flickr/common/ScrollBar.qml4
-rw-r--r--demos/declarative/flickr/common/Slider.qml2
-rw-r--r--demos/declarative/flickr/common/Star.qml2
10 files changed, 9 insertions, 314 deletions
diff --git a/demos/declarative/flickr/common/ImageDetails.qml b/demos/declarative/flickr/common/ImageDetails.qml
deleted file mode 100644
index 862eeb1..0000000
--- a/demos/declarative/flickr/common/ImageDetails.qml
+++ /dev/null
@@ -1,160 +0,0 @@
-import Qt 4.6
-import org.webkit 1.0
-
-Flipable {
- id: container
-
- property var frontContainer: containerFront
- property string photoTitle: ""
- property string photoDescription: ""
- property string photoTags: ""
- property int photoWidth
- property int photoHeight
- property string photoType
- property string photoAuthor
- property string photoDate
- property string photoUrl
- property int rating: 2
- property var prevScale: 1.0
-
- signal closed
-
- transform: Rotation {
- id: detailsRotation
- origin.y: container.height / 2;
- origin.x: container.width / 2;
- axis.y: 1; axis.z: 0
- }
-
- front: Item {
- id: containerFront; anchors.fill: container
-
- Rectangle {
- anchors.fill: parent
- color: "black"; opacity: 0.4
- border.color: "white"; border.width: 2
- }
-
- MediaButton {
- id: backButton; x: 630; y: 370; text: "Back"
- onClicked: { container.closed() }
- }
-
- MediaButton {
- id: moreButton; x: 530; y: 370; text: "View..."
- onClicked: { container.state='Back' }
- }
-
- Text { id: titleText; style: Text.Raised; styleColor: "black"; color: "white"; elide: Text.ElideRight
- x: 220; y: 30; width: parent.width - 240; text: container.photoTitle; font.pointSize: 22 }
-
- LikeOMeter { x: 40; y: 250; rating: container.rating }
-
- Flickable { id: flickable; x: 220; width: 480; height: 210; y: 130; clip: true
- contentWidth: 480; contentHeight: descriptionText.height
-
- WebView { id: descriptionText; width: parent.width
- html: "<style TYPE=\"text/css\">body {color: white;} a:link {color: cyan; text-decoration: underline; }</style>" + container.photoDescription }
- }
-
- Text { id: size; color: "white"; width: 300; x: 40; y: 300
- text: "<b>Size:</b> " + container.photoWidth + 'x' + container.photoHeight }
- Text { id: type; color: "white"; width: 300; x: 40; anchors.top: size.bottom
- text: "<b>Type:</b> " + container.photoType }
-
- Text { id: author; color: "white"; width: 300; x: 220; y: 80
- text: "<b>Author:</b> " + container.photoAuthor }
- Text { id: date; color: "white"; width: 300; x: 220; anchors.top: author.bottom
- text: "<b>Published:</b> " + container.photoDate }
- Text { id: tagsLabel; color: "white"; x: 220; anchors.top: date.bottom;
- text: container.photoTags == "" ? "" : "<b>Tags:</b> " }
- Text { id: tags; color: "white"; width: parent.width-x-20;
- anchors.left: tagsLabel.right; anchors.top: date.bottom;
- elide: Text.ElideRight; text: container.photoTags }
-
- ScrollBar { id: scrollBar; x: 720; y: flickable.y; width: 7; height: flickable.height; opacity: 0;
- flickableArea: flickable; clip: true }
- }
-
- back: Item {
- anchors.fill: container
-
- Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4; border.color: "white"; border.width: 2 }
-
- Progress { anchors.centerIn: parent; width: 200; height: 18; progress: bigImage.progress; visible: bigImage.status!=1 }
- Flickable {
- id: flick; width: container.width - 10; height: container.height - 10
- x: 5; y: 5; clip: true;
- contentWidth: imageContainer.width; contentHeight: imageContainer.height
-
- Item {
- id: imageContainer
- width: Math.max(bigImage.width * bigImage.scale, flick.width);
- height: Math.max(bigImage.height * bigImage.scale, flick.height);
-
- Image {
- id: bigImage; source: container.photoUrl; scale: slider.value
- anchors.centerIn: parent;
- smooth: !flick.moving
- onStatusChanged : {
- // Default scale shows the entire image.
- if (status == 1 && width != 0) {
- slider.minimum = Math.min(flick.width / width, flick.height / height);
- prevScale = Math.min(slider.minimum, 1);
- slider.value = prevScale;
- }
- }
- }
- }
- }
-
- MediaButton {
- id: backButton2; x: 630; y: 370; text: "Back"; onClicked: { container.state = '' }
- }
- Text {
- text: "Image Unavailable"
- visible: bigImage.status == 'Error'
- anchors.centerIn: parent; color: "white"; font.bold: true
- }
-
- Slider {
- id: slider; x: 25; y: 374; visible: { bigImage.status == 1 && maximum > minimum }
- onValueChanged: {
- if (bigImage.width * value > flick.width) {
- var xoff = (flick.width/2 + flick.contentX) * value / prevScale;
- flick.contentX = xoff - flick.width/2;
- }
- if (bigImage.height * value > flick.height) {
- var yoff = (flick.height/2 + flick.contentY) * value / prevScale;
- flick.contentY = yoff - flick.height/2;
- }
- prevScale = value;
- }
- }
- }
-
- states: [
- State {
- name: "Back"
- PropertyChanges { target: detailsRotation; angle: 180 }
- }
- ]
-
- transitions: [
- Transition {
- SequentialAnimation {
- PropertyAction {
- target: bigImage
- property: "smooth"
- value: false
- }
- NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 500 }
- PropertyAction {
- target: bigImage
- property: "smooth"
- value: !flick.moving
- }
- }
- }
- ]
-}
diff --git a/demos/declarative/flickr/common/LikeOMeter.qml b/demos/declarative/flickr/common/LikeOMeter.qml
index 5ee048b..17e3998 100644
--- a/demos/declarative/flickr/common/LikeOMeter.qml
+++ b/demos/declarative/flickr/common/LikeOMeter.qml
@@ -1,4 +1,4 @@
-import Qt 4.6
+import Qt 4.7
Item {
id: container
diff --git a/demos/declarative/flickr/common/Loading.qml b/demos/declarative/flickr/common/Loading.qml
index 4c41717..8daed48 100644
--- a/demos/declarative/flickr/common/Loading.qml
+++ b/demos/declarative/flickr/common/Loading.qml
@@ -1,4 +1,4 @@
-import Qt 4.6
+import Qt 4.7
Image {
id: loading; source: "pics/loading.png"
diff --git a/demos/declarative/flickr/common/MediaButton.qml b/demos/declarative/flickr/common/MediaButton.qml
deleted file mode 100644
index 86ac948..0000000
--- a/demos/declarative/flickr/common/MediaButton.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-import Qt 4.6
-
-Item {
- id: container
-
- signal clicked
-
- property string text
-
- Image {
- id: buttonImage
- source: "pics/button.png"
- }
- Image {
- id: pressed
- source: "pics/button-pressed.png"
- opacity: 0
- }
- MouseArea {
- id: mouseRegion
- anchors.fill: buttonImage
- onClicked: { container.clicked(); }
- }
- Text {
- font.bold: true
- color: "white"
- anchors.centerIn: buttonImage
- text: container.text
- }
- width: buttonImage.width
- states: [
- State {
- name: "Pressed"
- when: mouseRegion.pressed == true
- PropertyChanges {
- target: pressed
- opacity: 1
- }
- }
- ]
-}
diff --git a/demos/declarative/flickr/common/MediaLineEdit.qml b/demos/declarative/flickr/common/MediaLineEdit.qml
deleted file mode 100644
index 9559f6a..0000000
--- a/demos/declarative/flickr/common/MediaLineEdit.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-import Qt 4.6
-
-Item {
- id: container
-
- property string label
- property string text
-
- width: Math.max(94,labeltext.width + editor.width + 20)
- height: buttonImage.height
-
- states: [
- State {
- name: "Edit"
- PropertyChanges {
- target: labeltext
- text: container.label + ": "
- }
- PropertyChanges {
- target: labeltext
- x: 10
- }
- PropertyChanges {
- target: editor
- cursorVisible: true
- width: 100
- }
- PropertyChanges {
- target: container
- focus: true
- }
- StateChangeScript {
- script:editor.selectAll()
- }
- },
- State {
- // When returning to default state, typed text is propagated
- StateChangeScript {
- script: container.text = editor.text
- }
- }
- ]
- transitions: [
- Transition {
- NumberAnimation { properties: "x,width"; duration: 500; easing.type: "InOutQuad" }
- }
- ]
-
-
- BorderImage {
- id: buttonImage
- source: "pics/button.sci"
- anchors.left: container.left
- anchors.right: container.right
- }
-
- BorderImage {
- id: pressed
- source: "pics/button-pressed.sci"
- opacity: 0
- anchors.left: container.left
- anchors.right: container.right
- }
-
- MouseArea {
- id: mouseRegion
- anchors.fill: buttonImage
- onClicked: { container.state = container.state=="Edit" ? "" : "Edit" }
- states: [
- State {
- when: mouseRegion.pressed == true
- PropertyChanges {
- target: pressed
- opacity: 1
- }
- }
- ]
- }
-
- Text {
- id: labeltext
- font.bold: true
- color: "white"
- anchors.verticalCenter: container.verticalCenter
- x: (container.width - width)/2
- text: container.label + "..."
- }
-
- TextInput {
- id: editor
- font.bold: true
- color: "white"
- selectionColor: "green"
- width: 0
- clip: true
- anchors.left: labeltext.right
- anchors.verticalCenter: container.verticalCenter
- }
- Keys.forwardTo: [(returnKey), (editor)]
- Item {
- id: returnKey
- Keys.onReturnPressed: "container.state = ''"
- }
-}
diff --git a/demos/declarative/flickr/common/Progress.qml b/demos/declarative/flickr/common/Progress.qml
index fd9be10..f4d25a4 100644
--- a/demos/declarative/flickr/common/Progress.qml
+++ b/demos/declarative/flickr/common/Progress.qml
@@ -1,7 +1,7 @@
-import Qt 4.6
+import Qt 4.7
Item {
- property var progress: 0
+ property variant progress: 0
Rectangle {
anchors.fill: parent; smooth: true
diff --git a/demos/declarative/flickr/common/RssModel.qml b/demos/declarative/flickr/common/RssModel.qml
index ed9fd5c..d0960db 100644
--- a/demos/declarative/flickr/common/RssModel.qml
+++ b/demos/declarative/flickr/common/RssModel.qml
@@ -1,4 +1,4 @@
-import Qt 4.6
+import Qt 4.7
XmlListModel {
property string tags : ""
diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml
index feebcb0..4022d23 100644
--- a/demos/declarative/flickr/common/ScrollBar.qml
+++ b/demos/declarative/flickr/common/ScrollBar.qml
@@ -1,9 +1,9 @@
-import Qt 4.6
+import Qt 4.7
Item {
id: container
- property var flickableArea
+ property variant flickableArea
Rectangle {
radius: 5
diff --git a/demos/declarative/flickr/common/Slider.qml b/demos/declarative/flickr/common/Slider.qml
index 05a87e7..4da370e 100644
--- a/demos/declarative/flickr/common/Slider.qml
+++ b/demos/declarative/flickr/common/Slider.qml
@@ -1,4 +1,4 @@
-import Qt 4.6
+import Qt 4.7
Item {
id: slider; width: 400; height: 16
diff --git a/demos/declarative/flickr/common/Star.qml b/demos/declarative/flickr/common/Star.qml
index 748a5ec..fcca742 100644
--- a/demos/declarative/flickr/common/Star.qml
+++ b/demos/declarative/flickr/common/Star.qml
@@ -1,4 +1,4 @@
-import Qt 4.6
+import Qt 4.7
Item {
id: container