diff options
author | Charles Yin <charles.yin@nokia.com> | 2010-12-01 13:21:44 +1000 |
---|---|---|
committer | Charles Yin <charles.yin@nokia.com> | 2010-12-01 13:21:44 +1000 |
commit | db439df1893d5fdea35db263235b7d3387053b91 (patch) | |
tree | 922213e4da735d36e57a9b1e43a44a9db084e130 | |
parent | 58e26dc1325f093ef42410f840fe856468b45487 (diff) |
add agenderview, dayview, weekview templates
Change-Id: I3af4f2996d89b77f7d4f4d1c054e376a16a89991
-rw-r--r-- | examples/qmlorganizer/contents/MenuBar.qml (renamed from examples/qmlorganizer/contents/TitleBar.qml) | 45 | ||||
-rw-r--r-- | examples/qmlorganizer/contents/agenderview.qml (renamed from examples/qmlorganizer/contents/settingsview.qml) | 2 | ||||
-rw-r--r-- | examples/qmlorganizer/contents/dayview.qml | 43 | ||||
-rw-r--r-- | examples/qmlorganizer/contents/monthview.qml (renamed from examples/qmlorganizer/contents/MonthView.qml) | 0 | ||||
-rw-r--r-- | examples/qmlorganizer/contents/weekview.qml | 43 | ||||
-rw-r--r-- | examples/qmlorganizer/organizer.qml | 200 | ||||
-rw-r--r-- | examples/qmlorganizer/qmlorganizer.pro | 10 | ||||
-rw-r--r-- | examples/qmlorganizer/qmlorganizer.qrc | 8 |
8 files changed, 223 insertions, 128 deletions
diff --git a/examples/qmlorganizer/contents/TitleBar.qml b/examples/qmlorganizer/contents/MenuBar.qml index 2d7100585c..c064d7df97 100644 --- a/examples/qmlorganizer/contents/TitleBar.qml +++ b/examples/qmlorganizer/contents/MenuBar.qml @@ -40,41 +40,36 @@ import Qt 4.7 -Item { - id: titleBar - property string managerName: "" - property int contactsCount: 0 - property string statusString: "" - - +Rectangle { + id: menuBar; + y:0; + height:childrenRect.height; + width: parent.width; 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 - + gradient: Gradient { + GradientStop { position: 0.0; color: activePalette.dark } + GradientStop { position: 1.0; color: Qt.darker(activePalette.dark); } + } + Row { + spacing: 2 + //anchors.horizontalCenter: parent.horizontalCenter; Image { id: quitButton anchors.left: parent.left//; anchors.leftMargin: 0 anchors.verticalCenter: parent.verticalCenter + height: monthButton.height + width:height source: "images/quit.png" MouseArea { anchors.fill: parent onClicked: Qt.quit() } } - - Text { - id: categoryText - anchors { - left: quitButton.right; right: parent.right; //leftMargin: 10; rightMargin: 10 - verticalCenter: parent.verticalCenter - } - elide: Text.ElideLeft - text: "[" + managerName + "] Total:" + contactsCount + " " + statusString - font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black" - } - + Button { id: monthButton; text: "Month"; onClicked: topItem.state="MonthView";} + Button { id: weekButton; text: "Week";onClicked: topItem.state="WeekView";} + Button { id: dayButton; text: "Day";onClicked: topItem.state="DayView";} + Button { id: agenderButton; text: "Agender";onClicked: topItem.state="AgenderView";} + Button { id: timelineButton; text: "Timeline";onClicked: topItem.state="TimelineView";} } - } + diff --git a/examples/qmlorganizer/contents/settingsview.qml b/examples/qmlorganizer/contents/agenderview.qml index 326bb8664e..97ab780103 100644 --- a/examples/qmlorganizer/contents/settingsview.qml +++ b/examples/qmlorganizer/contents/agenderview.qml @@ -40,4 +40,4 @@ import Qt 4.7 -Text {text: "Settings View"; anchors.centerIn: parent} +Text {text: "Agender View"; anchors.centerIn: parent} diff --git a/examples/qmlorganizer/contents/dayview.qml b/examples/qmlorganizer/contents/dayview.qml new file mode 100644 index 0000000000..e88a5b5499 --- /dev/null +++ b/examples/qmlorganizer/contents/dayview.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt 4.7 + +Text {text: "Day View"; anchors.centerIn: parent} diff --git a/examples/qmlorganizer/contents/MonthView.qml b/examples/qmlorganizer/contents/monthview.qml index 7703c7a72b..7703c7a72b 100644 --- a/examples/qmlorganizer/contents/MonthView.qml +++ b/examples/qmlorganizer/contents/monthview.qml diff --git a/examples/qmlorganizer/contents/weekview.qml b/examples/qmlorganizer/contents/weekview.qml new file mode 100644 index 0000000000..04b5f11b9d --- /dev/null +++ b/examples/qmlorganizer/contents/weekview.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt 4.7 + +Text {text: "Week View"; anchors.centerIn: parent} diff --git a/examples/qmlorganizer/organizer.qml b/examples/qmlorganizer/organizer.qml index c4363e74ba..88c2a22a6f 100644 --- a/examples/qmlorganizer/organizer.qml +++ b/examples/qmlorganizer/organizer.qml @@ -41,102 +41,112 @@ import Qt 4.7 import QtMobility.organizer 1.1 import "contents" as TimeScape +Item { + id: screen; width: 380; height: 640 + property string viewType : "contactListView" -Rectangle { - id: topItem - width: 360 - height: 640 - x: 0 - y: 0 - - color: "#080808"; - state: "MonthView"; - - SystemPalette { id: activePalette } - - // OrganizerModel {id: organizerModelId; manager:'memory'; startPeriod:'2010-08-12T13:22:01'; endPeriod:'2010-09-12T13:22:01'} - //OrganizerItem {id:organizerItem; guid:'1112232133'} - // Quick hack top menu bar to change views - states: [ - State {name: "MonthView"; PropertyChanges { target: monthView; opacity: 1; }}, - State {name: "TimelineView"; PropertyChanges { target: timelineView; opacity: 1; }}, - State {name: "DetailsView"; PropertyChanges { target: detailsView; opacity: 1; }}, - State {name: "SettingsView"; PropertyChanges { target: settingsView; opacity: 1; }} - ] - transitions: [ - Transition { - NumberAnimation { - properties: "opacity" - easing.type: "OutBounce" - duration: 100 - } - } - ] Rectangle { - id: menuBar; - y:0; - height:childrenRect.height; - width: parent.width; - gradient: Gradient { - GradientStop { position: 0.0; color: activePalette.dark } - GradientStop { position: 1.0; color: Qt.darker(activePalette.dark); } - } - Row { - spacing: 2 - anchors.horizontalCenter: parent.horizontalCenter; - TimeScape.Button {text: "Month"; onClicked: topItem.state="MonthView";} - TimeScape.Button {text: "Timeline";onClicked: topItem.state="TimelineView";} - TimeScape.Button {text: "Settings";onClicked: topItem.state="SettingsView";} - TimeScape.Button {text: "Details";onClicked: topItem.state="DetailsView";} - } - } - - Item { - id: contentArea; - anchors.top: menuBar.bottom; - anchors.left: topItem.left; - anchors.right: topItem.right; - anchors.bottom: topItem.bottom; - - // TODO these should be components too - Rectangle { - id: monthView; - color: "#808000"; - width: 360; - height: 600; - opacity: 0; - anchors.fill: contentArea; - Loader {id: monthLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/MonthView.qml";} - } - Rectangle { - id: timelineView; - color: "#008080"; - width: 360; - height: 600; - opacity: 0; - anchors.fill: contentArea; - - Loader {id: timelineLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/timelineview.qml";} - } - Rectangle { - id: detailsView; - color: "#008000"; - width: 360; - height: 600; - opacity: 0; - anchors.fill: contentArea; - - Loader {id: detailLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/detailsview.qml";} - } - Rectangle { - id: settingsView; - color: "#F08000"; - width: 360; - height: 600; - opacity: 0; - anchors.fill: contentArea; - - Loader {id: settingsLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/settingsview.qml";} + id: topItem + anchors.fill: parent; + + color: "#343434"; + Image { source: "contents/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 1 } + + state: "MonthView"; + + SystemPalette { id: activePalette } + + // OrganizerModel {id: organizerModelId; manager:'memory'; startPeriod:'2010-08-12T13:22:01'; endPeriod:'2010-09-12T13:22:01'} + //OrganizerItem {id:organizerItem; guid:'1112232133'} + // Quick hack top menu bar to change views + TimeScape.MenuBar { id: menuBar; width: parent.width; height: 40; opacity: 0.9 } + + states: [ + State {name: "MonthView"; PropertyChanges { target: monthView; opacity: 1; }}, + State {name: "TimelineView"; PropertyChanges { target: timelineView; opacity: 1; }}, + State {name: "WeekView"; PropertyChanges { target: weekView; opacity: 1; }}, + State {name: "DayView"; PropertyChanges { target: dayView; opacity: 1; }}, + State {name: "AgenderView"; PropertyChanges { target: agenderView; opacity: 1; }} + ] + transitions: [ + Transition { + NumberAnimation { + properties: "opacity" + easing.type: "OutBounce" + duration: 100 + } + } + ] + + + Item { + id: contentArea; + anchors.top: menuBar.bottom; + anchors.left: topItem.left; + anchors.right: topItem.right; + anchors.bottom: topItem.bottom; + + // TODO these should be components too + Rectangle { + id: monthView; + color: "#808000"; + width: 360; + height: 600; + opacity: 0; + anchors.fill: contentArea; + Loader {id: monthLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/monthview.qml";} + } + Rectangle { + id: timelineView; + color: "#008080"; + width: 360; + height: 600; + opacity: 0; + anchors.fill: contentArea; + + Loader {id: timelineLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/timelineview.qml";} + } + Rectangle { + id: weekView; + color: "#008000"; + width: 360; + height: 600; + opacity: 0; + anchors.fill: contentArea; + + Loader {id: weekLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/weekview.qml";} + } + Rectangle { + id: dayView; + color: "#F08000"; + width: 360; + height: 600; + opacity: 0; + anchors.fill: contentArea; + + Loader {id: dayLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/dayview.qml";} + } + Rectangle { + id: agenderView; + color: "#F08000"; + width: 360; + height: 600; + opacity: 0; + anchors.fill: contentArea; + + Loader {id: agenderLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/agenderview.qml";} + } + Rectangle { + id: detailsView; + color: "#F08000"; + width: 360; + height: 600; + opacity: 0; + anchors.fill: contentArea; + + Loader {id: detailsLoader; opacity:parent.opacity; anchors.fill: parent; source: "contents/detailsview.qml";} + } + } - } +} } diff --git a/examples/qmlorganizer/qmlorganizer.pro b/examples/qmlorganizer/qmlorganizer.pro index c7bdf0892b..c458027c43 100644 --- a/examples/qmlorganizer/qmlorganizer.pro +++ b/examples/qmlorganizer/qmlorganizer.pro @@ -13,10 +13,12 @@ SOURCES = \ OTHER_FILES += \ organizer.qml \ contents/ToolBar.qml \ - contents/TitleBar.qml \ + contents/MenuBar.qml \ contents/timelineview.qml \ contents/timeline.js \ - contents/settingsview.qml \ + contents/weekview.qml \ + contents/dayview.qml \ + contents/agenderview.qml \ contents/ScrollBar.qml \ contents/MediaButton.qml \ contents/detailsview.qml \ @@ -34,11 +36,11 @@ OTHER_FILES += \ contents/images/button-pressed.png \ contents/images/button.png \ contents/month.js \ - contents/MonthView.qml + contents/monthview.qml symbian: { load(data_caging_paths) - TARGET.CAPABILITY = ReadDeviceData WriteDeviceData + TARGET.CAPABILITY = ReadDeviceData WriteDeviceData ReadUserData WriteUserData TARGET.UID3 = 0xE1407FC3 TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone diff --git a/examples/qmlorganizer/qmlorganizer.qrc b/examples/qmlorganizer/qmlorganizer.qrc index d9eae8288a..c790f50be7 100644 --- a/examples/qmlorganizer/qmlorganizer.qrc +++ b/examples/qmlorganizer/qmlorganizer.qrc @@ -4,12 +4,14 @@ <file>contents/Button.qml</file> <file>contents/detailsview.qml</file> <file>contents/MediaButton.qml</file> - <file>contents/MonthView.qml</file> + <file>contents/monthview.qml</file> <file>contents/ScrollBar.qml</file> - <file>contents/settingsview.qml</file> + <file>contents/weekview.qml</file> + <file>contents/dayview.qml</file> + <file>contents/agenderview.qml</file> <file>contents/timeline.js</file> <file>contents/timelineview.qml</file> - <file>contents/TitleBar.qml</file> + <file>contents/MenuBar.qml</file> <file>contents/ToolBar.qml</file> <file>contents/images/button.png</file> <file>contents/images/button-pressed.png</file> |