diff options
author | Charles Yin <charles.yin@nokia.com> | 2010-12-02 13:51:51 +1000 |
---|---|---|
committer | Charles Yin <charles.yin@nokia.com> | 2010-12-02 14:04:35 +1000 |
commit | 163f87e8b826566cc438e3fc1e0f4b9e7ef66dcd (patch) | |
tree | 0b82392fa9ee87308f65034fb122668dfccfe7b5 | |
parent | 51a46cf204fac2fc650796882344b2e6ef1be18b (diff) |
qmlorganizer:add today button
Change-Id: Ibac0ff01b63951ad1e3d1063f8f449a3eef15d55
-rw-r--r-- | examples/qmlorganizer/contents/MenuBar.qml | 6 | ||||
-rw-r--r-- | examples/qmlorganizer/contents/MonthView.qml | 11 | ||||
-rw-r--r-- | examples/qmlorganizer/organizer.qml | 14 |
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: { |