summaryrefslogtreecommitdiffstats
path: root/demos/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-05-07 22:59:30 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-05-07 22:59:30 (GMT)
commit61b333d7ca037f7b54fa32b150652b49bc6766fd (patch)
tree98f968cd22083f7969a05bc64da5c8bdd9d7c174 /demos/declarative
parent7bddc405426ba4581dff7adcdc70240bf0daa048 (diff)
parent495150413916a9a41cdffc5879f36a6e16e7866c (diff)
downloadQt-61b333d7ca037f7b54fa32b150652b49bc6766fd.zip
Qt-61b333d7ca037f7b54fa32b150652b49bc6766fd.tar.gz
Qt-61b333d7ca037f7b54fa32b150652b49bc6766fd.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'demos/declarative')
-rw-r--r--demos/declarative/contacts/Contact.qml5
-rw-r--r--demos/declarative/contacts/ContactField.qml2
-rw-r--r--demos/declarative/contacts/contacts.qml21
-rw-r--r--demos/declarative/flickr/flickr2.qml46
4 files changed, 46 insertions, 28 deletions
diff --git a/demos/declarative/contacts/Contact.qml b/demos/declarative/contacts/Contact.qml
index 342c356..7297fa6 100644
--- a/demos/declarative/contacts/Contact.qml
+++ b/demos/declarative/contacts/Contact.qml
@@ -52,6 +52,11 @@ Item {
}
]
+ function refresh() {
+ labelField.value = label;
+ emailField.value = email;
+ phoneField.value = phone;
+ }
function update() {
updateContactQuery.exec();
}
diff --git a/demos/declarative/contacts/ContactField.qml b/demos/declarative/contacts/ContactField.qml
index 3ce2c1a..cb319ae 100644
--- a/demos/declarative/contacts/ContactField.qml
+++ b/demos/declarative/contacts/ContactField.qml
@@ -5,7 +5,7 @@ Item {
property var label: "Name"
property var icon: "pics/phone.png"
property var value: ""
- onValueChanged: { fieldText.text=field.value }
+ onValueChanged: { fieldText.text = contactField.value }
RemoveButton {
id: removeButton
anchors.right: parent.right
diff --git a/demos/declarative/contacts/contacts.qml b/demos/declarative/contacts/contacts.qml
index ce5a2b5..4582bd1 100644
--- a/demos/declarative/contacts/contacts.qml
+++ b/demos/declarative/contacts/contacts.qml
@@ -39,9 +39,11 @@ Rect {
children: [
MouseRegion {
anchors.fill: parent
- onClicked: { Details.qml = 'Contact.qml';
+ onClicked: {
+ Details.qml = 'Contact.qml';
wrapper.state='opened';
- contacts.mode = 'edit'; }
+ contacts.mode = 'edit';
+ }
}
]
}
@@ -142,7 +144,7 @@ Rect {
anchors.right: parent.right
anchors.rightMargin: 5
icon: "pics/new.png"
- onClicked: { print("open new contact edit"); newContactItem.label = ''; newContactItem.phone = ''; newContactItem.email = ''; contacts.mode = 'new' }
+ onClicked: { newContactItem.refresh(); contacts.mode = 'new' }
opacity: contacts.mode == 'list' ? 1 : 0
}
Button {
@@ -174,10 +176,15 @@ Rect {
delegate: contactDelegate
focus: false
}
- Contact {
- id: newContactItem
+ FocusRealm {
+ id: newContactWrapper
anchors.fill: contactListView
opacity: 0
+ focus: contacts.mode == 'new'
+ Contact {
+ id: newContactItem
+ anchors.fill: parent
+ }
}
Connection {
sender: confirmEditButton
@@ -234,7 +241,7 @@ Rect {
]
}
KeyProxy {
- focus: true
+ focus: contacts.mode != 'new'
targets: { contacts.mode == "list" ? [searchBarWrapper, contactListView] : [contactListView]}
}
states: [
@@ -247,7 +254,7 @@ Rect {
value: 0
}
SetProperty {
- target: newContactItem
+ target: newContactWrapper
property: "opacity"
value: 1
}
diff --git a/demos/declarative/flickr/flickr2.qml b/demos/declarative/flickr/flickr2.qml
index 4875fa4..3b1208c 100644
--- a/demos/declarative/flickr/flickr2.qml
+++ b/demos/declarative/flickr/flickr2.qml
@@ -143,29 +143,31 @@ Item {
]
transitions: [
Transition {
- fromState: "*"
- toState: "*"
+ fromState: "left"
+ toState: "right"
SequentialAnimation {
SetPropertyAction {
target: Wrapper
property: "moveToParent"
- value: Bounce
}
ParallelAnimation {
NumericAnimation {
target: Wrapper
- properties: "x"
+ properties: "x,y"
to: 0
- duration: 250
- }
- NumericAnimation {
- target: Wrapper
- properties: "y"
- to: 0
- easing: "easeInQuad"
- duration: 250
+ easing: "easeOutQuad"
+ duration: 350
}
}
+ }
+ },
+ Transition {
+ fromState: "right"
+ toState: "left"
+ SequentialAnimation {
+ PauseAnimation {
+ duration: Math.floor(index/7)*100
+ }
SetPropertyAction {
target: Wrapper
property: "moveToParent"
@@ -173,13 +175,7 @@ Item {
ParallelAnimation {
NumericAnimation {
target: Wrapper
- properties: "x"
- to: 0
- duration: 250
- }
- NumericAnimation {
- target: Wrapper
- properties: "y"
+ properties: "x,y"
to: 0
easing: "easeOutQuad"
duration: 250
@@ -203,14 +199,20 @@ Item {
GridView {
id: PhotoGridView; model: MyVisualModel.parts.leftBox
cellWidth: 105; cellHeight: 105; x:32; y: 80; width: 800; height: 330; z: 1
+ cacheBuffer: 100
}
PathView {
id: PhotoPathView; model: MyVisualModel.parts.rightBox
y: 80; width: 800; height: 330; z: 1
+ pathItemCount: 10; snapPosition: 0.001
path: Path {
- startX: -50; startY: 40;
+ startX: -150; startY: 40;
+ PathPercent { value: 0 }
+ PathLine { x: -50; y: 40 }
+
+ PathPercent { value: 0.001 }
PathAttribute { name: "scale"; value: 1 }
PathAttribute { name: "angle"; value: -45 }
@@ -232,6 +234,10 @@ Item {
PathAttribute { name: "scale"; value: 1 }
PathAttribute { name: "angle"; value: -45 }
+
+ PathPercent { value: 0.999 }
+ PathLine { x: 950; y: 40 }
+ PathPercent { value: 1.0 }
}
}