1
by Michael Hall
Initial code template |
1 |
import QtQuick 2.0 |
2 |
import Ubuntu.Components 0.1 |
|
3 |
||
4 |
MainView { |
|
3
by Frank Mertens
Initial code for the month view. Also bootstrapped a small extension library for JS::Date. |
5 |
id: mainView
|
6 |
width: units.gu(45) |
|
7 |
height: units.gu(80) |
|
4.2.8
by Frank Mertens
Allow to select the current month with the tab bar. |
8 |
// FIXME: 80/45 = aspect ration of Galaxy Nexus
|
9 |
||
10 |
Tabs { // preliminary HACK, needs rewrite when NewTabBar is finalized! |
|
11 |
id: tabs
|
|
12 |
anchors.fill: parent |
|
13 |
||
14 |
Tab { id: pageArea; title: i18n.tr("January"); page: Item { anchors.fill: parent } } |
|
15 |
Tab { title: i18n.tr("February") } |
|
16 |
Tab { title: i18n.tr("March") } |
|
17 |
Tab { title: i18n.tr("April") } |
|
18 |
Tab { title: i18n.tr("May") } |
|
19 |
Tab { title: i18n.tr("June") } |
|
20 |
Tab { title: i18n.tr("July") } |
|
21 |
Tab { title: i18n.tr("August") } |
|
22 |
Tab { title: i18n.tr("September") } |
|
23 |
Tab { title: i18n.tr("October") } |
|
24 |
Tab { title: i18n.tr("November") } |
|
25 |
Tab { title: i18n.tr("December") } |
|
26 |
||
4.2.17
by Frank Mertens
Allow pulling the events view upwards. |
27 |
onSelectedTabIndexChanged: monthView.gotoNextMonth(selectedTabIndex) |
4.2.8
by Frank Mertens
Allow to select the current month with the tab bar. |
28 |
}
|
3
by Frank Mertens
Initial code for the month view. Also bootstrapped a small extension library for JS::Date. |
29 |
|
4.2.17
by Frank Mertens
Allow pulling the events view upwards. |
30 |
MonthView { |
31 |
id: monthView
|
|
4.2.8
by Frank Mertens
Allow to select the current month with the tab bar. |
32 |
onMonthStartChanged: tabs.selectedTabIndex = monthStart.getMonth() |
33 |
y: pageArea.y |
|
1
by Michael Hall
Initial code template |
34 |
}
|
4.2.14
by Frank Mertens
Allow day to day stepping using a dummy event view. |
35 |
|
36 |
EventView { |
|
37 |
id: eventView
|
|
4.2.19
by Frank Mertens
Allow the MonthView to be compressed to the current week. |
38 |
property real minY: pageArea.y + monthView.compressedHeight |
39 |
property real maxY: pageArea.y + monthView.height |
|
40 |
y: maxY |
|
4.2.14
by Frank Mertens
Allow day to day stepping using a dummy event view. |
41 |
width: mainView.width |
4.2.19
by Frank Mertens
Allow the MonthView to be compressed to the current week. |
42 |
height: parent.height - monthView.compressedHeight |
4.2.17
by Frank Mertens
Allow pulling the events view upwards. |
43 |
currentDayStart: monthView.currentDayStart |
4.2.14
by Frank Mertens
Allow day to day stepping using a dummy event view. |
44 |
Component.onCompleted: { |
4.2.17
by Frank Mertens
Allow pulling the events view upwards. |
45 |
incrementCurrentDay.connect(monthView.incrementCurrentDay) |
46 |
decrementCurrentDay.connect(monthView.decrementCurrentDay) |
|
47 |
}
|
|
48 |
MouseArea { |
|
4.2.19
by Frank Mertens
Allow the MonthView to be compressed to the current week. |
49 |
id: drawer
|
50 |
property bool compression: true |
|
4.2.17
by Frank Mertens
Allow pulling the events view upwards. |
51 |
anchors.fill: parent |
52 |
drag { |
|
53 |
axis: Drag.YAxis |
|
54 |
target: eventView |
|
4.2.19
by Frank Mertens
Allow the MonthView to be compressed to the current week. |
55 |
minimumY: monthView.y + monthView.compressedHeight |
56 |
maximumY: monthView.y + monthView.height |
|
4.2.17
by Frank Mertens
Allow pulling the events view upwards. |
57 |
onActiveChanged: { |
4.2.19
by Frank Mertens
Allow the MonthView to be compressed to the current week. |
58 |
if (compression) { |
59 |
if (drag.active) { |
|
60 |
monthView.compressed = true |
|
61 |
}
|
|
62 |
else { |
|
63 |
yBehavior.enabled = true |
|
64 |
eventView.y = Qt.binding(function() { return eventView.minY }) |
|
65 |
compression = false |
|
66 |
}
|
|
67 |
}
|
|
68 |
else { |
|
69 |
if (drag.active) {} |
|
70 |
else{ |
|
71 |
eventView.y = Qt.binding(function() { return eventView.maxY }) |
|
72 |
monthView.compressed = false |
|
73 |
compression = true |
|
74 |
}
|
|
4.2.17
by Frank Mertens
Allow pulling the events view upwards. |
75 |
}
|
76 |
}
|
|
77 |
}
|
|
4.2.14
by Frank Mertens
Allow day to day stepping using a dummy event view. |
78 |
}
|
4.2.19
by Frank Mertens
Allow the MonthView to be compressed to the current week. |
79 |
Behavior on y { |
80 |
id: yBehavior
|
|
81 |
enabled: false |
|
82 |
NumberAnimation { duration: 100 } |
|
83 |
}
|
|
4.2.18
by Frank Mertens
Added a dummy toolbar. |
84 |
}
|
85 |
||
86 |
tools: ToolbarActions { |
|
87 |
Action { |
|
88 |
iconSource: Qt.resolvedUrl("avatar.png") |
|
89 |
text: i18n.tr("To-do") |
|
90 |
onTriggered:; // FIXME |
|
91 |
}
|
|
92 |
Action { |
|
93 |
iconSource: Qt.resolvedUrl("avatar.png") |
|
94 |
text: i18n.tr("New Event") |
|
95 |
onTriggered:; // FIXME |
|
96 |
}
|
|
97 |
Action { |
|
98 |
iconSource: Qt.resolvedUrl("avatar.png") |
|
99 |
text: i18n.tr("Timeline") |
|
100 |
onTriggered:; // FIXME |
|
101 |
}
|
|
102 |
}
|
|
1
by Michael Hall
Initial code template |
103 |
}
|