summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2010-12-02 13:51:51 +1000
committerCharles Yin <charles.yin@nokia.com>2010-12-02 14:04:35 +1000
commit163f87e8b826566cc438e3fc1e0f4b9e7ef66dcd (patch)
tree0b82392fa9ee87308f65034fb122668dfccfe7b5
parent51a46cf204fac2fc650796882344b2e6ef1be18b (diff)
qmlorganizer:add today button
-rw-r--r--examples/qmlorganizer/contents/MenuBar.qml6
-rw-r--r--examples/qmlorganizer/contents/MonthView.qml11
-rw-r--r--examples/qmlorganizer/organizer.qml14
3 files changed, 16 insertions, 15 deletions
diff --git a/examples/qmlorganizer/contents/MenuBar.qml b/examples/qmlorganizer/contents/MenuBar.qml
index d7d315978d..49b0140d7c 100644
--- a/examples/qmlorganizer/contents/MenuBar.qml
+++ b/examples/qmlorganizer/contents/MenuBar.qml
@@ -45,13 +45,14 @@ Rectangle {
y:0;
height:childrenRect.height;
width: parent.width;
+ property string info;
BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
gradient: Gradient {
GradientStop { position: 0.0; color: activePalette.dark }
GradientStop { position: 1.0; color: Qt.darker(activePalette.dark); }
}
Row {
- spacing: 2
+ spacing: 0
Image {
id: quitButton
height: monthButton.height
@@ -62,11 +63,12 @@ Rectangle {
onClicked: Qt.quit()
}
}
+ Button {id: todayButton; text: "Today";onClicked:topItem.day = new Date();}
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";}
+ Text { color: "#f5f210";text:info ; font.bold: true; verticalAlignment: Text.AlignVCenter; style: Text.Sunken;font.pointSize: 10}
}
}
diff --git a/examples/qmlorganizer/contents/MonthView.qml b/examples/qmlorganizer/contents/MonthView.qml
index eca84661f3..16153dcd77 100644
--- a/examples/qmlorganizer/contents/MonthView.qml
+++ b/examples/qmlorganizer/contents/MonthView.qml
@@ -49,17 +49,6 @@ Rectangle {
property date startDay:new Date(year, month, 1)
property int startWeekday:startDay.getDay()
-
- OrganizerModel {
- id: organizer;
- startPeriod:startDay;
- endPeriod:new Date(year, month+1, 1);
- Component.onCompleted : {
- if (manager == "memory")
- organizer.importItems(Qt.resolvedUrl("2010-FIFA-WorldCup.ics"));
- }
- }
-
anchors.fill: parent
// GridView {
// id:container
diff --git a/examples/qmlorganizer/organizer.qml b/examples/qmlorganizer/organizer.qml
index da5fa438b3..802678af22 100644
--- a/examples/qmlorganizer/organizer.qml
+++ b/examples/qmlorganizer/organizer.qml
@@ -44,7 +44,7 @@ import "contents"
Rectangle {
id: topItem
- width: 380
+ width: 400
height: 640
property date day: new Date()
property string status:day.toDateString()
@@ -59,8 +59,18 @@ Rectangle {
SystemPalette { id: activePalette }
+ OrganizerModel {
+ id: organizer
+ startPeriod:new Date(topItem.day.getFullYear(), 1, 1)
+ endPeriod:new Date(topItem.day.getFullYear(), 12, 31)
+ autoUpdate:false
+ Component.onCompleted : {
+ if (manager == "memory")
+ organizer.importItems(Qt.resolvedUrl("2010-FIFA-WorldCup.ics"));
+ }
+ }
- MenuBar { id: menuBar; width: parent.width; height: 35; opacity: 0.9 }
+ MenuBar { id: menuBar; width: parent.width; height: 35; opacity: 0.9; info: organizer.error + "\nTotal:" + organizer.itemCount }
StatusBar {
id: statusBar; status:topItem.status; width: parent.width; height: 35; opacity: 0.9; anchors.bottom: topItem.bottom
onLeftClicked: {