From 108f7cec20c105c07a34cded24fc1632b86e15c2 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 12 May 2011 15:43:29 +1000 Subject: [PATCH] Upgrade Flickr demo to QtQuick 2. And throw in particle effects. Includes a variety of fixes to modelparticle and picture affector which were arrived at during this demo. --- demos/declarative/flickr/common/Progress.qml | 73 ----- demos/declarative/flickr/common/RssModel.qml | 66 ----- demos/declarative/flickr/common/ScrollBar.qml | 81 ------ demos/declarative/flickr/common/Slider.qml | 91 ------- demos/declarative/flickr/common/qmldir | 10 - demos/declarative/flickr/content/Button.qml | 79 ++++++ demos/declarative/flickr/content/GridDelegate.qml | 111 ++++++++ demos/declarative/flickr/content/ImageDetails.qml | 275 ++++++++++++++++++++ demos/declarative/flickr/content/ListDelegate.qml | 64 +++++ demos/declarative/flickr/content/Progress.qml | 88 +++++++ demos/declarative/flickr/content/RssModel.qml | 66 +++++ demos/declarative/flickr/content/ScrollBar.qml | 81 ++++++ demos/declarative/flickr/content/Slider.qml | 91 +++++++ demos/declarative/flickr/content/StreamView.qml | 108 ++++++++ demos/declarative/flickr/content/TitleBar.qml | 128 +++++++++ demos/declarative/flickr/content/ToolBar.qml | 69 +++++ .../declarative/flickr/content/UnifiedDelegate.qml | 162 ++++++++++++ demos/declarative/flickr/content/images/gloss.png | Bin 0 -> 1236 bytes .../declarative/flickr/content/images/lineedit.png | Bin 0 -> 1415 bytes .../declarative/flickr/content/images/lineedit.sci | 5 + .../declarative/flickr/content/images/particle.png | Bin 0 -> 5148 bytes demos/declarative/flickr/content/images/quit.png | Bin 0 -> 2369 bytes .../flickr/content/images/squareParticle.png | Bin 0 -> 933 bytes .../declarative/flickr/content/images/stripes.png | Bin 0 -> 257 bytes .../declarative/flickr/content/images/titlebar.png | Bin 0 -> 1436 bytes .../declarative/flickr/content/images/titlebar.sci | 5 + .../flickr/content/images/toolbutton.png | Bin 0 -> 2550 bytes .../flickr/content/images/toolbutton.sci | 5 + demos/declarative/flickr/content/qmldir | 10 + demos/declarative/flickr/flickr-90.qml | 2 +- demos/declarative/flickr/flickr.qml | 75 ++++-- demos/declarative/flickr/mobile/Button.qml | 79 ------ demos/declarative/flickr/mobile/GridDelegate.qml | 111 -------- demos/declarative/flickr/mobile/ImageDetails.qml | 186 ------------- demos/declarative/flickr/mobile/ListDelegate.qml | 64 ----- demos/declarative/flickr/mobile/TitleBar.qml | 128 --------- demos/declarative/flickr/mobile/ToolBar.qml | 69 ----- demos/declarative/flickr/mobile/images/gloss.png | Bin 1236 -> 0 bytes .../declarative/flickr/mobile/images/lineedit.png | Bin 1415 -> 0 bytes .../declarative/flickr/mobile/images/lineedit.sci | 5 - demos/declarative/flickr/mobile/images/quit.png | Bin 2369 -> 0 bytes demos/declarative/flickr/mobile/images/stripes.png | Bin 257 -> 0 bytes .../declarative/flickr/mobile/images/titlebar.png | Bin 1436 -> 0 bytes .../declarative/flickr/mobile/images/titlebar.sci | 5 - .../flickr/mobile/images/toolbutton.png | Bin 2550 -> 0 bytes .../flickr/mobile/images/toolbutton.sci | 5 - src/declarative/scenegraph/util/qsgtexture_p.h | 1 + src/imports/particles/modelparticle.cpp | 17 +- src/imports/particles/particles.pro | 2 +- src/imports/particles/particlesystem.cpp | 2 + src/imports/particles/particlesystem.h | 5 + src/imports/particles/pictureaffector.cpp | 27 ++- src/imports/particles/pictureaffector.h | 10 +- 53 files changed, 1456 insertions(+), 1005 deletions(-) delete mode 100644 demos/declarative/flickr/common/Progress.qml delete mode 100644 demos/declarative/flickr/common/RssModel.qml delete mode 100644 demos/declarative/flickr/common/ScrollBar.qml delete mode 100644 demos/declarative/flickr/common/Slider.qml delete mode 100644 demos/declarative/flickr/common/qmldir create mode 100644 demos/declarative/flickr/content/Button.qml create mode 100644 demos/declarative/flickr/content/GridDelegate.qml create mode 100644 demos/declarative/flickr/content/ImageDetails.qml create mode 100644 demos/declarative/flickr/content/ListDelegate.qml create mode 100644 demos/declarative/flickr/content/Progress.qml create mode 100644 demos/declarative/flickr/content/RssModel.qml create mode 100644 demos/declarative/flickr/content/ScrollBar.qml create mode 100644 demos/declarative/flickr/content/Slider.qml create mode 100644 demos/declarative/flickr/content/StreamView.qml create mode 100644 demos/declarative/flickr/content/TitleBar.qml create mode 100644 demos/declarative/flickr/content/ToolBar.qml create mode 100644 demos/declarative/flickr/content/UnifiedDelegate.qml create mode 100644 demos/declarative/flickr/content/images/gloss.png create mode 100644 demos/declarative/flickr/content/images/lineedit.png create mode 100644 demos/declarative/flickr/content/images/lineedit.sci create mode 100644 demos/declarative/flickr/content/images/particle.png create mode 100644 demos/declarative/flickr/content/images/quit.png create mode 100644 demos/declarative/flickr/content/images/squareParticle.png create mode 100644 demos/declarative/flickr/content/images/stripes.png create mode 100644 demos/declarative/flickr/content/images/titlebar.png create mode 100644 demos/declarative/flickr/content/images/titlebar.sci create mode 100644 demos/declarative/flickr/content/images/toolbutton.png create mode 100644 demos/declarative/flickr/content/images/toolbutton.sci create mode 100644 demos/declarative/flickr/content/qmldir delete mode 100644 demos/declarative/flickr/mobile/Button.qml delete mode 100644 demos/declarative/flickr/mobile/GridDelegate.qml delete mode 100644 demos/declarative/flickr/mobile/ImageDetails.qml delete mode 100644 demos/declarative/flickr/mobile/ListDelegate.qml delete mode 100644 demos/declarative/flickr/mobile/TitleBar.qml delete mode 100644 demos/declarative/flickr/mobile/ToolBar.qml delete mode 100644 demos/declarative/flickr/mobile/images/gloss.png delete mode 100644 demos/declarative/flickr/mobile/images/lineedit.png delete mode 100644 demos/declarative/flickr/mobile/images/lineedit.sci delete mode 100644 demos/declarative/flickr/mobile/images/quit.png delete mode 100644 demos/declarative/flickr/mobile/images/stripes.png delete mode 100644 demos/declarative/flickr/mobile/images/titlebar.png delete mode 100644 demos/declarative/flickr/mobile/images/titlebar.sci delete mode 100644 demos/declarative/flickr/mobile/images/toolbutton.png delete mode 100644 demos/declarative/flickr/mobile/images/toolbutton.sci diff --git a/demos/declarative/flickr/common/Progress.qml b/demos/declarative/flickr/common/Progress.qml deleted file mode 100644 index 2bb4f1a..0000000 --- a/demos/declarative/flickr/common/Progress.qml +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - property variant progress: 0 - - Rectangle { - anchors.fill: parent; smooth: true - border.color: "white"; border.width: 0; radius: height/2 - 2 - gradient: Gradient { - GradientStop { position: 0; color: "#66343434" } - GradientStop { position: 1.0; color: "#66000000" } - } - } - - Rectangle { - y: 2; height: parent.height-4; - x: 2; width: Math.max(parent.width * progress - 4, 0); - opacity: width < 1 ? 0 : 1; smooth: true - gradient: Gradient { - GradientStop { position: 0; color: "lightsteelblue" } - GradientStop { position: 1.0; color: "steelblue" } - } - radius: height/2 - 2 - } - - Text { - text: Math.round(progress * 100) + "%" - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: "white"; font.bold: true; font.pixelSize: 15 - } -} diff --git a/demos/declarative/flickr/common/RssModel.qml b/demos/declarative/flickr/common/RssModel.qml deleted file mode 100644 index 172fdf3..0000000 --- a/demos/declarative/flickr/common/RssModel.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -XmlListModel { - property string tags : "" - - function commasep(x) - { - return x.replace(' ',','); - } - - source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+commasep(tags)+"&" : "")+"format=rss2" - query: "/rss/channel/item" - namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" - - XmlRole { name: "title"; query: "title/string()" } - XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" } - XmlRole { name: "url"; query: "media:content/@url/string()" } - XmlRole { name: "description"; query: "description/string()" } - XmlRole { name: "tags"; query: "media:category/string()" } - XmlRole { name: "photoWidth"; query: "media:content/@width/string()" } - XmlRole { name: "photoHeight"; query: "media:content/@height/string()" } - XmlRole { name: "photoType"; query: "media:content/@type/string()" } - XmlRole { name: "photoAuthor"; query: "author/string()" } - XmlRole { name: "photoDate"; query: "pubDate/string()" } -} diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml deleted file mode 100644 index 1a9f6d8..0000000 --- a/demos/declarative/flickr/common/ScrollBar.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: container - - property variant flickableArea - - Rectangle { - radius: 5 - color: "black" - opacity: 0.3 - border.color: "white" - border.width: 2 - x: 0 - y: flickableArea.visibleArea.yPosition * container.height - width: parent.width - height: flickableArea.visibleArea.heightRatio * container.height - } - states: [ - State { - name: "show" - when: flickableArea.movingVertically - PropertyChanges { - target: container - opacity: 1 - } - } - ] - transitions: [ - Transition { - from: "*" - to: "*" - NumberAnimation { - target: container - properties: "opacity" - duration: 400 - } - } - ] -} diff --git a/demos/declarative/flickr/common/Slider.qml b/demos/declarative/flickr/common/Slider.qml deleted file mode 100644 index 2d35ee4..0000000 --- a/demos/declarative/flickr/common/Slider.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: slider; width: 400; height: 16 - - // value is read/write. - property real value: 1 - onValueChanged: updatePos(); - property real maximum: 1 - property real minimum: 1 - property int xMax: width - handle.width - 4 - onXMaxChanged: updatePos(); - onMinimumChanged: updatePos(); - - function updatePos() { - if (maximum > minimum) { - var pos = 2 + (value - minimum) * slider.xMax / (maximum - minimum); - pos = Math.min(pos, width - handle.width - 2); - pos = Math.max(pos, 2); - handle.x = pos; - } else { - handle.x = 2; - } - } - - Rectangle { - anchors.fill: parent - border.color: "white"; border.width: 0; radius: 8 - gradient: Gradient { - GradientStop { position: 0.0; color: "#66343434" } - GradientStop { position: 1.0; color: "#66000000" } - } - } - - Rectangle { - id: handle; smooth: true - y: 2; width: 30; height: slider.height-4; radius: 6 - gradient: Gradient { - GradientStop { position: 0.0; color: "lightgray" } - GradientStop { position: 1.0; color: "gray" } - } - - MouseArea { - id: mouse - anchors.fill: parent; drag.target: parent - drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: slider.xMax+2 - onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; } - } - } -} diff --git a/demos/declarative/flickr/common/qmldir b/demos/declarative/flickr/common/qmldir deleted file mode 100644 index adc2479..0000000 --- a/demos/declarative/flickr/common/qmldir +++ /dev/null @@ -1,10 +0,0 @@ -ImageDetails ImageDetails.qml -LikeOMeter LikeOMeter.qml -Loading Loading.qml -MediaButton MediaButton.qml -MediaLineEdit MediaLineEdit.qml -Progress Progress.qml -RssModel RssModel.qml -ScrollBar ScrollBar.qml -Slider Slider.qml -Star Star.qml diff --git a/demos/declarative/flickr/content/Button.qml b/demos/declarative/flickr/content/Button.qml new file mode 100644 index 0000000..7285753 --- /dev/null +++ b/demos/declarative/flickr/content/Button.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: container + + signal clicked + + property string text + + BorderImage { + id: buttonImage + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + BorderImage { + id: pressed + opacity: 0 + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + MouseArea { + id: mouseRegion + anchors.fill: buttonImage + onClicked: { container.clicked(); } + } + Text { + color: "white" + anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 15 + text: container.text; style: Text.Raised; styleColor: "black" + } + states: [ + State { + name: "Pressed" + when: mouseRegion.pressed == true + PropertyChanges { target: pressed; opacity: 1 } + } + ] +} diff --git a/demos/declarative/flickr/content/GridDelegate.qml b/demos/declarative/flickr/content/GridDelegate.qml new file mode 100644 index 0000000..5b7af23 --- /dev/null +++ b/demos/declarative/flickr/content/GridDelegate.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: wrapper; width: GridView.view.cellWidth; height: GridView.view.cellHeight + + function photoClicked() { + imageDetails.photoTitle = title; + imageDetails.photoTags = tags; + imageDetails.photoWidth = photoWidth; + imageDetails.photoHeight = photoHeight; + imageDetails.photoType = photoType; + imageDetails.photoAuthor = photoAuthor; + imageDetails.photoDate = photoDate; + imageDetails.photoUrl = url; + imageDetails.rating = 0; + scaleMe.state = "Details"; + } + + Item { + anchors.centerIn: parent + scale: 0.0 + Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} } + id: scaleMe + + Item { + width: 77; height: 77; anchors.centerIn: parent + Rectangle { + id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true + Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true } + Image { source: "images/gloss.png" } + } + } + + Connections { + target: toolBar + onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show' + } + + states: [ + State { + name: "Show"; when: thumb.status == Image.Ready + PropertyChanges { target: scaleMe; scale: 1 } + }, + State { + name: "Details" + PropertyChanges { target: scaleMe; scale: 1 } + ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer } + PropertyChanges { target: background; state: "DetailedView" } + } + ] + transitions: [ + Transition { + from: "Show"; to: "Details" + ParentAnimation { + via: foreground + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } + } + }, + Transition { + from: "Details"; to: "Show" + ParentAnimation { + via: foreground + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } + } + } + ] + } + MouseArea { anchors.fill: wrapper; onClicked: photoClicked() } +} + diff --git a/demos/declarative/flickr/content/ImageDetails.qml b/demos/declarative/flickr/content/ImageDetails.qml new file mode 100644 index 0000000..62c3397 --- /dev/null +++ b/demos/declarative/flickr/content/ImageDetails.qml @@ -0,0 +1,275 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Qt.labs.particles 2.0 + +Flipable { + id: container + + property alias frontContainer: containerFront + property string photoTitle: "" + 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 variant prevScale: 1.0 + + signal closed + + transform: Rotation { + id: itemRotation + 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 + } + + Column { + spacing: 10 + anchors { + left: parent.left; leftMargin: 10 + right: parent.right; rightMargin: 10 + top: parent.top; topMargin: 120 + } + Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle; width: parent.width } + Text { color: "white"; elide: Text.ElideRight; text: "Size: " + container.photoWidth + 'x' + container.photoHeight; width: parent.width } + Text { color: "white"; elide: Text.ElideRight; text: "Type: " + container.photoType; width: parent.width } + Text { color: "white"; elide: Text.ElideRight; text: "Author: " + container.photoAuthor; width: parent.width } + Text { color: "white"; elide: Text.ElideRight; text: "Published: " + container.photoDate; width: parent.width } + Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "Tags: "; width: parent.width } + Text { color: "white"; elide: Text.ElideRight; text: container.photoTags; width: parent.width } + } + } + + back: Item { + anchors.fill: container + + Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 } + + Progress { + anchors.centerIn: parent; width: 200; height: 22 + progress: bigImage.progress; visible: bigImage.status != Image.Ready + } + + Flickable { + id: flickable; anchors.fill: parent; clip: true + contentWidth: imageContainer.width; contentHeight: imageContainer.height + + function updateMinimumScale() { + if (bigImage.status == Image.Ready && bigImage.width != 0) { + slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height); + if (bigImage.width * slider.value > flickable.width) { + var xoff = (flickable.width/2 + flickable.contentX) * slider.value / prevScale; + flickable.contentX = xoff - flickable.width/2; + } + if (bigImage.height * slider.value > flickable.height) { + var yoff = (flickable.height/2 + flickable.contentY) * slider.value / prevScale; + flickable.contentY = yoff - flickable.height/2; + } + prevScale = slider.value; + } + } + + onWidthChanged: updateMinimumScale() + onHeightChanged: updateMinimumScale() + + Item { + id: imageContainer + width: Math.max(bigImage.width * bigImage.scale, flickable.width); + height: Math.max(bigImage.height * bigImage.scale, flickable.height); + Image { + id: bigImage; source: container.photoUrl; scale: slider.value + anchors.centerIn: parent; smooth: !flickable.movingVertically + onStatusChanged : { + // Default scale shows the entire image. + if (bigImage.status == Image.Ready && bigImage.width != 0) { + slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height); + prevScale = Math.min(slider.minimum, 1); + slider.value = prevScale; + } + if (inBackState && bigImage.status == Image.Ready) + particleBox.imageInAnim(); + } + property bool inBackState: false + onInBackStateChanged:{ + if(inBackState && bigImage.status == Image.Ready) + particleBox.imageInAnim(); + else if (!inBackState && bigImage.status == Image.Ready) + particleBox.imageOutAnim(); + } + } + + Item{ + id: particleBox + width: bigImage.width * bigImage.scale + height: bigImage.height * bigImage.scale + anchors.centerIn: parent + + function imageInAnim(){ + cp.visible = true; + pixAffect.onceOff = false; + bigImage.visible = false; + endEffectTimer.start(); + pixelEmitter.pulse(1); + } + function imageOutAnim(){ + cp.visible = true; + pixAffect.onceOff = true; + bigImage.visible = false; + turbulence.active = true; + endEffectTimer.start(); + pixelEmitter.burst(2048); + } + Timer{ + id: endEffectTimer + interval: 1000 + repeat: false + running: false + onTriggered:{ + bigImage.visible = true; + turbulence.active = false; + cp.visible = false; + } + } + ParticleSystem{ + id: imageSystem + } + ColoredParticle{ + id: cp + system: imageSystem + color: "gray" + alpha: 1 + image: "images/squareParticle.png" + colorVariation: 0 + } + Picture{ + id: pixAffect + system: imageSystem + anchors.fill: parent + image: container.photoUrl; + onceOff: true + } + Turbulence{ + id: turbulence + system: imageSystem + anchors.fill: parent + frequency: 100 + strength: 250 + active: false + } + TrailEmitter{ + id: pixelEmitter0 + system: imageSystem + height: parent.height + particleSize: 4 + particleDuration: 1000 + particlesPerSecond: 4096 + speed: PointVector{x: 360; xVariation: 8; yVariation: 4} + emitting: false + } + TrailEmitter{ + id: pixelEmitter + system: imageSystem + anchors.fill: parent + particleSize: 4 + particleDuration: 1000 + particlesPerSecond: 2048 + emitting: false + } + + } + } + } + + Text { + text: "Image Unavailable" + visible: bigImage.status == Image.Error + anchors.centerIn: parent; color: "white"; font.bold: true + } + + Slider { + id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum } + anchors { + bottom: parent.bottom; bottomMargin: 65 + left: parent.left; leftMargin: 25 + right: parent.right; rightMargin: 25 + } + onValueChanged: { + if (bigImage.width * value > flickable.width) { + var xoff = (flickable.width/2 + flickable.contentX) * value / prevScale; + flickable.contentX = xoff - flickable.width/2; + } + if (bigImage.height * value > flickable.height) { + var yoff = (flickable.height/2 + flickable.contentY) * value / prevScale; + flickable.contentY = yoff - flickable.height/2; + } + prevScale = value; + } + } + } + + states: State { + name: "Back" + PropertyChanges { target: itemRotation; angle: 180 } + PropertyChanges { target: toolBar; button2Visible: false } + PropertyChanges { target: toolBar; button1Label: "Back" } + PropertyChanges { target: bigImage; inBackState: true } + } + + transitions: Transition { + SequentialAnimation { + PropertyAction { target: bigImage; property: "smooth"; value: false } + NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 1000 } + PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically } + } + } +} diff --git a/demos/declarative/flickr/content/ListDelegate.qml b/demos/declarative/flickr/content/ListDelegate.qml new file mode 100644 index 0000000..b657048 --- /dev/null +++ b/demos/declarative/flickr/content/ListDelegate.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Component { + Item { + id: wrapper; width: wrapper.ListView.view.width; height: 86 + Item { + id: moveMe + Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 } + Rectangle { + x: 6; y: 4; width: 77; height: 77; color: "white"; smooth: true + + Image { source: imagePath; x: 1; y: 1 } + Image { source: "images/gloss.png" } + } + Column { + x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2 + Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" } + Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" } + Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" } + } + } + } +} diff --git a/demos/declarative/flickr/content/Progress.qml b/demos/declarative/flickr/content/Progress.qml new file mode 100644 index 0000000..d403fee --- /dev/null +++ b/demos/declarative/flickr/content/Progress.qml @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Qt.labs.particles 2.0 + +Item{ + id: container + property variant progress: 0 + + Rectangle { + anchors.fill: parent; smooth: true + border.color: "white"; border.width: 0; radius: height/2 - 2 + gradient: Gradient { + GradientStop { position: 0; color: "#66343434" } + GradientStop { position: 1.0; color: "#66000000" } + } + } + + ParticleSystem{ + running: container.visible + id: barSys + } + ColoredParticle{ + color: "lightsteelblue" + alpha: 0.1 + colorVariation: 0.05 + image: "images/particle.png" + system: barSys + } + TrailEmitter{ + y: 2; height: parent.height-4; + x: 2; width: Math.max(parent.width * progress - 4, 0); + speed: AngleVector{ angleVariation: 180; magnitudeVariation: 12 } + system: barSys + particlesPerSecond: width; + particleDuration: 1000 + particleSize: 20 + particleSizeVariation: 4 + particleEndSize: 12 + maxParticles: parent.width; + } + + Text { + text: Math.round(progress * 100) + "%" + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + color: Qt.rgba(1.0, 1.0 - progress, 1.0 - progress,0.9); font.bold: true; font.pixelSize: 15 + } +} diff --git a/demos/declarative/flickr/content/RssModel.qml b/demos/declarative/flickr/content/RssModel.qml new file mode 100644 index 0000000..007f086 --- /dev/null +++ b/demos/declarative/flickr/content/RssModel.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +XmlListModel { + property string tags : "" + + function commasep(x) + { + return x.replace(' ',','); + } + + source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+commasep(tags)+"&" : "")+"format=rss2" + query: "/rss/channel/item" + namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" + + XmlRole { name: "title"; query: "title/string()" } + XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" } + XmlRole { name: "url"; query: "media:content/@url/string()" } + XmlRole { name: "description"; query: "description/string()" } + XmlRole { name: "tags"; query: "media:category/string()" } + XmlRole { name: "photoWidth"; query: "media:content/@width/string()" } + XmlRole { name: "photoHeight"; query: "media:content/@height/string()" } + XmlRole { name: "photoType"; query: "media:content/@type/string()" } + XmlRole { name: "photoAuthor"; query: "author/string()" } + XmlRole { name: "photoDate"; query: "pubDate/string()" } +} diff --git a/demos/declarative/flickr/content/ScrollBar.qml b/demos/declarative/flickr/content/ScrollBar.qml new file mode 100644 index 0000000..7d2d9ff --- /dev/null +++ b/demos/declarative/flickr/content/ScrollBar.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: container + + property variant flickableArea + + Rectangle { + radius: 5 + color: "black" + opacity: 0.3 + border.color: "white" + border.width: 2 + x: 0 + y: flickableArea.visibleArea.yPosition * container.height + width: parent.width + height: flickableArea.visibleArea.heightRatio * container.height + } + states: [ + State { + name: "show" + when: flickableArea.movingVertically + PropertyChanges { + target: container + opacity: 1 + } + } + ] + transitions: [ + Transition { + from: "*" + to: "*" + NumberAnimation { + target: container + properties: "opacity" + duration: 400 + } + } + ] +} diff --git a/demos/declarative/flickr/content/Slider.qml b/demos/declarative/flickr/content/Slider.qml new file mode 100644 index 0000000..b4a2960 --- /dev/null +++ b/demos/declarative/flickr/content/Slider.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: slider; width: 400; height: 16 + + // value is read/write. + property real value: 1 + onValueChanged: updatePos(); + property real maximum: 1 + property real minimum: 1 + property int xMax: width - handle.width - 4 + onXMaxChanged: updatePos(); + onMinimumChanged: updatePos(); + + function updatePos() { + if (maximum > minimum) { + var pos = 2 + (value - minimum) * slider.xMax / (maximum - minimum); + pos = Math.min(pos, width - handle.width - 2); + pos = Math.max(pos, 2); + handle.x = pos; + } else { + handle.x = 2; + } + } + + Rectangle { + anchors.fill: parent + border.color: "white"; border.width: 0; radius: 8 + gradient: Gradient { + GradientStop { position: 0.0; color: "#66343434" } + GradientStop { position: 1.0; color: "#66000000" } + } + } + + Rectangle { + id: handle; smooth: true + y: 2; width: 30; height: slider.height-4; radius: 6 + gradient: Gradient { + GradientStop { position: 0.0; color: "lightgray" } + GradientStop { position: 1.0; color: "gray" } + } + + MouseArea { + id: mouse + anchors.fill: parent; drag.target: parent + drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: slider.xMax+2 + onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; } + } + } +} diff --git a/demos/declarative/flickr/content/StreamView.qml b/demos/declarative/flickr/content/StreamView.qml new file mode 100644 index 0000000..26384d3 --- /dev/null +++ b/demos/declarative/flickr/content/StreamView.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Qt.labs.particles 2.0 + +Item{ + id: container + property alias model: mp.model + property alias delegate: mp.delegate + property bool jumpStarted: false + ParticleSystem{ + id: sys + anchors.fill:parent + overwrite: false + } + ModelParticle{ + id: mp + fade: false + system: sys + anchors.fill: parent + onModelCountChanged: { + if(!jumpStarted && modelCount > 0){ + console.log("Jumping"); + jumpStarted = true; + sys.fastForward(8000); + } + } + } + property real emitterSpacing: parent.width/3 + TrailEmitter{ + system: sys + width: emitterSpacing - 64 + x: emitterSpacing*0 + 32 + y: -128 + height: 32 + speed: PointVector{ y: (container.height + 128)/12 } + particlesPerSecond: 0.4 + particleDuration: 1000000//eventually -1 should mean a million seconds for neatness + maxParticles: 15 + } + TrailEmitter{ + system: sys + width: emitterSpacing - 64 + x: emitterSpacing*1 + 32 + y: -128 + height: 32 + speed: PointVector{ y: (container.height + 128)/12 } + particlesPerSecond: 0.4 + particleDuration: 1000000//eventually -1 should mean a million seconds for neatness + maxParticles: 15 + } + TrailEmitter{ + system: sys + width: emitterSpacing - 64 + x: emitterSpacing*2 + 32 + y: -128 + height: 32 + speed: PointVector{ y: (container.height + 128)/12 } + particlesPerSecond: 0.4 + particleDuration: 1000000//eventually -1 should mean a million seconds for neatness + maxParticles: 15 + } + Kill{ + system: sys + y: container.height + 64 + width: container.width + height: 6400 + } +} diff --git a/demos/declarative/flickr/content/TitleBar.qml b/demos/declarative/flickr/content/TitleBar.qml new file mode 100644 index 0000000..381d252 --- /dev/null +++ b/demos/declarative/flickr/content/TitleBar.qml @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: titleBar + property string untaggedString: "Uploads from everyone" + property string taggedString: "Recent uploads tagged " + + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + + Item { + id: container + width: (parent.width * 2) - 55 ; height: parent.height + + function accept() { + imageDetails.closed() + titleBar.state = "" + background.state = "" + 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: quitButton.right; right: tagButton.left; leftMargin: 10; rightMargin: 10 + verticalCenter: parent.verticalCenter + } + elide: Text.ElideLeft + text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags) + font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black" + } + + Button { + id: tagButton; x: titleBar.width - 50; width: 45; height: 32; text: "..." + onClicked: if (titleBar.state == "Tags") container.accept(); else titleBar.state = "Tags" + anchors.verticalCenter: parent.verticalCenter + } + + Item { + id: lineEdit + y: 4; height: parent.height - 9 + anchors { left: tagButton.right; leftMargin: 5; right: parent.right; rightMargin: 5 } + + BorderImage { source: "images/lineedit.sci"; anchors.fill: parent } + + TextInput { + id: editor + anchors { + left: parent.left; right: parent.right; leftMargin: 10; rightMargin: 10 + verticalCenter: parent.verticalCenter + } + cursorVisible: true; font.bold: true + color: "#151515"; selectionColor: "Green" + } + + Keys.forwardTo: [ (returnKey), (editor)] + + Item { + id: returnKey + Keys.onReturnPressed: container.accept() + Keys.onEnterPressed: container.accept() + Keys.onEscapePressed: titleBar.state = "" + } + } + } + + states: State { + name: "Tags" + PropertyChanges { target: container; x: -tagButton.x + 5 } + PropertyChanges { target: tagButton; text: "OK" } + PropertyChanges { target: editor; focus: true } + } + + transitions: Transition { + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } + } +} diff --git a/demos/declarative/flickr/content/ToolBar.qml b/demos/declarative/flickr/content/ToolBar.qml new file mode 100644 index 0000000..ca5341e --- /dev/null +++ b/demos/declarative/flickr/content/ToolBar.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: toolbar + + property alias button1Label: button1.text + property alias button2Label: button2.text + property alias button2Visible: button2.visible + + signal button1Clicked + signal button2Clicked + + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + + Row { + anchors.right: parent.right; anchors.rightMargin: 5; y: 3; height: 32; spacing: 30 + Button { + id: button1 + width: 140; height: 32 + onClicked: toolbar.button1Clicked() + } + + Button { + id: button2; width: 140; height: 32 + onClicked: toolbar.button2Clicked() + } + } +} diff --git a/demos/declarative/flickr/content/UnifiedDelegate.qml b/demos/declarative/flickr/content/UnifiedDelegate.qml new file mode 100644 index 0000000..aaf4ccb --- /dev/null +++ b/demos/declarative/flickr/content/UnifiedDelegate.qml @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Qt.labs.particles 2.0 + +Package { + function photoClicked() { + imageDetails.photoTitle = title; + imageDetails.photoTags = tags; + imageDetails.photoWidth = photoWidth; + imageDetails.photoHeight = photoHeight; + imageDetails.photoType = photoType; + imageDetails.photoAuthor = photoAuthor; + imageDetails.photoDate = photoDate; + imageDetails.photoUrl = url; + imageDetails.rating = 0; + scaleMe.state = "Details"; + } + + Item { + id: gridwrapper; + width: GridView.view.cellWidth; height: GridView.view.cellHeight + Package.name: "grid" + } + Item { + id: streamwrapper; + width: 80; height: 80 + Package.name: "stream" + function pleaseFreeze(){ + ModelParticle.particle.freeze(streamwrapper); + } + function pleaseUnfreeze(){ + ModelParticle.particle.unfreeze(streamwrapper); + } + } + Item { + //anchors.centerIn: parent//Doesn't animate :( + width: 80; height: 80 + scale: 0.0 + Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} } + id: scaleMe + + Item { + id: whiteRectContainer + width: 77; height: 77; anchors.centerIn: parent + Rectangle { + id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true + x:0; y:0 + Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true } + Image { source: "images/gloss.png" } + MouseArea { anchors.fill: parent; onClicked: photoClicked() } + } + } + + Connections { + target: toolBar + onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show' + } + + state: 'inStream' + states: [ + State { + name: "Show"; when: thumb.status == Image.Ready + PropertyChanges { target: scaleMe; scale: 1; } + }, + State { + name: "Details" + PropertyChanges { target: scaleMe; scale: 1 } + ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer } + PropertyChanges { target: background; state: "DetailedView" } + } + ] + transitions: [ + Transition { + from: "Show"; to: "Details" + ScriptAction{ script: streamwrapper.pleaseFreeze(); } + ParentAnimation { + via: foreground + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } + } + }, + Transition { + from: "Details"; to: "Show" + SequentialAnimation{ + ParentAnimation { + via: foreground + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } + } + ScriptAction{ script: streamwrapper.pleaseUnfreeze(); } + } + } + ] + Item{ + id: stateContainer + states: [ + State { + name: 'inStream' + when: screen.inGridView == false + ParentChange { + target: scaleMe; parent: streamwrapper + x: 0; y: 0; + } + }, + State { + name: 'inGrid' + when: screen.inGridView == true + ParentChange { + target: scaleMe; parent: gridwrapper + x: 0; y: 0; + } + } + ] + + transitions: [ + Transition { + ParentAnimation { + NumberAnimation { target: scaleMe; properties: 'x,y,width,height'; duration: 300 } + } + } + ] + } + } +} diff --git a/demos/declarative/flickr/content/images/gloss.png b/demos/declarative/flickr/content/images/gloss.png new file mode 100644 index 0000000000000000000000000000000000000000..5d370cd93d62ed8c17f43a5d5dc7ed20b4edb5a1 GIT binary patch literal 1236 zcmV;_1S|WAP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXV} z1RN8~lD~8S00dM?L_t(|+U;D~QX4T4Y^|4I%x&WY2)X$GFUv=G^5Ah$39VMg=va`d zC|s_Uy=qPO^vntr5k28JNc(~Dd+K$Gc~DBB#W4cV?@SptZ+lM}i&GQx%xh!kfrzL@ z07n4B%%VsG*ail9fPugbdiNd?H5ZBF1TYj4iBs382}&wQ#5p&F7|Gfo>XGL|IoG0; z1uP$``hsYsb4?IO?WU#{5*!)YwFid`gn;j)_=(b`K|DnsEHq1Al=0ai^Fno!0I1TD zXlC0`VV|R1%Dh+^C>Dukw$*P~l5(k3MGBpBMdRqutrW_s0#uy?Kf71-G085oJGaoo zl<|!K!#7DyZiqCUb=rnTi_b!b8Qm%w!H}l2En!IPddta1%qyCjC*kj;!SFHHF?3GW zL|b{5>hDw}RZ}xI1#a3q5JTx~mS;*x?^2TuGH7rRus(DiJprT05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5HC*jIC@bW7P5Ig-Q0^y^q_fw-J0m zj6kelw5houE82_#qG*u0YpWrOL||gWgF7E!_uyWV$r+*^k1tf(Nzyug%&@zEC#Vp+ z-0V1`zZa3St15$kvK(nl2r0Q-Ol?bzPe1yE_Wn-16qKwXbQZd~X=oG9`UMY4vl+b0 zEnCN`x?~q=^<8j}D4GBshPtXa^+Ya*&qxsw>eJKYeXeO|nvjp$2uVtm%P$GQ)!16A z-IodyiE^a&f9@ zg^NzDgk`h4nq^mljWq?lp1@rd!^XPn3-G$v@IS#B>(;l1*FD3=7z6=p7QBqiqj*h# z&EKk9S5?Jwoz)G%Hvs=H0AE)=yzUq_#^Q+=c-?wn*BH}0|MpiYT>j7{ndOr+G4IzOEFes*|GuptD@Dn(UGS#&L;j-B|1 zsH2&U*y-tMthY=|O)&E12&puhdPbUwrL2)l&@_WansDUHBbW#pjRtn=iwR<%r@Xbo z>xbXq$gvR+AQ*y%t9FW(r2eak2q6SQ2y>BZ>oaQ{Si`}O4l?}XFokNK^g@Dj-o4ke zx%6ClbA{3AKREpPVMralr3&30T?m4~tjYp3#x%Xv+RLJ=pMU$6*WP`Vw?2HE(vDvG zH&!`)=oDr{dBY=Z1JVB4{)cKwd%}h9#u+~`PH(A~qAgOS0~=d(nRpiqz_Tp7ET(F) ztO{e7&NJ@D=)I{#d25;Rqi31?qW*%Z4h)(!4G(v0E53Nwle=ndLj^P#M$e4Wn3_Q* zQyOG=?^iU63Yz`vea1jnUk`=u9Qi_#^Iu=!_@Se(6#5Gc0r98Q=HtI=(yw9^-MaUwHRW)2O7;H&o=HewTo|>XD7CtH6S$fJB{J3#O{sI^e VqK)QbrHcRn002ovPDHLkV1mrKo*@7L literal 0 HcmV?d00001 diff --git a/demos/declarative/flickr/content/images/lineedit.sci b/demos/declarative/flickr/content/images/lineedit.sci new file mode 100644 index 0000000..054bff7 --- /dev/null +++ b/demos/declarative/flickr/content/images/lineedit.sci @@ -0,0 +1,5 @@ +border.left: 10 +border.top: 10 +border.bottom: 10 +border.right: 10 +source: lineedit.png diff --git a/demos/declarative/flickr/content/images/particle.png b/demos/declarative/flickr/content/images/particle.png new file mode 100644 index 0000000000000000000000000000000000000000..dbc39cb16eec43d80546f79ade596d2b0bf5bc3e GIT binary patch literal 5148 zcmeHL`8$+t-@lB(&?x(sWg3(UGsD;hS!TwTWek;_VaAeW#u$4TYnDiEm2PE8Bq~!x zRF<+Qv{59oR2ou|eR;T_yZd>6czgeW_c@Q_y3X@^9-q(WyB^1N99J5_+LWJ9iVpw) zeseP%aeHU(JP^+9_rln@mF-QEfp=ioQN0=ABsv8!B2zsnF!Ml?4~0k}kt2hy>!TMgCj7#2+X!XAcaAKMFa)}g?as3KLokeW!CCQ22hj@HuBQiiD^QAh+*4S`ZqL1|&s)i6jT z?C%BN_C_arV~9ADzkO|6`fy(cgN8vM!o$N=!_`%(bRPstM@MHzLrqO(8=(>s8N?t( zs04+`|5CtFLcHjHG=?8F2)3h0@}!0`^x@l){yT+0+CQ>EA%B-?yI_b25)FY;Med~Z z3utBae?tQU|3QZ^h?M`t`@af@*hkVR2qGnf8cO%tZk)ILjw>1lOQ(<+RJuKt8t|)% z1YatH8sbZ(!LW83Fe{RmU(k;I7v9PWV;&U3AO(3*%yIhgZ3R_7KQcxOt7Bq}M`~!O zs@7e*nQ z(5Zp2zf#8d{XQ1;-|GF%CI3Da^l!O{?O+f)jr|{u{&lrIJv+yL#&+BIXYeUO+tW_p z9_tESYi$4kZ4fN&@mv30|E<9P*9s7GTJyKR4Vw(2wH?3#;skSX^FVm{c0u`f?-39b z5*85^6PJ*b+AA$1D+k*Lmse2Se?aNrp~K25st6=XO&zVFsim!h(bdyGVqj=wjK$$i zOwG(Kj#^q-+YoGtcJ{}PpKx$=a&~cbbN3*5dXXvKKE8e@{R0AnsI*{u2qQEsJR&kG z`czD895X&4F)2CabZT09#+l5lv)Siz{>VLl;bPvUKl3kNDJU!|zFKmvwCsBMjf%>f zw{BOl?%b`exmR0vzrNwY!$*xx%`K0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Dy_Ds;(+1a02w)Nn~^&5l_^Jur)m!Eko$iO@_Y^QmpyfBxWu4<>k?N2k>Wz(5G# z^ZCXR^ZWfsrc&77+ef|Lpt`1$cq|54kzrZpYbiho0b?!<(?mX>2V)S2L;JR_>nCF0 z3QZ=HpHNEwdh_PZ5YO}IcDo>WHHuz@{C+>;$prTIcCov+S2=7QF2`f>e^qPMLNpqM zBuOwW3m^pG2ngq;3Ii}0n8@X_;5bgS?US)@gvMgAA8{P_Xl-px;CUXsUJr~h5W>O7 zz066!-;a1Aj^h44cK7xw&1Q2AK(pKHZpY*C;)`mf5RFD5N)jx~`cC!sO1Np7$YjzW zWMYKX-iUn@RGOTe+`M$@vXD-v(P{TU+3~&eW!VV?1Bk_A9&&fD(r7f+05p#$>2x~V ziCCgodGVqUiAEucB8I~uIF1820v|UqN&^PVvaq-~58JlIe!u@q%d-9mU~n4LRw9Z$ zFb1FSQz1yQ1j{r>J}<}oem`brW^izDfSqr@t<)R!*O0GbG?9XMp;)}{C4MY*PZG*r=Mj{IO{XU*Qe-6iS?o}$4-+mW);$b>E zI@$;eg4*qN*CknkEX#0R7g6t@5BTPrZz{D~?L_49Xm{G%i9}+zQmGWCr>BW1if|kk ziXubPG(3O)9K)e~uUszw{!PeJ%hS=3x*>!GwcG8i%d(6_B7yz={c|D5*mnD$ilS^* ztJT8H^h_W+9fhhMjgZ58<#Oq*$TJmu^+??i1VQa|I_s8YVP|KjQmt0cg*+a;UT;Sf zgpGQ=R+yOZ2X}XOF&qx>l}ZOEBF}Zp%49NMD2mbs5c|H9Wzy-7XJ%&9TrT(dyWWXU nySqj%a6ak3fqXyy@5X-sx(=UtGtDhU00000NkvXXu0mjfre}bX literal 0 HcmV?d00001 diff --git a/demos/declarative/flickr/content/images/squareParticle.png b/demos/declarative/flickr/content/images/squareParticle.png new file mode 100644 index 0000000000000000000000000000000000000000..faf85c24e08d9415fbd4d6dfe46ac6dc6a898e8a GIT binary patch literal 933 zcmaJ=y^hmB5Z)scr-mKqFn=ZnuEvMt{VB&9=elt+om#~$YQXry&z%06r zQ!}%aovta*d01264kDJ8a$nTc8$z3L3hOGW_^5$k1FN`NGYsP;)DcD+(lxACuwhnp z6Ct>N6q$_&b93bM_qn8JDGMPIQ`6S#wYsjVjNfRu*=*(-x?YipO1g;!$trPrUMM&; z^?8_xki{@pBr~=WmLe;?Zy`z!vT?eC)%_$L#PZ+x`ZgIF^f~5DGu=29B=)K6 zSc+6o!!R%}bQ>eRS8Y_g4UBu}!qA(YzJo9}x^|=1FSri#R}qax!3`d`wWHj86{19D zb|??u(V)*+1a~c);qhAVQN2AkI9`i>l&i^Nw0y9C4Y~-)?a7aawUy3c@o6l#oy)cU w?A<+;zeH(xJ?TmNWo!MCrtCVM$>|IK{UZQQ!O17%nQL70(Y)*K0-AbW|YuPgga4pBxq@gGdLS%5-~o-U3d5|`(m z-N<{$K*aT;^vADLPxXoJET5>DG2xP-Q1*siVN6aag0$kQzm$|0%E+I; z#Y!4I)=g1)z4*}Q$iB}`v_QR literal 0 HcmV?d00001 diff --git a/demos/declarative/flickr/content/images/titlebar.png b/demos/declarative/flickr/content/images/titlebar.png new file mode 100644 index 0000000000000000000000000000000000000000..51c90082d052a94af34488ca9a13842122f7d7a4 GIT binary patch literal 1436 zcmV;N1!MY&P)00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXW1 z0xv7!9LBW(000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000E{NklLiq!w7*fp`1oo9~;MC5Hkm0Ga8f)%S;LHn|^l4>W+QI@MK<0LU%? zTCN^g=1tdNq`Dpph=PESv9&Y_yal)K%ETFKXCtR`vY67D3wB9@+&cbGgIArTN6+wSAX zkGy^RmUr*o{T4#Fkk#tskC!ih`Tfb0Cxj5Vy1F8SK-YDE!#OZB%*L~eNSa)23&d?U zSw1i0>gRr9IT1mtHP62Lmb0@nE-o&3^XAQ;^5Vq{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D7!gpI3_$P_2Y zXj^4Hpb~@jABRyBv#xkv7@Q)ZX^GWhn9R`BTRahgC%42QakQgUs;|?9;zFSmM@zL% zV}$49@j^}607?MEnUtDLmgEhg>NvdsL1X{l?miLb6QL>F?fCeFO zsI4~A0h=mq2wEVgUjNPZ_SA?HcRhSr0ghPFZG_VDS?VlMl^)zw?WNM5^V=(e&bbVP zRz3Tk4%(EbBtv=*8={Q8u2YKVQik-7Z#x$-NEQ+htR;Wx&Yp9`fu<B652VFZWs1RLPz+Io`c{_x1PR z|MypJ{*KUJFE1~D@&5Yy`QyirvDs{LOy>%5{%%hECFmYHFNM)una#u=iB$nYl{xCd z>`+x%o@f%LY03<`ySu}iH*fIv?OUwZ>tEj9e)yIE;PmwL*>=1AaDTV`n{)0{=Nx!) z-Lt<3#d3W%kV<5&zUl_us};i&=sgCA%~?Pyr_&~;w%^s&Ri4EE09*nYhh&1)L;wH) M07*qoM6N<$g3{N*E&u=k literal 0 HcmV?d00001 diff --git a/demos/declarative/flickr/content/images/toolbutton.sci b/demos/declarative/flickr/content/images/toolbutton.sci new file mode 100644 index 0000000..9e4f965 --- /dev/null +++ b/demos/declarative/flickr/content/images/toolbutton.sci @@ -0,0 +1,5 @@ +border.left: 15 +border.top: 4 +border.bottom: 4 +border.right: 15 +source: toolbutton.png diff --git a/demos/declarative/flickr/content/qmldir b/demos/declarative/flickr/content/qmldir new file mode 100644 index 0000000..adc2479 --- /dev/null +++ b/demos/declarative/flickr/content/qmldir @@ -0,0 +1,10 @@ +ImageDetails ImageDetails.qml +LikeOMeter LikeOMeter.qml +Loading Loading.qml +MediaButton MediaButton.qml +MediaLineEdit MediaLineEdit.qml +Progress Progress.qml +RssModel RssModel.qml +ScrollBar ScrollBar.qml +Slider Slider.qml +Star Star.qml diff --git a/demos/declarative/flickr/flickr-90.qml b/demos/declarative/flickr/flickr-90.qml index a3db5c3..9609137 100644 --- a/demos/declarative/flickr/flickr-90.qml +++ b/demos/declarative/flickr/flickr-90.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.0 Item { width: 480; height: 320 diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index e0af466..8543692 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -39,21 +39,62 @@ ** ****************************************************************************/ -import QtQuick 1.0 -import "common" as Common -import "mobile" as Mobile +import QtQuick 2.0 +import Qt.labs.particles 2.0 +import "content" Item { id: screen; width: 320; height: 480 - property bool inListView : false + property bool inGridView : false Rectangle { id: background anchors.fill: parent; color: "#343434"; - Image { source: "mobile/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } + Image { source: "content/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } + ParticleSystem { + id: bgParticles + startTime: 16000 + } + ColoredParticle { + particles: ["trail"] + image: "content/images/particle.png" + color: "#1A1A6F" + alpha: 0.1 + colorVariation: 0.01 + blueVariation: 0.8 + system: bgParticles + } + TrailEmitter { + particle: "drops" + width: parent.width + particlesPerSecond: 0.5 + particleDuration: 20000 + speed: PointVector{ + y: {screen.height/18} + } + system: bgParticles + } + FollowEmitter { + follow: "drops" + particle: "trail" + particlesPerParticlePerSecond: 18 + particleSize: 32 + particleEndSize: 0 + particleSizeVariation: 4 + particleDuration: 1200 + system: bgParticles + anchors.fill: parent + emissionWidth: 16 + emissionHeight: 16 + emissionShape: Ellipse{} + } - Common.RssModel { id: rssModel } + VisualDataModel{ + id: vdm + delegate: UnifiedDelegate{} + model: RssModel { id: rssModel } + } Item { id: views @@ -61,39 +102,38 @@ Item { anchors.top: titleBar.bottom; anchors.bottom: toolBar.top GridView { - id: photoGridView; model: rssModel; delegate: Mobile.GridDelegate {} + id: photoGridView; model: vdm.parts.grid cacheBuffer: 1000 cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height } - ListView { - id: photoListView; model: rssModel; delegate: Mobile.ListDelegate { } - width: parent.width; height: parent.height; x: -(parent.width * 1.5); cacheBuffer: 100; + StreamView{ + id: photoStreamView + model: vdm.parts.stream + width: parent.width; height: parent.height } states: State { - name: "ListView"; when: screen.inListView == true - PropertyChanges { target: photoListView; x: 0 } - PropertyChanges { target: photoGridView; x: -(parent.width * 1.5) } + name: "GridView"; when: screen.inGridView == true } transitions: Transition { NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad } } - Mobile.ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height } + ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height } Item { id: foreground; anchors.fill: parent } } - Mobile.TitleBar { id: titleBar; width: parent.width; height: 40; opacity: 0.9 } + TitleBar { id: titleBar; width: parent.width; height: 40; opacity: 0.9 } - Mobile.ToolBar { + ToolBar { id: toolBar height: 40; anchors.bottom: parent.bottom; width: parent.width; opacity: 0.9 button1Label: "Update"; button2Label: "View mode" onButton1Clicked: rssModel.reload() - onButton2Clicked: if (screen.inListView == true) screen.inListView = false; else screen.inListView = true + onButton2Clicked: if (screen.inGridView == true) screen.inGridView = false; else screen.inGridView = true } Connections { @@ -121,5 +161,6 @@ Item { transitions: Transition { NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad } } + } } diff --git a/demos/declarative/flickr/mobile/Button.qml b/demos/declarative/flickr/mobile/Button.qml deleted file mode 100644 index 5390115..0000000 --- a/demos/declarative/flickr/mobile/Button.qml +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: container - - signal clicked - - property string text - - BorderImage { - id: buttonImage - source: "images/toolbutton.sci" - width: container.width; height: container.height - } - BorderImage { - id: pressed - opacity: 0 - source: "images/toolbutton.sci" - width: container.width; height: container.height - } - MouseArea { - id: mouseRegion - anchors.fill: buttonImage - onClicked: { container.clicked(); } - } - Text { - color: "white" - anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 15 - text: container.text; style: Text.Raised; styleColor: "black" - } - states: [ - State { - name: "Pressed" - when: mouseRegion.pressed == true - PropertyChanges { target: pressed; opacity: 1 } - } - ] -} diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml deleted file mode 100644 index 06e0b85..0000000 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: wrapper; width: GridView.view.cellWidth; height: GridView.view.cellHeight - - function photoClicked() { - imageDetails.photoTitle = title; - imageDetails.photoTags = tags; - imageDetails.photoWidth = photoWidth; - imageDetails.photoHeight = photoHeight; - imageDetails.photoType = photoType; - imageDetails.photoAuthor = photoAuthor; - imageDetails.photoDate = photoDate; - imageDetails.photoUrl = url; - imageDetails.rating = 0; - scaleMe.state = "Details"; - } - - Item { - anchors.centerIn: parent - scale: 0.0 - Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} } - id: scaleMe - - Item { - width: 77; height: 77; anchors.centerIn: parent - Rectangle { - id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true - Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true } - Image { source: "images/gloss.png" } - } - } - - Connections { - target: toolBar - onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show' - } - - states: [ - State { - name: "Show"; when: thumb.status == Image.Ready - PropertyChanges { target: scaleMe; scale: 1 } - }, - State { - name: "Details" - PropertyChanges { target: scaleMe; scale: 1 } - ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer } - PropertyChanges { target: background; state: "DetailedView" } - } - ] - transitions: [ - Transition { - from: "Show"; to: "Details" - ParentAnimation { - via: foreground - NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } - } - }, - Transition { - from: "Details"; to: "Show" - ParentAnimation { - via: foreground - NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } - } - } - ] - } - MouseArea { anchors.fill: wrapper; onClicked: photoClicked() } -} - diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml deleted file mode 100644 index 1f49160..0000000 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "../common" as Common - -Flipable { - id: container - - property alias frontContainer: containerFront - property string photoTitle: "" - 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 variant prevScale: 1.0 - - signal closed - - transform: Rotation { - id: itemRotation - 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 - } - - Column { - spacing: 10 - anchors { - left: parent.left; leftMargin: 10 - right: parent.right; rightMargin: 10 - top: parent.top; topMargin: 120 - } - Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle; width: parent.width } - Text { color: "white"; elide: Text.ElideRight; text: "Size: " + container.photoWidth + 'x' + container.photoHeight; width: parent.width } - Text { color: "white"; elide: Text.ElideRight; text: "Type: " + container.photoType; width: parent.width } - Text { color: "white"; elide: Text.ElideRight; text: "Author: " + container.photoAuthor; width: parent.width } - Text { color: "white"; elide: Text.ElideRight; text: "Published: " + container.photoDate; width: parent.width } - Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "Tags: "; width: parent.width } - Text { color: "white"; elide: Text.ElideRight; text: container.photoTags; width: parent.width } - } - } - - back: Item { - anchors.fill: container - - Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 } - - Common.Progress { - anchors.centerIn: parent; width: 200; height: 22 - progress: bigImage.progress; visible: bigImage.status != Image.Ready - } - - Flickable { - id: flickable; anchors.fill: parent; clip: true - contentWidth: imageContainer.width; contentHeight: imageContainer.height - - function updateMinimumScale() { - if (bigImage.status == Image.Ready && bigImage.width != 0) { - slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height); - if (bigImage.width * slider.value > flickable.width) { - var xoff = (flickable.width/2 + flickable.contentX) * slider.value / prevScale; - flickable.contentX = xoff - flickable.width/2; - } - if (bigImage.height * slider.value > flickable.height) { - var yoff = (flickable.height/2 + flickable.contentY) * slider.value / prevScale; - flickable.contentY = yoff - flickable.height/2; - } - prevScale = slider.value; - } - } - - onWidthChanged: updateMinimumScale() - onHeightChanged: updateMinimumScale() - - Item { - id: imageContainer - width: Math.max(bigImage.width * bigImage.scale, flickable.width); - height: Math.max(bigImage.height * bigImage.scale, flickable.height); - - Image { - id: bigImage; source: container.photoUrl; scale: slider.value - anchors.centerIn: parent; smooth: !flickable.movingVertically - onStatusChanged : { - // Default scale shows the entire image. - if (bigImage.status == Image.Ready && bigImage.width != 0) { - slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height); - prevScale = Math.min(slider.minimum, 1); - slider.value = prevScale; - } - } - } - } - } - - Text { - text: "Image Unavailable" - visible: bigImage.status == Image.Error - anchors.centerIn: parent; color: "white"; font.bold: true - } - - Common.Slider { - id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum } - anchors { - bottom: parent.bottom; bottomMargin: 65 - left: parent.left; leftMargin: 25 - right: parent.right; rightMargin: 25 - } - onValueChanged: { - if (bigImage.width * value > flickable.width) { - var xoff = (flickable.width/2 + flickable.contentX) * value / prevScale; - flickable.contentX = xoff - flickable.width/2; - } - if (bigImage.height * value > flickable.height) { - var yoff = (flickable.height/2 + flickable.contentY) * value / prevScale; - flickable.contentY = yoff - flickable.height/2; - } - prevScale = value; - } - } - } - - states: State { - name: "Back" - PropertyChanges { target: itemRotation; angle: 180 } - PropertyChanges { target: toolBar; button2Visible: false } - PropertyChanges { target: toolBar; button1Label: "Back" } - } - - transitions: Transition { - SequentialAnimation { - PropertyAction { target: bigImage; property: "smooth"; value: false } - NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 500 } - PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically } - } - } -} diff --git a/demos/declarative/flickr/mobile/ListDelegate.qml b/demos/declarative/flickr/mobile/ListDelegate.qml deleted file mode 100644 index 89dfb54..0000000 --- a/demos/declarative/flickr/mobile/ListDelegate.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Component { - Item { - id: wrapper; width: wrapper.ListView.view.width; height: 86 - Item { - id: moveMe - Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 } - Rectangle { - x: 6; y: 4; width: 77; height: 77; color: "white"; smooth: true - - Image { source: imagePath; x: 1; y: 1 } - Image { source: "images/gloss.png" } - } - Column { - x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2 - Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" } - Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" } - Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" } - } - } - } -} diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml deleted file mode 100644 index ec5a5c0..0000000 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: titleBar - property string untaggedString: "Uploads from everyone" - property string taggedString: "Recent uploads tagged " - - BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } - - Item { - id: container - width: (parent.width * 2) - 55 ; height: parent.height - - function accept() { - imageDetails.closed() - titleBar.state = "" - background.state = "" - 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: quitButton.right; right: tagButton.left; leftMargin: 10; rightMargin: 10 - verticalCenter: parent.verticalCenter - } - elide: Text.ElideLeft - text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags) - font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black" - } - - Button { - id: tagButton; x: titleBar.width - 50; width: 45; height: 32; text: "..." - onClicked: if (titleBar.state == "Tags") container.accept(); else titleBar.state = "Tags" - anchors.verticalCenter: parent.verticalCenter - } - - Item { - id: lineEdit - y: 4; height: parent.height - 9 - anchors { left: tagButton.right; leftMargin: 5; right: parent.right; rightMargin: 5 } - - BorderImage { source: "images/lineedit.sci"; anchors.fill: parent } - - TextInput { - id: editor - anchors { - left: parent.left; right: parent.right; leftMargin: 10; rightMargin: 10 - verticalCenter: parent.verticalCenter - } - cursorVisible: true; font.bold: true - color: "#151515"; selectionColor: "Green" - } - - Keys.forwardTo: [ (returnKey), (editor)] - - Item { - id: returnKey - Keys.onReturnPressed: container.accept() - Keys.onEnterPressed: container.accept() - Keys.onEscapePressed: titleBar.state = "" - } - } - } - - states: State { - name: "Tags" - PropertyChanges { target: container; x: -tagButton.x + 5 } - PropertyChanges { target: tagButton; text: "OK" } - PropertyChanges { target: editor; focus: true } - } - - transitions: Transition { - NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } - } -} diff --git a/demos/declarative/flickr/mobile/ToolBar.qml b/demos/declarative/flickr/mobile/ToolBar.qml deleted file mode 100644 index 2412612..0000000 --- a/demos/declarative/flickr/mobile/ToolBar.qml +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: toolbar - - property alias button1Label: button1.text - property alias button2Label: button2.text - property alias button2Visible: button2.visible - - signal button1Clicked - signal button2Clicked - - BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } - - Row { - anchors.right: parent.right; anchors.rightMargin: 5; y: 3; height: 32; spacing: 30 - Button { - id: button1 - width: 140; height: 32 - onClicked: toolbar.button1Clicked() - } - - Button { - id: button2; width: 140; height: 32 - onClicked: toolbar.button2Clicked() - } - } -} diff --git a/demos/declarative/flickr/mobile/images/gloss.png b/demos/declarative/flickr/mobile/images/gloss.png deleted file mode 100644 index 5d370cd93d62ed8c17f43a5d5dc7ed20b4edb5a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1236 zcmV;_1S|WAP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXV} z1RN8~lD~8S00dM?L_t(|+U;D~QX4T4Y^|4I%x&WY2)X$GFUv=G^5Ah$39VMg=va`d zC|s_Uy=qPO^vntr5k28JNc(~Dd+K$Gc~DBB#W4cV?@SptZ+lM}i&GQx%xh!kfrzL@ z07n4B%%VsG*ail9fPugbdiNd?H5ZBF1TYj4iBs382}&wQ#5p&F7|Gfo>XGL|IoG0; z1uP$``hsYsb4?IO?WU#{5*!)YwFid`gn;j)_=(b`K|DnsEHq1Al=0ai^Fno!0I1TD zXlC0`VV|R1%Dh+^C>Dukw$*P~l5(k3MGBpBMdRqutrW_s0#uy?Kf71-G085oJGaoo zl<|!K!#7DyZiqCUb=rnTi_b!b8Qm%w!H}l2En!IPddta1%qyCjC*kj;!SFHHF?3GW zL|b{5>hDw}RZ}xI1#a3q5JTx~mS;*x?^2TuGH7rRus(DiJprT05-z9S#kRxXXkY}@ z&n}Zpjt)twNR()YDS=J1+MF?hs>pD|Su2f%dCvOTWs+&4?v2%voC{6W(y02`q-~C7 zW{#vG-qwowKGUiIvWB!)<}EVMv?@N)vZP8Q$EN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-Ol?bzPe1yE_Wn-16qKwXbQZd~X=oG9`UMY4vl+b0 zEnCN`x?~q=^<8j}D4GBshPtXa^+Ya*&qxsw>eJKYeXeO|nvjp$2uVtm%P$GQ)!16A z-IodyiE^a&f9@ zg^NzDgk`h4nq^mljWq?lp1@rd!^XPn3-G$v@IS#B>(;l1*FD3=7z6=p7QBqiqj*h# z&EKk9S5?Jwoz)G%Hvs=H0AE)=yzUq_#^Q+=c-?wn*BH}0|MpiYT>j7{ndOr+G4IzOEFes*|GuptD@Dn(UGS#&L;j-B|1 zsH2&U*y-tMthY=|O)&E12&puhdPbUwrL2)l&@_WansDUHBbW#pjRtn=iwR<%r@Xbo z>xbXq$gvR+AQ*y%t9FW(r2eak2q6SQ2y>BZ>oaQ{Si`}O4l?}XFokNK^g@Dj-o4ke zx%6ClbA{3AKREpPVMralr3&30T?m4~tjYp3#x%Xv+RLJ=pMU$6*WP`Vw?2HE(vDvG zH&!`)=oDr{dBY=Z1JVB4{)cKwd%}h9#u+~`PH(A~qAgOS0~=d(nRpiqz_Tp7ET(F) ztO{e7&NJ@D=)I{#d25;Rqi31?qW*%Z4h)(!4G(v0E53Nwle=ndLj^P#M$e4Wn3_Q* zQyOG=?^iU63Yz`vea1jnUk`=u9Qi_#^Iu=!_@Se(6#5Gc0r98Q=HtI=(yw9^-MaUwHRW)2O7;H&o=HewTo|>XD7CtH6S$fJB{J3#O{sI^e VqK)QbrHcRn002ovPDHLkV1mrKo*@7L diff --git a/demos/declarative/flickr/mobile/images/lineedit.sci b/demos/declarative/flickr/mobile/images/lineedit.sci deleted file mode 100644 index 054bff7..0000000 --- a/demos/declarative/flickr/mobile/images/lineedit.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 10 -border.top: 10 -border.bottom: 10 -border.right: 10 -source: lineedit.png diff --git a/demos/declarative/flickr/mobile/images/quit.png b/demos/declarative/flickr/mobile/images/quit.png deleted file mode 100644 index 5bda1b6e0d0effbabf53172040f0ed2eea78e34a..0000000000000000000000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obile/images/stripes.png deleted file mode 100644 index 9f36727ea424cd0da94bd5a7cee4082447275eeb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 257 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgga4pBxq@gGdLS%5-~o-U3d5|`(m z-N<{$K*aT;^vADLPxXoJET5>DG2xP-Q1*siVN6aag0$kQzm$|0%E+I; z#Y!4I)=g1)z4*}Q$iB}`v_QR diff --git a/demos/declarative/flickr/mobile/images/titlebar.png b/demos/declarative/flickr/mobile/images/titlebar.png deleted file mode 100644 index 51c90082d052a94af34488ca9a13842122f7d7a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1436 zcmV;N1!MY&P)00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXW1 z0xv7!9LBW(000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000E{NklLiq!w7*fp`1oo9~;MC5Hkm0Ga8f)%S;LHn|^l4>W+QI@MK<0LU%? zTCN^g=1tdNq`Dpph=PESv9&Y_yal)K%ETFKXCtR`vY67D3wB9@+&cbGgIArTN6+wSAX zkGy^RmUr*o{T4#Fkk#tskC!ih`Tfb0Cxj5Vy1F8SK-YDE!#OZB%*L~eNSa)23&d?U zSw1i0>gRr9IT1mtHP62Lmb0@nE-o&3^XAQ;^5Vq{d;a`6A3l8G`uZB@98Hs4A;w4} zZZ8P$T;_Us-Wa3LiY3JoBbsA{322^IDj+WNr!^z_J?9)<*YWV-LmoYP#Ov3u@#p8~ zTwPspd3nidwF01RTNaB2BC@r4CKHDcwm?9#oSA`>USgwAW7e}#gkM0Yvk41^nr1^7 z&N;5HuQ@q6;px+-_|@_O@8ADLBaYYwR2A=iy0?Jz0cyTE=eGiSB!O3eXv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8u2YKVQik-7Z#x$-NEQ+htR;Wx&Yp9`fu<B652VFZWs1RLPz+Io`c{_x1PR z|MypJ{*KUJFE1~D@&5Yy`QyirvDs{LOy>%5{%%hECFmYHFNM)una#u=iB$nYl{xCd z>`+x%o@f%LY03<`ySu}iH*fIv?OUwZ>tEj9e)yIE;PmwL*>=1AaDTV`n{)0{=Nx!) z-Lt<3#d3W%kV<5&zUl_us};i&=sgCA%~?Pyr_&~;w%^s&Ri4EE09*nYhh&1)L;wH) M07*qoM6N<$g3{N*E&u=k diff --git a/demos/declarative/flickr/mobile/images/toolbutton.sci b/demos/declarative/flickr/mobile/images/toolbutton.sci deleted file mode 100644 index 9e4f965..0000000 --- a/demos/declarative/flickr/mobile/images/toolbutton.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 15 -border.top: 4 -border.bottom: 4 -border.right: 15 -source: toolbutton.png diff --git a/src/declarative/scenegraph/util/qsgtexture_p.h b/src/declarative/scenegraph/util/qsgtexture_p.h index 2c142f5..d504732 100644 --- a/src/declarative/scenegraph/util/qsgtexture_p.h +++ b/src/declarative/scenegraph/util/qsgtexture_p.h @@ -89,6 +89,7 @@ public: bool hasMipmaps() const { return m_has_mipmaps; } void setImage(const QImage &image); + const QImage &image() { return m_image; } virtual void bind(); diff --git a/src/imports/particles/modelparticle.cpp b/src/imports/particles/modelparticle.cpp index ab952cb..9d326db 100644 --- a/src/imports/particles/modelparticle.cpp +++ b/src/imports/particles/modelparticle.cpp @@ -180,23 +180,26 @@ void ModelParticle::load(ParticleData* d) } if(m_available.isEmpty() && m_pendingItems.isEmpty()) return; - ModelParticleAttached* mpa = qobject_cast(qmlAttachedPropertiesObject(m_items[pos])); - if(mpa) - qDebug() << (mpa->m_mp = this); - else - qDebug() << "Bugger"; if(m_pendingItems.isEmpty()){ m_items[pos] = m_model->item(m_available.first()); m_idx[pos] = m_available.first(); m_available.pop_front(); + ModelParticleAttached* mpa = qobject_cast(qmlAttachedPropertiesObject(m_items[pos])); + if(mpa){ + mpa->m_mp = this; + mpa->attach(); + } }else{ m_items[pos] = m_pendingItems.front(); m_pendingItems.pop_front(); m_items[pos]->setX(d->curX() - m_items[pos]->width()/2); m_items[pos]->setY(d->curY() - m_items[pos]->height()/2); - if(mpa) - mpa->attach(); m_idx[pos] = -2; + ModelParticleAttached* mpa = qobject_cast(qmlAttachedPropertiesObject(m_items[pos])); + if(mpa){ + mpa->m_mp = this; + mpa->attach(); + } } m_items[pos]->setParentItem(this); m_data[pos] = d; diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro index 6eea892..56474b4 100644 --- a/src/imports/particles/particles.pro +++ b/src/imports/particles/particles.pro @@ -48,7 +48,7 @@ HEADERS += \ deformableparticle.h \ pictureaffector.h -QT += core-private gui-private declarative-private +QT += core-private gui-private declarative-private script-private SOURCES += \ V1/qdeclarativeparticles.cpp \ diff --git a/src/imports/particles/particlesystem.cpp b/src/imports/particles/particlesystem.cpp index 854d512..f89eda4 100644 --- a/src/imports/particles/particlesystem.cpp +++ b/src/imports/particles/particlesystem.cpp @@ -206,6 +206,8 @@ void ParticleSystem::reset() initializeSystem(); foreach(ParticleType* p, m_particles) p->update(); + foreach(ParticleEmitter* e, m_emitters) + e->emitWindow(0);//Start, so that starttime factors appropriately } ParticleData* ParticleSystem::newDatum(int groupId) diff --git a/src/imports/particles/particlesystem.h b/src/imports/particles/particlesystem.h index 896f215..fc5575d 100644 --- a/src/imports/particles/particlesystem.h +++ b/src/imports/particles/particlesystem.h @@ -118,6 +118,11 @@ emit overwriteChanged(arg); } } +void fastForward(int ms) +{ + m_startTime += ms; +} + protected: void componentComplete(); diff --git a/src/imports/particles/pictureaffector.cpp b/src/imports/particles/pictureaffector.cpp index c05a553..d684b3f 100644 --- a/src/imports/particles/pictureaffector.cpp +++ b/src/imports/particles/pictureaffector.cpp @@ -42,11 +42,13 @@ #include "pictureaffector.h" #include "coloredparticle.h" #include +#include +#include QT_BEGIN_NAMESPACE PictureAffector::PictureAffector(QSGItem *parent) : - ParticleAffector(parent) + ParticleAffector(parent), m_pix(0) { m_needsReset = true; } @@ -56,6 +58,27 @@ void PictureAffector::reset(int systemIdx) ParticleAffector::reset(systemIdx); } +void PictureAffector::startLoadImage() +{ + if(m_pix) + m_pix->clear(); + else + m_pix = new QDeclarativePixmap(); + m_pix->load(qmlEngine(this), m_image, QDeclarativePixmap::Cache); + if(m_pix->isReady()) + loadImage(); + else + m_pix->connectFinished(this, SLOT(loadImage())); +} +void PictureAffector::loadImage() +{ + QSGPlainTexture* ptext = qobject_cast(m_pix->texture()); + if(ptext) + m_loadedImage = ptext->image(); + if(m_loadedImage.isNull()) + qWarning() << "PictureAffector could not load picture " << m_image; +} + bool PictureAffector::affectParticle(ParticleData *d, qreal dt) { Q_UNUSED(dt); @@ -74,7 +97,7 @@ bool PictureAffector::affectParticle(ParticleData *d, qreal dt) QPoint pos = QPoint(d->curX() - m_offset.x(), d->curY() - m_offset.y()); if(!QRect(0,0,width(),height()).contains(pos)){ //XXX: Just a debugging helper, as I don't think it can get here. - qWarning() << "An unexpected situation has occurred. But don't worry, everything will be fine."; + qWarning() << "PictureAffector gives up."; return false; } Color4ub c; diff --git a/src/imports/particles/pictureaffector.h b/src/imports/particles/pictureaffector.h index ca7d13f..4e0141d 100644 --- a/src/imports/particles/pictureaffector.h +++ b/src/imports/particles/pictureaffector.h @@ -50,12 +50,12 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QDeclarativePixmap; class PictureAffector : public ParticleAffector { Q_OBJECT //Usually want to use "particles" to target just colored stuff, and save performance //Use onceOff (inherited) to determine if this is an emitter modification or a more constant enforcer - //TODO: Onceoff isn't actually working right now... Q_PROPERTY(QUrl image READ image WRITE setImage NOTIFY imageChanged) //TODO: Bool smooth, where it interpolates public: @@ -78,15 +78,17 @@ public slots: { if (m_image != arg) { m_image = arg; - m_loadedImage = QImage(m_image.toLocalFile()); - if(m_loadedImage.isNull()) - qWarning() << "PictureAffector could not load picture " << m_image.toLocalFile(); + startLoadImage(); emit imageChanged(arg); } } +private slots: + void loadImage(); private: + void startLoadImage(); QUrl m_image; + QDeclarativePixmap* m_pix; QImage m_loadedImage; }; -- 1.7.2.5