summaryrefslogtreecommitdiffstats
path: root/demos/declarative/flickr/mobile/TitleBar.qml
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-08-25 01:20:08 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-08-25 01:20:08 (GMT)
commit7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0 (patch)
tree01569d474f4eee0a097fdb4a5be8b39a09399f52 /demos/declarative/flickr/mobile/TitleBar.qml
parente1081c88616fea20fed343e258c98da2a669d9f1 (diff)
downloadQt-7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0.zip
Qt-7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0.tar.gz
Qt-7f41d39c293e1bd013acc0e79af2aa66e1f9e4d0.tar.bz2
Mobile version of Flickr demo in flickr-mobile.qml.
Diffstat (limited to 'demos/declarative/flickr/mobile/TitleBar.qml')
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml74
1 files changed, 74 insertions, 0 deletions
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
new file mode 100644
index 0000000..59b8365
--- /dev/null
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -0,0 +1,74 @@
+import Qt 4.6
+
+Item {
+ id: TitleBar
+
+ BorderImage { source: "images/titlebar2.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+
+ Item {
+ id: Container
+ width: (parent.width * 2) - 55 ; height: parent.height
+
+ Script {
+ function accept() {
+ RssModel.tags = Editor.text
+ TitleBar.state = ""
+ }
+ }
+
+ Text {
+ id: CategoryText
+ anchors.left: parent.left; anchors.right: TagButton.left
+ anchors.leftMargin: 10; anchors.rightMargin: 10
+ anchors.verticalCenter: parent.verticalCenter
+ elide: "ElideLeft"
+ text: (RssModel.tags=="" ? "Uploads from everyone" : "Recent Uploads tagged " + RssModel.tags)
+ font.pointSize: 10; font.bold: true; color: "white"; style: "Raised"; styleColor: "black"
+ }
+
+ Button {
+ id: TagButton; x: TitleBar.width - 50; y: 3; width: 45; height: 32; text: "..."
+ onClicked: if (TitleBar.state == "Tags") accept(); else TitleBar.state = "Tags"
+ }
+
+ Item {
+ id: LineEdit
+ anchors.left: TagButton.right; anchors.leftMargin: 5; y: 4
+ anchors.right: parent.right; anchors.rightMargin: 5; height: parent.height - 9
+ BorderImage { source: "images/lineedit.sci"; anchors.fill: parent }
+
+ TextInput {
+ id: Editor
+ anchors.left: parent.left; anchors.right: parent.right
+ anchors.leftMargin: 10; anchors.rightMargin: 10
+ anchors.verticalCenter: parent.verticalCenter
+ cursorVisible: true; font.bold: true
+ color: "#151515"; highlightColor: "green"
+ }
+ KeyProxy {
+ id: Proxy
+ anchors.fill: parent
+ targets: [(ReturnKey), (Editor)]
+ }
+ Item {
+ id: ReturnKey
+ Keys.onReturnPressed: accept()
+ Keys.onEscapePressed: TitleBar.state = ""
+ }
+ }
+ }
+ states: [
+ State {
+ name: "Tags"
+ PropertyChanges { target: Container; x: -TagButton.x + 5 }
+ PropertyChanges { target: TagButton; text: "OK" }
+ PropertyChanges { target: Proxy; focus: true }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "*"; to: "*"
+ NumberAnimation { properties: "x"; easing: "easeInOutQuad" }
+ }
+ ]
+}