diff options
Diffstat (limited to 'prototype_2016/third_party/qml-material/src')
104 files changed, 0 insertions, 10930 deletions
diff --git a/prototype_2016/third_party/qml-material/src/components/ActionButton.qml b/prototype_2016/third_party/qml-material/src/components/ActionButton.qml deleted file mode 100644 index c286663..0000000 --- a/prototype_2016/third_party/qml-material/src/components/ActionButton.qml +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import QtQuick.Controls.Styles 1.3 as ControlStyles | ||
14 | import Material 0.3 | ||
15 | import QtGraphicalEffects 1.0 | ||
16 | |||
17 | /*! | ||
18 | \qmltype ActionButton | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief A floating action button. | ||
22 | |||
23 | An ActionButton is a floating action button that provides a primary action | ||
24 | on the current page. | ||
25 | */ | ||
26 | Controls.Button { | ||
27 | id: button | ||
28 | |||
29 | visible: action ? action.visible : true | ||
30 | |||
31 | /*! | ||
32 | The color of the action button. By default, this is the accent color of your | ||
33 | app as defined by \l Theme::accentColor. | ||
34 | */ | ||
35 | property color backgroundColor: Theme.accentColor | ||
36 | |||
37 | /*! | ||
38 | \internal | ||
39 | The elevation of the icon. This will be higher for a white background color. | ||
40 | */ | ||
41 | property int elevation: backgroundColor == "white" ? 0 : 1 | ||
42 | |||
43 | /*! | ||
44 | The color of the icon displayed on the action button. By default, this is | ||
45 | automatically selected based on the \l backgroundColor. | ||
46 | */ | ||
47 | property color iconColor: Theme.lightDark(button.backgroundColor, | ||
48 | Theme.light.iconColor, | ||
49 | Theme.dark.iconColor) | ||
50 | |||
51 | /*! | ||
52 | The name of the icon to display in the action button, selected from the Material | ||
53 | Design icon collection by Google. | ||
54 | */ | ||
55 | property string iconName: action ? action.iconName : "" | ||
56 | |||
57 | /*! | ||
58 | Floating action buttons come in two sizes: | ||
59 | |||
60 | \list | ||
61 | \li \b {Default size} - for most use cases | ||
62 | \li \b {Mini size} - only used to create visual continuity with other screen elements | ||
63 | \endlist | ||
64 | */ | ||
65 | property bool isMiniSize: false | ||
66 | |||
67 | style: ControlStyles.ButtonStyle { | ||
68 | padding { | ||
69 | left: 0 | ||
70 | right: 0 | ||
71 | top: 0 | ||
72 | bottom: 0 | ||
73 | } | ||
74 | |||
75 | background: Item { | ||
76 | RectangularGlow { | ||
77 | |||
78 | anchors.centerIn: parent | ||
79 | anchors.verticalCenterOffset: elevation == 1 ? 1.5 * Units.dp | ||
80 | : 1 * Units.dp | ||
81 | |||
82 | width: parent.width | ||
83 | height: parent.height | ||
84 | |||
85 | glowRadius: elevation == 1 ? 0.75 * Units.dp : 0.3 * Units.dp | ||
86 | opacity: elevation == 1 ? 0.6 : 0.3 | ||
87 | spread: elevation == 1 ? 0.7 : 0.85 | ||
88 | color: "black" | ||
89 | cornerRadius: height/2 | ||
90 | } | ||
91 | |||
92 | View { | ||
93 | anchors.fill: parent | ||
94 | radius: width/2 | ||
95 | |||
96 | backgroundColor: button.backgroundColor | ||
97 | |||
98 | tintColor: control.pressed || | ||
99 | (control.focus && !button.elevation) || | ||
100 | (control.hovered && !button.elevation) ? | ||
101 | Qt.rgba(0,0,0, control.pressed ? 0.1 : 0.05) : "transparent" | ||
102 | |||
103 | Ink { | ||
104 | id: mouseArea | ||
105 | anchors.fill: parent | ||
106 | Connections { | ||
107 | target: control.__behavior | ||
108 | onPressed: mouseArea.onPressed(mouse) | ||
109 | onCanceled: mouseArea.onCanceled() | ||
110 | onReleased: mouseArea.onReleased(mouse) | ||
111 | } | ||
112 | |||
113 | circular: true | ||
114 | } | ||
115 | } | ||
116 | } | ||
117 | label: Item { | ||
118 | implicitHeight: isMiniSize ? 40 * Units.dp : 56 * Units.dp | ||
119 | implicitWidth: implicitHeight | ||
120 | Icon { | ||
121 | id: icon | ||
122 | |||
123 | anchors.centerIn: parent | ||
124 | name: control.iconName | ||
125 | color: button.iconColor | ||
126 | size: 24 * Units.dp | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/Card.qml b/prototype_2016/third_party/qml-material/src/components/Card.qml deleted file mode 100644 index e778027..0000000 --- a/prototype_2016/third_party/qml-material/src/components/Card.qml +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype Card | ||
16 | \inqmlmodule Material | ||
17 | |||
18 | \brief A card is a piece of paper with unique related data that serves as an entry point | ||
19 | to more detailed information. | ||
20 | */ | ||
21 | View { | ||
22 | width: 300 * Units.dp | ||
23 | height: 250 * Units.dp | ||
24 | elevation: flat ? 0 : 1 | ||
25 | |||
26 | property bool flat: false | ||
27 | |||
28 | border.color: flat ? Qt.rgba(0,0,0,0.2) : "transparent" | ||
29 | radius: fullWidth || fullHeight ? 0 : 2 * Units.dp | ||
30 | |||
31 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/DatePicker.qml b/prototype_2016/third_party/qml-material/src/components/DatePicker.qml deleted file mode 100644 index 02b87ab..0000000 --- a/prototype_2016/third_party/qml-material/src/components/DatePicker.qml +++ /dev/null | |||
@@ -1,496 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015 Jordan Neidlinger <JNeidlinger@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Layouts 1.1 | ||
13 | import QtQuick.Controls 1.3 as Controls | ||
14 | import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle | ||
15 | import QtQuick.Controls.Styles 1.3 | ||
16 | import QtQuick.Controls.Private 1.0 | ||
17 | import Material 0.3 | ||
18 | |||
19 | /*! | ||
20 | \qmltype DatePicker | ||
21 | \inqmlmodule Material | ||
22 | |||
23 | \brief Date Picker provides a simple way to select a valid, formatted date | ||
24 | */ | ||
25 | Controls.Calendar { | ||
26 | |||
27 | /*! | ||
28 | Set to \c true if the picker should lay itself in landscape mode | ||
29 | */ | ||
30 | property bool isLandscape: false | ||
31 | property int dayAreaBottomMargin : 0 | ||
32 | |||
33 | style: CalendarStyle { | ||
34 | gridVisible: false | ||
35 | |||
36 | property int calendarWidth: isLandscape ? 500 * Units.dp : 340 * Units.dp | ||
37 | property int calendarHeight: isLandscape ? 280 * Units.dp : 440 * Units.dp | ||
38 | |||
39 | background: Rectangle { | ||
40 | color: "white" | ||
41 | implicitWidth: calendarWidth | ||
42 | implicitHeight: calendarHeight | ||
43 | } | ||
44 | |||
45 | navigationBar: Rectangle { | ||
46 | height: isLandscape ? calendarHeight + 64 * Units.dp : 96 * Units.dp | ||
47 | width: isLandscape ? calendarWidth / 3 : undefined | ||
48 | color: Theme.accentColor | ||
49 | |||
50 | ColumnLayout { | ||
51 | anchors.verticalCenter: isLandscape ? undefined : parent.verticalCenter | ||
52 | anchors.left: parent.left | ||
53 | anchors.leftMargin: isLandscape ? 16 * Units.dp : 24 * Units.dp | ||
54 | anchors.top: isLandscape ? parent.top : undefined | ||
55 | anchors.topMargin: isLandscape ? 16 * Units.dp : undefined | ||
56 | anchors.right: parent.right | ||
57 | anchors.rightMargin: 36 * Units.dp | ||
58 | spacing: 0 | ||
59 | |||
60 | Label { | ||
61 | font.weight: Font.DemiBold | ||
62 | style: "body2" | ||
63 | color: Qt.rgba(1, 1, 1, 0.7) | ||
64 | text: control.selectedDate.toLocaleString(control.__locale, "yyyy") | ||
65 | } | ||
66 | |||
67 | Label { | ||
68 | id: dayTitle | ||
69 | font.weight: Font.DemiBold | ||
70 | font.pixelSize: 36 * Units.dp | ||
71 | Layout.fillWidth: true | ||
72 | lineHeight: 0.9 | ||
73 | wrapMode: Text.Wrap | ||
74 | color: Theme.dark.textColor | ||
75 | text: control.selectedDate.toLocaleString(control.__locale, "ddd, MMM dd") | ||
76 | } | ||
77 | } | ||
78 | } | ||
79 | |||
80 | dayOfWeekDelegate: Rectangle { | ||
81 | color: "transparent" | ||
82 | implicitHeight: 30 * Units.dp | ||
83 | Label { | ||
84 | text: control.__locale.dayName(styleData.dayOfWeek, Locale.NarrowFormat).substring(0, 1) | ||
85 | color: Theme.light.subTextColor | ||
86 | anchors.centerIn: parent | ||
87 | } | ||
88 | } | ||
89 | |||
90 | dayDelegate: Item { | ||
91 | visible: styleData.visibleMonth | ||
92 | |||
93 | Rectangle { | ||
94 | anchors.centerIn: parent | ||
95 | width: 1 * Math.min(parent.width, parent.height) | ||
96 | height: width | ||
97 | |||
98 | color: styleData.selected ? Theme.accentColor : "transparent" | ||
99 | radius: height/2 | ||
100 | } | ||
101 | |||
102 | Label { | ||
103 | text: styleData.date.getDate() | ||
104 | anchors.centerIn: parent | ||
105 | color: styleData.selected | ||
106 | ? "white" : styleData.today | ||
107 | ? Theme.accentColor : "black" | ||
108 | } | ||
109 | } | ||
110 | |||
111 | panel: Item { | ||
112 | id: panelItem | ||
113 | |||
114 | implicitWidth: backgroundLoader.implicitWidth | ||
115 | implicitHeight: backgroundLoader.implicitHeight | ||
116 | |||
117 | property alias navigationBarItem: navigationBarLoader.item | ||
118 | |||
119 | property alias dayOfWeekHeaderRow: dayOfWeekHeaderRow | ||
120 | |||
121 | readonly property int weeksToShow: 6 | ||
122 | readonly property int rows: weeksToShow | ||
123 | readonly property int columns: CalendarUtils.daysInAWeek | ||
124 | |||
125 | // The combined available width and height to be shared amongst each cell. | ||
126 | readonly property real availableWidth: viewContainer.width | ||
127 | readonly property real availableHeight: viewContainer.height | ||
128 | |||
129 | property int hoveredCellIndex: -1 | ||
130 | property int pressedCellIndex: -1 | ||
131 | property int pressCellIndex: -1 | ||
132 | |||
133 | Rectangle { | ||
134 | anchors.fill: parent | ||
135 | color: "transparent" | ||
136 | border.color: gridColor | ||
137 | visible: control.frameVisible | ||
138 | } | ||
139 | |||
140 | Item { | ||
141 | id: container | ||
142 | anchors.fill: parent | ||
143 | anchors.margins: control.frameVisible ? 1 : 0 | ||
144 | |||
145 | Loader { | ||
146 | id: backgroundLoader | ||
147 | anchors.fill: parent | ||
148 | sourceComponent: background | ||
149 | } | ||
150 | |||
151 | Loader { | ||
152 | id: navigationBarLoader | ||
153 | anchors.left: parent.left | ||
154 | anchors.right: isLandscape ? undefined: parent.right | ||
155 | anchors.top: parent.top | ||
156 | anchors.bottom: isLandscape ? parent.bottom : undefined | ||
157 | sourceComponent: navigationBar | ||
158 | active: control.navigationBarVisible | ||
159 | |||
160 | property QtObject styleData: QtObject { | ||
161 | readonly property string title: control.__locale.standaloneMonthName(control.visibleMonth) | ||
162 | + new Date(control.visibleYear, control.visibleMonth, 1).toLocaleDateString(control.__locale, " yyyy") | ||
163 | } | ||
164 | } | ||
165 | |||
166 | Rectangle { | ||
167 | id: dayOfWeekHeaderRow | ||
168 | anchors.top: control.isLandscape ? parent.top : navigationBarLoader.bottom | ||
169 | anchors.left: control.isLandscape ? navigationBarLoader.right : parent.left | ||
170 | anchors.right: parent.right | ||
171 | width: control.isLandscape ? parent.width / 2 : undefined | ||
172 | height: control.isLandscape ? 72 * Units.dp : 80 * Units.dp | ||
173 | color: "transparent" | ||
174 | |||
175 | IconButton { | ||
176 | iconName: "navigation/chevron_left" | ||
177 | id: previousMonth | ||
178 | anchors.top: parent.top | ||
179 | anchors.topMargin: control.isLandscape ? 12 * Units.dp : 16 * Units.dp | ||
180 | anchors.left: parent.left | ||
181 | anchors.leftMargin: 16 * Units.dp | ||
182 | onClicked: control.showPreviousMonth() | ||
183 | } | ||
184 | |||
185 | IconButton { | ||
186 | iconName: "navigation/chevron_right" | ||
187 | id: nextMonth | ||
188 | anchors.top: parent.top | ||
189 | anchors.topMargin: control.isLandscape ? 12 * Units.dp : 16 * Units.dp | ||
190 | anchors.right: parent.right | ||
191 | anchors.rightMargin: 16 * Units.dp | ||
192 | onClicked: control.showNextMonth() | ||
193 | } | ||
194 | |||
195 | Label { | ||
196 | id: monthHeader | ||
197 | anchors.verticalCenter: previousMonth.verticalCenter | ||
198 | anchors.verticalCenterOffset: -1 * Units.dp | ||
199 | anchors.horizontalCenter: parent.horizontalCenter | ||
200 | font.weight: Font.Black | ||
201 | style: "subheading" | ||
202 | text: control.__locale.standaloneMonthName(control.visibleMonth) + " " + control.visibleYear | ||
203 | } | ||
204 | |||
205 | Row { | ||
206 | id: calenderHeader | ||
207 | anchors.bottom: parent.bottom | ||
208 | anchors.left: parent.left | ||
209 | anchors.leftMargin: (control.weekNumbersVisible ? weekNumbersItem.width : 0) + 8 * Units.dp | ||
210 | anchors.right: parent.right | ||
211 | anchors.rightMargin: 8 * Units.dp | ||
212 | |||
213 | spacing: gridVisible ? __gridLineWidth : 0 | ||
214 | |||
215 | Repeater { | ||
216 | id: repeater | ||
217 | model: CalendarHeaderModel { | ||
218 | locale: control.__locale | ||
219 | } | ||
220 | Loader { | ||
221 | id: dayOfWeekDelegateLoader | ||
222 | sourceComponent: dayOfWeekDelegate | ||
223 | width: __cellRectAt(index).width | ||
224 | |||
225 | readonly property int __index: index | ||
226 | readonly property var __dayOfWeek: dayOfWeek | ||
227 | |||
228 | property QtObject styleData: QtObject { | ||
229 | readonly property alias index: dayOfWeekDelegateLoader.__index | ||
230 | readonly property alias dayOfWeek: dayOfWeekDelegateLoader.__dayOfWeek | ||
231 | } | ||
232 | } | ||
233 | } | ||
234 | } | ||
235 | } | ||
236 | Rectangle { | ||
237 | id: topGridLine | ||
238 | color: __horizontalSeparatorColor | ||
239 | width: control.isLandscape ? parent.width * (2/3) : parent.width | ||
240 | height: __gridLineWidth | ||
241 | visible: gridVisible | ||
242 | anchors.top: dayOfWeekHeaderRow.bottom | ||
243 | anchors.right: control.isLandscape ? parent.right : undefined | ||
244 | } | ||
245 | |||
246 | Row { | ||
247 | id: gridRow | ||
248 | width: weekNumbersItem.width + (control.isLandscape ? (viewContainer.width * (2/3)) : viewContainer.width) - 16 * Units.dp | ||
249 | height: viewContainer.height - dayAreaBottomMargin | ||
250 | anchors.top: topGridLine.bottom | ||
251 | anchors.left: control.isLandscape ? topGridLine.left : parent.left | ||
252 | anchors.leftMargin: 8 * Units.dp | ||
253 | |||
254 | Column { | ||
255 | id: weekNumbersItem | ||
256 | visible: control.weekNumbersVisible | ||
257 | height: viewContainer.height - dayAreaBottomMargin | ||
258 | spacing: gridVisible ? __gridLineWidth : 0 | ||
259 | Repeater { | ||
260 | id: weekNumberRepeater | ||
261 | model: panelItem.weeksToShow | ||
262 | |||
263 | Loader { | ||
264 | id: weekNumberDelegateLoader | ||
265 | height: __cellRectAt(index * panelItem.columns).height | ||
266 | sourceComponent: weekNumberDelegate | ||
267 | |||
268 | readonly property int __index: index | ||
269 | property int __weekNumber: control.__model.weekNumberAt(index) | ||
270 | |||
271 | Connections { | ||
272 | target: control | ||
273 | onVisibleMonthChanged: __weekNumber = control.__model.weekNumberAt(index) | ||
274 | onVisibleYearChanged: __weekNumber = control.__model.weekNumberAt(index) | ||
275 | } | ||
276 | |||
277 | Connections { | ||
278 | target: control.__model | ||
279 | onCountChanged: __weekNumber = control.__model.weekNumberAt(index) | ||
280 | } | ||
281 | |||
282 | property QtObject styleData: QtObject { | ||
283 | readonly property alias index: weekNumberDelegateLoader.__index | ||
284 | readonly property int weekNumber: weekNumberDelegateLoader.__weekNumber | ||
285 | } | ||
286 | } | ||
287 | } | ||
288 | } | ||
289 | |||
290 | Rectangle { | ||
291 | id: separator | ||
292 | anchors.topMargin: - dayOfWeekHeaderRow.height - 1 | ||
293 | anchors.top: weekNumbersItem.top | ||
294 | anchors.bottom: weekNumbersItem.bottom | ||
295 | |||
296 | width: __gridLineWidth | ||
297 | color: __verticalSeparatorColor | ||
298 | visible: control.weekNumbersVisible | ||
299 | } | ||
300 | |||
301 | // Contains the grid lines and the grid itself. | ||
302 | Item { | ||
303 | id: viewContainer | ||
304 | width: (control.isLandscape ? container.width * (2/3) : container.width) - (control.weekNumbersVisible ? weekNumbersItem.width + separator.width : 0) - 16 * Units.dp | ||
305 | height: container.height - (control.isLandscape ? 0 : navigationBarLoader.height) - dayOfWeekHeaderRow.height - topGridLine.height - dayAreaBottomMargin | ||
306 | |||
307 | Repeater { | ||
308 | id: verticalGridLineRepeater | ||
309 | model: panelItem.columns - 1 | ||
310 | delegate: Rectangle { | ||
311 | x: __cellRectAt(index + 1).x - __gridLineWidth | ||
312 | y: 0 | ||
313 | width: __gridLineWidth | ||
314 | height: viewContainer.height | ||
315 | color: gridColor | ||
316 | visible: gridVisible | ||
317 | } | ||
318 | } | ||
319 | |||
320 | Repeater { | ||
321 | id: horizontalGridLineRepeater | ||
322 | model: panelItem.rows - 1 | ||
323 | delegate: Rectangle { | ||
324 | x: 0 | ||
325 | y: __cellRectAt((index + 1) * panelItem.columns).y - __gridLineWidth | ||
326 | width: viewContainer.width | ||
327 | height: __gridLineWidth | ||
328 | color: gridColor | ||
329 | visible: gridVisible | ||
330 | } | ||
331 | } | ||
332 | |||
333 | MouseArea { | ||
334 | id: mouseArea | ||
335 | anchors.fill: parent | ||
336 | |||
337 | hoverEnabled: true | ||
338 | |||
339 | function cellIndexAt(mouseX, mouseY) { | ||
340 | var viewContainerPos = viewContainer.mapFromItem(mouseArea, mouseX, mouseY); | ||
341 | var child = viewContainer.childAt(viewContainerPos.x, viewContainerPos.y); | ||
342 | // In the tests, the mouseArea sometimes gets picked instead of the cells, | ||
343 | // probably because stuff is still loading. To be safe, we check for that here. | ||
344 | return child && child !== mouseArea ? child.__index : -1; | ||
345 | } | ||
346 | |||
347 | onEntered: { | ||
348 | hoveredCellIndex = cellIndexAt(mouseX, mouseY); | ||
349 | if (hoveredCellIndex === undefined) { | ||
350 | hoveredCellIndex = cellIndexAt(mouseX, mouseY); | ||
351 | } | ||
352 | |||
353 | var date = view.model.dateAt(hoveredCellIndex); | ||
354 | if (__isValidDate(date)) { | ||
355 | control.hovered(date); | ||
356 | } | ||
357 | } | ||
358 | |||
359 | onExited: { | ||
360 | hoveredCellIndex = -1; | ||
361 | } | ||
362 | |||
363 | onPositionChanged: { | ||
364 | var indexOfCell = cellIndexAt(mouse.x, mouse.y); | ||
365 | var previousHoveredCellIndex = hoveredCellIndex; | ||
366 | hoveredCellIndex = indexOfCell; | ||
367 | if (indexOfCell !== -1) { | ||
368 | var date = view.model.dateAt(indexOfCell); | ||
369 | if (__isValidDate(date)) { | ||
370 | if (hoveredCellIndex !== previousHoveredCellIndex) | ||
371 | control.hovered(date); | ||
372 | |||
373 | // The date must be different for the pressed signal to be emitted. | ||
374 | if (pressed && date.getTime() !== control.selectedDate.getTime()) { | ||
375 | control.pressed(date); | ||
376 | |||
377 | // You can't select dates in a different month while dragging. | ||
378 | if (date.getMonth() === control.selectedDate.getMonth()) { | ||
379 | control.selectedDate = date; | ||
380 | pressedCellIndex = indexOfCell; | ||
381 | } | ||
382 | } | ||
383 | } | ||
384 | } | ||
385 | } | ||
386 | |||
387 | onPressed: { | ||
388 | pressCellIndex = cellIndexAt(mouse.x, mouse.y); | ||
389 | if (pressCellIndex !== -1) { | ||
390 | var date = view.model.dateAt(pressCellIndex); | ||
391 | pressedCellIndex = pressCellIndex; | ||
392 | if (__isValidDate(date) && (date.getMonth() === control.visibleMonth && date.getFullYear() === control.visibleYear)) { | ||
393 | control.selectedDate = date; | ||
394 | control.pressed(date); | ||
395 | } | ||
396 | } | ||
397 | } | ||
398 | |||
399 | onReleased: { | ||
400 | var indexOfCell = cellIndexAt(mouse.x, mouse.y); | ||
401 | if (indexOfCell !== -1) { | ||
402 | // The cell index might be valid, but the date has to be too. We could let the | ||
403 | // selected date validation take care of this, but then the selected date would | ||
404 | // change to the earliest day if a day before the minimum date is clicked, for example. | ||
405 | var date = view.model.dateAt(indexOfCell); | ||
406 | if (__isValidDate(date)) { | ||
407 | control.released(date); | ||
408 | } | ||
409 | } | ||
410 | pressedCellIndex = -1; | ||
411 | } | ||
412 | |||
413 | onClicked: { | ||
414 | var indexOfCell = cellIndexAt(mouse.x, mouse.y); | ||
415 | if (indexOfCell !== -1 && indexOfCell === pressCellIndex) { | ||
416 | var date = view.model.dateAt(indexOfCell); | ||
417 | if (__isValidDate(date)) | ||
418 | control.clicked(date); | ||
419 | } | ||
420 | } | ||
421 | |||
422 | onDoubleClicked: { | ||
423 | var indexOfCell = cellIndexAt(mouse.x, mouse.y); | ||
424 | if (indexOfCell !== -1) { | ||
425 | var date = view.model.dateAt(indexOfCell); | ||
426 | if (__isValidDate(date)) | ||
427 | control.doubleClicked(date); | ||
428 | } | ||
429 | } | ||
430 | |||
431 | onPressAndHold: { | ||
432 | var indexOfCell = cellIndexAt(mouse.x, mouse.y); | ||
433 | if (indexOfCell !== -1 && indexOfCell === pressCellIndex) { | ||
434 | var date = view.model.dateAt(indexOfCell); | ||
435 | if (__isValidDate(date)) | ||
436 | control.pressAndHold(date); | ||
437 | } | ||
438 | } | ||
439 | } | ||
440 | |||
441 | Connections { | ||
442 | target: control | ||
443 | onSelectedDateChanged: view.selectedDateChanged() | ||
444 | } | ||
445 | |||
446 | Repeater { | ||
447 | id: view | ||
448 | |||
449 | property int currentIndex: -1 | ||
450 | |||
451 | model: control.__model | ||
452 | |||
453 | Component.onCompleted: selectedDateChanged() | ||
454 | |||
455 | function selectedDateChanged() { | ||
456 | if (model !== undefined && model.locale !== undefined) { | ||
457 | currentIndex = model.indexAt(control.selectedDate); | ||
458 | } | ||
459 | } | ||
460 | |||
461 | delegate: Loader { | ||
462 | id: delegateLoader | ||
463 | |||
464 | x: __cellRectAt(index).x | ||
465 | y: __cellRectAt(index).y | ||
466 | width: __cellRectAt(index).width | ||
467 | height: __cellRectAt(index).height | ||
468 | sourceComponent: dayDelegate | ||
469 | |||
470 | readonly property int __index: index | ||
471 | readonly property date __date: date | ||
472 | // We rely on the fact that an invalid QDate will be converted to a Date | ||
473 | // whose year is -4713, which is always an invalid date since our | ||
474 | // earliest minimum date is the year 1. | ||
475 | readonly property bool valid: __isValidDate(date) | ||
476 | |||
477 | property QtObject styleData: QtObject { | ||
478 | readonly property alias index: delegateLoader.__index | ||
479 | readonly property bool selected: control.selectedDate.getTime() === date.getTime() | ||
480 | readonly property alias date: delegateLoader.__date | ||
481 | readonly property bool valid: delegateLoader.valid | ||
482 | // TODO: this will not be correct if the app is running when a new day begins. | ||
483 | readonly property bool today: date.getTime() === new Date().setHours(0, 0, 0, 0) | ||
484 | readonly property bool visibleMonth: date.getMonth() === control.visibleMonth | ||
485 | readonly property bool hovered: panelItem.hoveredCellIndex == index | ||
486 | readonly property bool pressed: panelItem.pressedCellIndex == index | ||
487 | // todo: pressed property here, clicked and doubleClicked in the control itself | ||
488 | } | ||
489 | } | ||
490 | } | ||
491 | } | ||
492 | } | ||
493 | } | ||
494 | } | ||
495 | } | ||
496 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/IconButton.qml b/prototype_2016/third_party/qml-material/src/components/IconButton.qml deleted file mode 100644 index 2c6d27d..0000000 --- a/prototype_2016/third_party/qml-material/src/components/IconButton.qml +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import Material.Extras 0.1 | ||
14 | |||
15 | /*! | ||
16 | \qmltype IconButton | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Icon buttons are appropriate for app bars, toolbars, action buttons or toggles. | ||
20 | */ | ||
21 | Item { | ||
22 | id: iconButton | ||
23 | |||
24 | property Action action | ||
25 | property string iconName | ||
26 | property string iconSource: action ? action.iconSource : "icon://" + iconName | ||
27 | property bool hoverAnimation: action ? action.hoverAnimation : false | ||
28 | property alias color: icon.color | ||
29 | property alias size: icon.size | ||
30 | |||
31 | signal clicked | ||
32 | |||
33 | width: icon.width | ||
34 | height: icon.height | ||
35 | enabled: action ? action.enabled : true | ||
36 | opacity: enabled ? 1 : 0.6 | ||
37 | |||
38 | onClicked: { | ||
39 | if (action) action.triggered(icon) | ||
40 | } | ||
41 | |||
42 | Ink { | ||
43 | id: ink | ||
44 | |||
45 | anchors.centerIn: parent | ||
46 | enabled: iconButton.enabled | ||
47 | centered: true | ||
48 | circular: true | ||
49 | |||
50 | width: parent.width + 20 * Units.dp | ||
51 | height: parent.height + 20 * Units.dp | ||
52 | |||
53 | z: 0 | ||
54 | |||
55 | onClicked: { | ||
56 | iconButton.clicked() | ||
57 | } | ||
58 | } | ||
59 | |||
60 | Icon { | ||
61 | id: icon | ||
62 | |||
63 | anchors.centerIn: parent | ||
64 | |||
65 | source: iconButton.iconSource | ||
66 | rotation: iconButton.hoverAnimation ? ink.containsMouse ? 90 : 0 | ||
67 | : 0 | ||
68 | |||
69 | Behavior on rotation { | ||
70 | NumberAnimation { duration: 200 } | ||
71 | } | ||
72 | } | ||
73 | |||
74 | Tooltip { | ||
75 | text: action ? action.name : "" | ||
76 | mouseArea: ink | ||
77 | } | ||
78 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml b/prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml deleted file mode 100644 index 47c032b..0000000 --- a/prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | /*! | ||
14 | \qmltype OverlayLayer | ||
15 | \inqmlmodule Material | ||
16 | |||
17 | \brief Provides a layer to display popups and other overlay components. | ||
18 | */ | ||
19 | Rectangle { | ||
20 | id: overlayLayer | ||
21 | objectName: "overlayLayer" | ||
22 | |||
23 | anchors.fill: parent | ||
24 | |||
25 | property Item currentOverlay | ||
26 | color: "transparent" | ||
27 | |||
28 | onEnabledChanged: { | ||
29 | if (!enabled && overlayLayer.currentOverlay != null) | ||
30 | overlayLayer.currentOverlay.close() | ||
31 | } | ||
32 | |||
33 | onWidthChanged: closeIfNecessary() | ||
34 | onHeightChanged: closeIfNecessary() | ||
35 | |||
36 | states: State { | ||
37 | name: "ShowState" | ||
38 | when: overlayLayer.currentOverlay != null | ||
39 | |||
40 | PropertyChanges { | ||
41 | target: overlayLayer | ||
42 | color: currentOverlay.overlayColor | ||
43 | } | ||
44 | } | ||
45 | |||
46 | transitions: Transition { | ||
47 | ColorAnimation { | ||
48 | duration: 300 | ||
49 | easing.type: Easing.InOutQuad | ||
50 | } | ||
51 | } | ||
52 | |||
53 | function closeIfNecessary() { | ||
54 | if (overlayLayer.currentOverlay != null && overlayLayer.currentOverlay.closeOnResize) | ||
55 | overlayLayer.currentOverlay.close() | ||
56 | } | ||
57 | |||
58 | MouseArea { | ||
59 | anchors.fill: parent | ||
60 | enabled: overlayLayer.currentOverlay != null && | ||
61 | overlayLayer.currentOverlay.globalMouseAreaEnabled | ||
62 | hoverEnabled: enabled | ||
63 | |||
64 | onWheel: wheel.accepted = true | ||
65 | |||
66 | onClicked: { | ||
67 | if (overlayLayer.currentOverlay.dismissOnTap) | ||
68 | overlayLayer.currentOverlay.close() | ||
69 | } | ||
70 | } | ||
71 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/OverlayView.qml b/prototype_2016/third_party/qml-material/src/components/OverlayView.qml deleted file mode 100644 index f2f5fbe..0000000 --- a/prototype_2016/third_party/qml-material/src/components/OverlayView.qml +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import Material.Extras 0.1 | ||
14 | |||
15 | /*! | ||
16 | \qmltype OverlayView | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A view that pops out of the content to display as an overlay. | ||
20 | */ | ||
21 | PopupBase { | ||
22 | id: overlay | ||
23 | |||
24 | overlayLayer: "dialogOverlayLayer" | ||
25 | overlayColor: Qt.rgba(0, 0, 0, 0.3) | ||
26 | |||
27 | visible: transitionOpacity > 0 | ||
28 | state: showing ? "visible" : "hidden" | ||
29 | |||
30 | x: (parent.width - width)/2 | ||
31 | y: (parent.height - height)/2 | ||
32 | |||
33 | property alias transitionOpacity: shadow.opacity | ||
34 | |||
35 | states: [ | ||
36 | State { | ||
37 | name: "hidden" | ||
38 | |||
39 | PropertyChanges { | ||
40 | target: overlay | ||
41 | x: sourceView ? sourceView.mapToItem(overlay.parent, 0, 0).x : 0 | ||
42 | y: sourceView ? sourceView.mapToItem(overlay.parent, 0, 0).y : 0 | ||
43 | width: sourceView ? sourceView.width : 0 | ||
44 | height: sourceView ? sourceView.height : 0 | ||
45 | } | ||
46 | } | ||
47 | ] | ||
48 | |||
49 | transitions: Transition { | ||
50 | from: "*"; to: "*" | ||
51 | |||
52 | NumberAnimation { | ||
53 | target: overlay | ||
54 | properties: "x,y,width,height" | ||
55 | duration: 300; easing.type: Easing.InOutQuad | ||
56 | } | ||
57 | } | ||
58 | |||
59 | property Item sourceView | ||
60 | |||
61 | function open(sourceView) { | ||
62 | overlay.sourceView = sourceView; | ||
63 | |||
64 | parent = Utils.findRootChild(overlay, overlayLayer) | ||
65 | showing = true | ||
66 | forceActiveFocus() | ||
67 | parent.currentOverlay = overlay | ||
68 | |||
69 | opened() | ||
70 | } | ||
71 | |||
72 | function close() { | ||
73 | showing = false | ||
74 | parent.currentOverlay = null | ||
75 | sourceView = null | ||
76 | } | ||
77 | |||
78 | View { | ||
79 | id: shadow | ||
80 | |||
81 | anchors.fill: parent | ||
82 | opacity: showing ? 1 : 0 | ||
83 | elevation: 5 | ||
84 | |||
85 | Behavior on opacity { | ||
86 | NumberAnimation { | ||
87 | duration: 300; easing.type: Easing.InOutQuad | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/ProgressCircle.qml b/prototype_2016/third_party/qml-material/src/components/ProgressCircle.qml deleted file mode 100644 index 71cd7b5..0000000 --- a/prototype_2016/third_party/qml-material/src/components/ProgressCircle.qml +++ /dev/null | |||
@@ -1,226 +0,0 @@ | |||
1 | /***** THIS FILE CANNOT BE RELICENSED UNDER THE MPL YET *****/ | ||
2 | |||
3 | /* | ||
4 | * QML Material - An application framework implementing Material Design. | ||
5 | * Copyright (C) 2015 Jordan Neidlinger <JNeidlinger@gmail.com> | ||
6 | * | ||
7 | * This program is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU Lesser General Public License as | ||
9 | * published by the Free Software Foundation, either version 2.1 of the | ||
10 | * License, or (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU Lesser General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU Lesser General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | import QtQuick 2.4 | ||
21 | import QtQuick.Window 2.2 | ||
22 | import QtQuick.Controls 1.3 as Controls | ||
23 | import QtQuick.Controls.Styles 1.3 as Styles | ||
24 | import Material 0.3 | ||
25 | |||
26 | /*! | ||
27 | \qmltype ProgressCircle | ||
28 | \inqmlmodule Material | ||
29 | |||
30 | \brief Visual circular indicator of progress in some operation. | ||
31 | */ | ||
32 | Controls.ProgressBar { | ||
33 | id: progressBar | ||
34 | |||
35 | /*! | ||
36 | The color for the progress circle. By default this is | ||
37 | the primary color defined in \l Theme::primaryColor | ||
38 | */ | ||
39 | property color color: Theme.primaryColor | ||
40 | |||
41 | /*! | ||
42 | The thickness of the progress circle's stroke, | ||
43 | 3 dp by default | ||
44 | */ | ||
45 | property real dashThickness: 3 * Units.dp | ||
46 | |||
47 | width: 32 * Units.dp | ||
48 | height: 32 * Units.dp | ||
49 | |||
50 | indeterminate: true | ||
51 | |||
52 | style: Styles.ProgressBarStyle { | ||
53 | id: progressBarStyle | ||
54 | |||
55 | progress: Item { | ||
56 | anchors.fill: parent | ||
57 | |||
58 | Canvas { | ||
59 | id: canvas | ||
60 | |||
61 | property int ratio: Screen.devicePixelRatio | ||
62 | |||
63 | width: parent.width * ratio | ||
64 | height: parent.height * ratio | ||
65 | anchors.centerIn: parent | ||
66 | |||
67 | scale: 1/ratio | ||
68 | |||
69 | onWidthChanged: requestPaint() | ||
70 | onHeightChanged: requestPaint() | ||
71 | |||
72 | renderStrategy: Canvas.Threaded | ||
73 | antialiasing: true | ||
74 | onPaint: drawSpinner(); | ||
75 | |||
76 | opacity: visible ? 1.0 : 0 | ||
77 | |||
78 | Behavior on opacity { | ||
79 | PropertyAnimation { | ||
80 | duration: 800 | ||
81 | } | ||
82 | } | ||
83 | |||
84 | Connections { | ||
85 | target: control | ||
86 | onColorChanged: canvas.requestPaint() | ||
87 | onValueChanged: canvas.requestPaint() | ||
88 | onDashThicknessChanged: canvas.requestPaint() | ||
89 | onIndeterminateChanged: | ||
90 | { | ||
91 | if(control.indeterminate) | ||
92 | { | ||
93 | internal.arcEndPoint = 0 | ||
94 | internal.arcStartPoint = 0 | ||
95 | internal.rotate = 0 | ||
96 | } | ||
97 | |||
98 | canvas.requestPaint(); | ||
99 | } | ||
100 | } | ||
101 | |||
102 | QtObject { | ||
103 | id: internal | ||
104 | |||
105 | property real arcEndPoint: 0 | ||
106 | onArcEndPointChanged: canvas.requestPaint(); | ||
107 | |||
108 | property real arcStartPoint: 0 | ||
109 | onArcStartPointChanged: canvas.requestPaint(); | ||
110 | |||
111 | property real rotate: 0 | ||
112 | onRotateChanged: canvas.requestPaint(); | ||
113 | |||
114 | property real longDash: 3 * Math.PI / 2 | ||
115 | property real shortDash: 19 * Math.PI / 10 | ||
116 | } | ||
117 | |||
118 | NumberAnimation { | ||
119 | target: internal | ||
120 | properties: "rotate" | ||
121 | from: 0 | ||
122 | to: 2 * Math.PI | ||
123 | loops: Animation.Infinite | ||
124 | running: control.indeterminate && canvas.visible | ||
125 | easing.type: Easing.Linear | ||
126 | duration: 3000 | ||
127 | } | ||
128 | |||
129 | SequentialAnimation { | ||
130 | running: control.indeterminate && canvas.visible | ||
131 | loops: Animation.Infinite | ||
132 | |||
133 | ParallelAnimation { | ||
134 | NumberAnimation { | ||
135 | target: internal | ||
136 | properties: "arcEndPoint" | ||
137 | from: 0 | ||
138 | to: internal.longDash | ||
139 | easing.type: Easing.InOutCubic | ||
140 | duration: 800 | ||
141 | } | ||
142 | |||
143 | NumberAnimation { | ||
144 | target: internal | ||
145 | properties: "arcStartPoint" | ||
146 | from: internal.shortDash | ||
147 | to: 2 * Math.PI - 0.001 | ||
148 | easing.type: Easing.InOutCubic | ||
149 | duration: 800 | ||
150 | } | ||
151 | } | ||
152 | |||
153 | ParallelAnimation { | ||
154 | NumberAnimation { | ||
155 | target: internal | ||
156 | properties: "arcEndPoint" | ||
157 | from: internal.longDash | ||
158 | to: 2 * Math.PI - 0.001 | ||
159 | easing.type: Easing.InOutCubic | ||
160 | duration: 800 | ||
161 | } | ||
162 | |||
163 | NumberAnimation { | ||
164 | target: internal | ||
165 | properties: "arcStartPoint" | ||
166 | from: 0 | ||
167 | to: internal.shortDash | ||
168 | easing.type: Easing.InOutCubic | ||
169 | duration: 800 | ||
170 | } | ||
171 | } | ||
172 | } | ||
173 | |||
174 | function drawSpinner() { | ||
175 | var ctx = canvas.getContext("2d"); | ||
176 | ctx.reset(); | ||
177 | ctx.clearRect(0, 0, canvas.width, canvas.height); | ||
178 | ctx.strokeStyle = control.color | ||
179 | ctx.lineWidth = control.dashThickness * canvas.ratio | ||
180 | ctx.lineCap = "butt"; | ||
181 | |||
182 | ctx.translate(canvas.width / 2, canvas.height / 2); | ||
183 | ctx.rotate(control.indeterminate ? internal.rotate : currentProgress * (3 * Math.PI / 2)); | ||
184 | |||
185 | ctx.arc(0, 0, Math.max(0, Math.min(canvas.width, canvas.height) / 2 - ctx.lineWidth), | ||
186 | control.indeterminate ? internal.arcStartPoint : 0, | ||
187 | control.indeterminate ? internal.arcEndPoint : currentProgress * (2 * Math.PI), | ||
188 | false); | ||
189 | |||
190 | ctx.stroke(); | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | |||
195 | property Component panel: Item{ | ||
196 | implicitWidth: backgroundLoader.implicitWidth | ||
197 | implicitHeight: backgroundLoader.implicitHeight | ||
198 | |||
199 | Item { | ||
200 | width: parent.width | ||
201 | height: parent.height | ||
202 | transformOrigin: Item.TopLeft | ||
203 | |||
204 | Rectangle { | ||
205 | id: backgroundLoader | ||
206 | implicitWidth: control.width | ||
207 | implicitHeight: control.height | ||
208 | color: "transparent" | ||
209 | } | ||
210 | |||
211 | Loader { | ||
212 | sourceComponent: progressBarStyle.progress | ||
213 | anchors.topMargin: padding.top | ||
214 | anchors.leftMargin: padding.left | ||
215 | anchors.rightMargin: padding.right | ||
216 | anchors.bottomMargin: padding.bottom | ||
217 | |||
218 | anchors.top: parent.top | ||
219 | anchors.left: parent.left | ||
220 | anchors.bottom: parent.bottom | ||
221 | width: parent.width - padding.left - padding.right | ||
222 | } | ||
223 | } | ||
224 | } | ||
225 | } | ||
226 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/Scrollbar.qml b/prototype_2016/third_party/qml-material/src/components/Scrollbar.qml deleted file mode 100644 index 4c3de83..0000000 --- a/prototype_2016/third_party/qml-material/src/components/Scrollbar.qml +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | /*! | ||
14 | \qmltype Scrollbar | ||
15 | \inqmlmodule Material | ||
16 | |||
17 | \brief Scrollbars show scrolling progress for listviews and flickables. | ||
18 | */ | ||
19 | Item { | ||
20 | id: root | ||
21 | |||
22 | property Flickable flickableItem | ||
23 | property int orientation: Qt.Vertical | ||
24 | property int thickness: 5 | ||
25 | property bool moving: flickableItem.moving | ||
26 | |||
27 | width: thickness | ||
28 | height: thickness | ||
29 | clip: true | ||
30 | smooth: true | ||
31 | visible: orientation === Qt.Vertical ? flickableItem.contentHeight > flickableItem.height | ||
32 | : flickableItem.contentWidth > flickableItem.width | ||
33 | |||
34 | anchors { | ||
35 | top: orientation === Qt.Vertical ? flickableItem.top : undefined | ||
36 | bottom: flickableItem.bottom | ||
37 | left: orientation === Qt.Horizontal ? flickableItem.left : undefined | ||
38 | right: flickableItem.right | ||
39 | margins: 2 | ||
40 | } | ||
41 | |||
42 | Component.onCompleted: hideAnimation.start() | ||
43 | |||
44 | onMovingChanged: { | ||
45 | if (moving) { | ||
46 | hideAnimation.stop() | ||
47 | showAnimation.start() | ||
48 | } else { | ||
49 | hideAnimation.start() | ||
50 | showAnimation.stop() | ||
51 | } | ||
52 | } | ||
53 | |||
54 | NumberAnimation { | ||
55 | id: showAnimation | ||
56 | target: scrollBar; | ||
57 | property: "opacity"; | ||
58 | to: 0.3; | ||
59 | duration: 200; | ||
60 | easing.type: Easing.InOutQuad | ||
61 | } | ||
62 | |||
63 | SequentialAnimation { | ||
64 | id: hideAnimation | ||
65 | |||
66 | NumberAnimation { duration: 500 } | ||
67 | NumberAnimation { | ||
68 | target: scrollBar; | ||
69 | property: "opacity"; | ||
70 | to: 0; | ||
71 | duration: 500; | ||
72 | easing.type: Easing.InOutQuad | ||
73 | } | ||
74 | } | ||
75 | |||
76 | onOrientationChanged: { | ||
77 | if (orientation == Qt.Vertical) { | ||
78 | width = thickness | ||
79 | } else { | ||
80 | height = thickness | ||
81 | } | ||
82 | } | ||
83 | |||
84 | Rectangle { | ||
85 | id: scrollBar | ||
86 | property int length: orientation == Qt.Vertical ? root.height | ||
87 | : root.width; | ||
88 | property int targetLength: orientation == Qt.Vertical ? flickableItem.height | ||
89 | : flickableItem.width; | ||
90 | property int contentStart: orientation == Qt.Vertical ? flickableItem.contentY | ||
91 | : flickableItem.contentX; | ||
92 | property int contentLength: orientation == Qt.Vertical ? flickableItem.contentHeight | ||
93 | : flickableItem.contentWidth; | ||
94 | property int start: Math.max(0, length * contentStart/contentLength); | ||
95 | property int end: Math.min(length, | ||
96 | length * (contentStart + targetLength)/contentLength) | ||
97 | |||
98 | color: "black"//theme.foreground | ||
99 | opacity: 0.3 | ||
100 | radius: thickness/2 | ||
101 | width: Math.max(orientation == Qt.Horizontal ? end - start : 0, thickness) | ||
102 | height: Math.max(orientation == Qt.Vertical ? end - start : 0, thickness) | ||
103 | x: orientation == Qt.Horizontal ? start : 0 | ||
104 | y: orientation == Qt.Vertical ? start : 0 | ||
105 | } | ||
106 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/Snackbar.qml b/prototype_2016/third_party/qml-material/src/components/Snackbar.qml deleted file mode 100644 index 834a8b7..0000000 --- a/prototype_2016/third_party/qml-material/src/components/Snackbar.qml +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2014 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Layouts 1.1 | ||
14 | import Material 0.3 | ||
15 | |||
16 | /*! | ||
17 | \qmltype Snackbar | ||
18 | \inqmlmodule Material | ||
19 | |||
20 | \brief Snackbars provide lightweight feedback about an operation | ||
21 | */ | ||
22 | View { | ||
23 | id: snackbar | ||
24 | |||
25 | property string buttonText | ||
26 | property color buttonColor: Theme.accentColor | ||
27 | property string text | ||
28 | property bool opened | ||
29 | property int duration: 2000 | ||
30 | property bool fullWidth: Device.type === Device.phone || Device.type === Device.phablet | ||
31 | |||
32 | signal clicked | ||
33 | |||
34 | function open(text) { | ||
35 | snackbar.text = text | ||
36 | opened = true; | ||
37 | timer.restart(); | ||
38 | } | ||
39 | |||
40 | anchors { | ||
41 | left: fullWidth ? parent.left : undefined | ||
42 | right: fullWidth ? parent.right : undefined | ||
43 | bottom: parent.bottom | ||
44 | bottomMargin: opened ? 0 : -snackbar.height | ||
45 | horizontalCenter: fullWidth ? undefined : parent.horizontalCenter | ||
46 | |||
47 | Behavior on bottomMargin { | ||
48 | NumberAnimation { duration: 300 } | ||
49 | } | ||
50 | } | ||
51 | radius: fullWidth ? 0 : 2 * Units.dp | ||
52 | backgroundColor: "#323232" | ||
53 | height: snackLayout.height | ||
54 | width: fullWidth ? undefined : snackLayout.width | ||
55 | opacity: opened ? 1 : 0 | ||
56 | |||
57 | Timer { | ||
58 | id: timer | ||
59 | |||
60 | interval: snackbar.duration | ||
61 | |||
62 | onTriggered: { | ||
63 | if (!running) { | ||
64 | snackbar.opened = false; | ||
65 | } | ||
66 | } | ||
67 | } | ||
68 | |||
69 | RowLayout { | ||
70 | id: snackLayout | ||
71 | |||
72 | anchors { | ||
73 | verticalCenter: parent.verticalCenter | ||
74 | left: snackbar.fullWidth ? parent.left : undefined | ||
75 | right: snackbar.fullWidth ? parent.right : undefined | ||
76 | } | ||
77 | |||
78 | spacing: 0 | ||
79 | |||
80 | Item { | ||
81 | width: 24 * Units.dp | ||
82 | } | ||
83 | |||
84 | Label { | ||
85 | id: snackText | ||
86 | Layout.fillWidth: true | ||
87 | Layout.minimumWidth: snackbar.fullWidth ? -1 : 216 * Units.dp - snackButton.width | ||
88 | Layout.maximumWidth: snackbar.fullWidth ? -1 : | ||
89 | Math.min(496 * Units.dp - snackButton.width - middleSpacer.width - 48 * Units.dp, | ||
90 | snackbar.parent.width - snackButton.width - middleSpacer.width - 48 * Units.dp) | ||
91 | |||
92 | Layout.preferredHeight: lineCount == 2 ? 80 * Units.dp : 48 * Units.dp | ||
93 | verticalAlignment: Text.AlignVCenter | ||
94 | maximumLineCount: 2 | ||
95 | wrapMode: Text.Wrap | ||
96 | elide: Text.ElideRight | ||
97 | text: snackbar.text | ||
98 | color: "white" | ||
99 | } | ||
100 | |||
101 | Item { | ||
102 | id: middleSpacer | ||
103 | width: snackbar.buttonText == "" ? 0 : snackbar.fullWidth ? 24 * Units.dp : 48 * Units.dp | ||
104 | } | ||
105 | |||
106 | Button { | ||
107 | id: snackButton | ||
108 | textColor: snackbar.buttonColor | ||
109 | visible: snackbar.buttonText != "" | ||
110 | text: snackbar.buttonText | ||
111 | context: "snackbar" | ||
112 | width: visible ? implicitWidth : 0 | ||
113 | onClicked: snackbar.clicked() | ||
114 | } | ||
115 | |||
116 | Item { | ||
117 | width: 24 * Units.dp | ||
118 | } | ||
119 | } | ||
120 | |||
121 | Behavior on opacity { | ||
122 | NumberAnimation { duration: 300 } | ||
123 | } | ||
124 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/ThinDivider.qml b/prototype_2016/third_party/qml-material/src/components/ThinDivider.qml deleted file mode 100644 index 8770960..0000000 --- a/prototype_2016/third_party/qml-material/src/components/ThinDivider.qml +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype ThinDivider | ||
16 | \inqmlmodule Material | ||
17 | |||
18 | \brief A 1dp high divider for use in lists and other columns of content. | ||
19 | */ | ||
20 | Rectangle { | ||
21 | anchors { | ||
22 | left: parent.left | ||
23 | right: parent.right | ||
24 | } | ||
25 | |||
26 | property bool darkBackground | ||
27 | |||
28 | color: darkBackground ? Theme.dark.hintColor : Theme.light.hintColor | ||
29 | height: 1 | ||
30 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/TimePicker.qml b/prototype_2016/third_party/qml-material/src/components/TimePicker.qml deleted file mode 100644 index 6f84275..0000000 --- a/prototype_2016/third_party/qml-material/src/components/TimePicker.qml +++ /dev/null | |||
@@ -1,579 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015 Steve Coffey <scoffey@barracuda.com> | ||
5 | * 2015 Jordan Neidlinger <JNeidlinger@gmail.com> | ||
6 | * 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
7 | * | ||
8 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
9 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
11 | */ | ||
12 | |||
13 | import QtQuick 2.4 | ||
14 | import Material 0.3 | ||
15 | import Material.Extras 0.1 | ||
16 | import QtQuick.Controls 1.3 as QuickControls | ||
17 | import QtQuick.Controls.Styles 1.3 | ||
18 | |||
19 | FocusScope { | ||
20 | id: timePicker | ||
21 | |||
22 | width: 300 * Units.dp | ||
23 | height: content.height | ||
24 | |||
25 | /*! | ||
26 | Set to \c true if selection is 24 hour based. Defaults to false | ||
27 | */ | ||
28 | property bool prefer24Hour: false | ||
29 | |||
30 | /*! | ||
31 | The visual padding around the clock element | ||
32 | */ | ||
33 | property real clockPadding: 24 * Units.dp | ||
34 | |||
35 | /*! | ||
36 | Set to \c true if the time picker should first show the hours. Defaults to true | ||
37 | */ | ||
38 | property bool isHours: true | ||
39 | |||
40 | /*! | ||
41 | Sets the bottom margin for the time picker | ||
42 | */ | ||
43 | property int bottomMargin: 0 | ||
44 | |||
45 | Keys.onUpPressed: { | ||
46 | var date = internal.timePicked | ||
47 | |||
48 | if(isHours) | ||
49 | date.setHours(internal.timePicked.getHours() + 1) | ||
50 | else | ||
51 | date.setMinutes(internal.timePicked.getMinutes() + 1) | ||
52 | |||
53 | internal.timePicked = date | ||
54 | } | ||
55 | |||
56 | Keys.onDownPressed: { | ||
57 | var date = internal.timePicked | ||
58 | |||
59 | if(isHours) | ||
60 | date.setHours(internal.timePicked.getHours() - 1) | ||
61 | else | ||
62 | date.setMinutes(internal.timePicked.getMinutes() - 1) | ||
63 | |||
64 | internal.timePicked = date | ||
65 | } | ||
66 | |||
67 | Keys.onLeftPressed: { | ||
68 | if(!isHours) | ||
69 | setIsHours(true) | ||
70 | } | ||
71 | |||
72 | Keys.onRightPressed: { | ||
73 | if(isHours) | ||
74 | setIsHours(false) | ||
75 | } | ||
76 | |||
77 | property string __digitsPressed | ||
78 | |||
79 | Keys.onDigit0Pressed: setDigitsPressed(0) | ||
80 | Keys.onDigit1Pressed: setDigitsPressed(1) | ||
81 | Keys.onDigit2Pressed: setDigitsPressed(2) | ||
82 | Keys.onDigit3Pressed: setDigitsPressed(3) | ||
83 | Keys.onDigit4Pressed: setDigitsPressed(4) | ||
84 | Keys.onDigit5Pressed: setDigitsPressed(5) | ||
85 | Keys.onDigit6Pressed: setDigitsPressed(6) | ||
86 | Keys.onDigit7Pressed: setDigitsPressed(7) | ||
87 | Keys.onDigit8Pressed: setDigitsPressed(8) | ||
88 | Keys.onDigit9Pressed: setDigitsPressed(9) | ||
89 | |||
90 | QtObject { | ||
91 | id: internal | ||
92 | property bool resetFlag: false | ||
93 | property date timePicked | ||
94 | property bool completed: false | ||
95 | |||
96 | onTimePickedChanged: { | ||
97 | if(completed) { | ||
98 | var hours = timePicked.getHours() | ||
99 | if(hours > 11 && !prefer24Hour){ | ||
100 | hours -= 12 | ||
101 | amPmPicker.isAm = false | ||
102 | } else { | ||
103 | amPmPicker.isAm = true | ||
104 | } | ||
105 | |||
106 | hoursPathView.currentIndex = hours | ||
107 | |||
108 | var minutes = internal.timePicked.getMinutes() | ||
109 | minutesPathView.currentIndex = minutes | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | |||
114 | Component.onCompleted: { | ||
115 | internal.completed = true | ||
116 | internal.timePicked = new Date(Date.now()) | ||
117 | forceActiveFocus() | ||
118 | } | ||
119 | |||
120 | Column { | ||
121 | id:content | ||
122 | height: childrenRect.height + bottomMargin | ||
123 | width: parent.width | ||
124 | |||
125 | Rectangle { | ||
126 | id: headerView | ||
127 | width: parent.width | ||
128 | height: 88 * Units.dp | ||
129 | color: Theme.accentColor | ||
130 | |||
131 | Row { | ||
132 | id: timeContainer | ||
133 | anchors.centerIn: parent | ||
134 | height: 48 * Units.dp | ||
135 | |||
136 | Label { | ||
137 | id:hoursLabel | ||
138 | style: "display3" | ||
139 | color: isHours ? "white" : "#99ffffff" | ||
140 | text: internal.timePicked.getHours() | ||
141 | anchors.verticalCenter: parent.verticalCenter | ||
142 | |||
143 | MouseArea { | ||
144 | anchors.fill: parent | ||
145 | onClicked: { | ||
146 | if(!isHours){ | ||
147 | setIsHours(true) | ||
148 | } | ||
149 | } | ||
150 | } | ||
151 | } | ||
152 | |||
153 | Label { | ||
154 | style: "display3" | ||
155 | color: "white" | ||
156 | text:":" | ||
157 | anchors.verticalCenter: parent.verticalCenter | ||
158 | } | ||
159 | |||
160 | Label { | ||
161 | id: minutesLabel | ||
162 | style: "display3" | ||
163 | color: !isHours ? "white" : "#99ffffff" | ||
164 | text: internal.timePicked.getMinutes() < 10 ? "0" + internal.timePicked.getMinutes() : internal.timePicked.getMinutes() | ||
165 | anchors.verticalCenter: parent.verticalCenter | ||
166 | |||
167 | MouseArea { | ||
168 | anchors.fill: parent | ||
169 | onClicked: { | ||
170 | if(isHours){ | ||
171 | setIsHours(false) | ||
172 | } | ||
173 | } | ||
174 | } | ||
175 | } | ||
176 | } | ||
177 | |||
178 | Column { | ||
179 | id: amPmPicker | ||
180 | visible: !prefer24Hour | ||
181 | |||
182 | property bool isAm: true | ||
183 | |||
184 | anchors { | ||
185 | bottom: timeContainer.bottom | ||
186 | left: timeContainer.right | ||
187 | leftMargin: 12 * Units.dp | ||
188 | } | ||
189 | |||
190 | spacing: 4 * Units.dp | ||
191 | |||
192 | Label { | ||
193 | style: "subheading" | ||
194 | font.weight: Font.DemiBold | ||
195 | color: amPmPicker.isAm ? "white" : "#99ffffff" | ||
196 | text: "AM" | ||
197 | |||
198 | MouseArea { | ||
199 | anchors.fill: parent | ||
200 | onClicked: amPmPicker.isAm = true | ||
201 | } | ||
202 | } | ||
203 | |||
204 | Label { | ||
205 | style: "subheading" | ||
206 | font.weight: Font.DemiBold | ||
207 | color: !amPmPicker.isAm ? "white" : "#99ffffff" | ||
208 | text: "PM" | ||
209 | |||
210 | MouseArea { | ||
211 | anchors.fill: parent | ||
212 | onClicked: amPmPicker.isAm = false | ||
213 | } | ||
214 | } | ||
215 | } | ||
216 | } | ||
217 | |||
218 | Rectangle { | ||
219 | id: picker | ||
220 | width: parent.width | ||
221 | height: width | ||
222 | color: "white" | ||
223 | |||
224 | Rectangle { | ||
225 | id: circle | ||
226 | color: "#eee" | ||
227 | anchors.centerIn: parent | ||
228 | width: parent.width * 0.9 | ||
229 | height: width | ||
230 | radius: width / 2 | ||
231 | |||
232 | Rectangle { | ||
233 | id: centerPoint | ||
234 | anchors.centerIn: parent | ||
235 | color: Theme.accentColor | ||
236 | width: 8 * Units.dp | ||
237 | height: 8 * Units.dp | ||
238 | radius: width / 2 | ||
239 | } | ||
240 | |||
241 | Rectangle { | ||
242 | id: pointer | ||
243 | color: Theme.accentColor | ||
244 | width: 2 * Units.dp | ||
245 | height: circle.height / 2 - clockPadding | ||
246 | y: clockPadding | ||
247 | anchors.horizontalCenter: parent.horizontalCenter | ||
248 | antialiasing: true | ||
249 | transformOrigin: Item.Bottom | ||
250 | |||
251 | Connections { | ||
252 | target: hoursPathView | ||
253 | onCurrentIndexChanged: { | ||
254 | if(isHours) | ||
255 | pointer.setAngle() | ||
256 | } | ||
257 | } | ||
258 | |||
259 | Connections { | ||
260 | target: minutesPathView | ||
261 | onCurrentIndexChanged: { | ||
262 | if(!isHours) | ||
263 | pointer.setAngle() | ||
264 | } | ||
265 | } | ||
266 | |||
267 | Connections { | ||
268 | target: timePicker | ||
269 | onIsHoursChanged: pointer.setAngle() | ||
270 | } | ||
271 | |||
272 | function setAngle() | ||
273 | { | ||
274 | var idx = isHours ? hoursPathView.currentIndex : minutesPathView.currentIndex | ||
275 | var angle | ||
276 | if(isHours) | ||
277 | angle = (360 / ((prefer24Hour) ? 24 : 12)) * idx | ||
278 | else | ||
279 | angle = 360 / 60 * idx | ||
280 | |||
281 | if(Math.abs(pointer.rotation - angle) == 180) | ||
282 | pointerRotation.direction = RotationAnimation.Clockwise | ||
283 | else | ||
284 | pointerRotation.direction = RotationAnimation.Shortest | ||
285 | |||
286 | pointer.rotation = angle | ||
287 | } | ||
288 | |||
289 | Behavior on rotation { | ||
290 | RotationAnimation { | ||
291 | id: pointerRotation | ||
292 | duration: 200 | ||
293 | direction: RotationAnimation.Shortest | ||
294 | } | ||
295 | } | ||
296 | } | ||
297 | |||
298 | Component { | ||
299 | id: pathViewHighlight | ||
300 | Rectangle { | ||
301 | id: highlight | ||
302 | width: 40 * Units.dp | ||
303 | height: 40 * Units.dp | ||
304 | color: Theme.accentColor | ||
305 | radius: width / 2 | ||
306 | } | ||
307 | } | ||
308 | |||
309 | Component { | ||
310 | id: pathViewItem | ||
311 | Rectangle { | ||
312 | id: rectangle | ||
313 | width: !isHours && modelData % 5 == 0 ? 12 * Units.dp : isHours ? 30 * Units.dp : 8 * Units.dp | ||
314 | height: !isHours && modelData % 5 == 0 ? 12 * Units.dp : isHours ? 30 * Units.dp : 8 * Units.dp | ||
315 | color: "transparent" | ||
316 | |||
317 | property bool isSelected: false | ||
318 | |||
319 | Label { | ||
320 | anchors.centerIn: parent | ||
321 | text:{ | ||
322 | var model = isHours ? hoursPathView.model : minutesPathView.model | ||
323 | return model.data < 10 && !isHours ? "0" + modelData : modelData | ||
324 | } | ||
325 | visible: modelData >= 0 && (isHours ? true : modelData % 5 == 0) | ||
326 | style: "subheading" | ||
327 | } | ||
328 | |||
329 | Connections { | ||
330 | target: parentMouseArea | ||
331 | |||
332 | onClicked: { | ||
333 | checkClick(false) | ||
334 | } | ||
335 | |||
336 | onPositionChanged: { | ||
337 | checkClick(true) | ||
338 | } | ||
339 | |||
340 | function checkClick(isPress) | ||
341 | { | ||
342 | if((isPress ? parentMouseArea.leftButtonPressed : true) && rectangle.visible) { | ||
343 | var thisPosition = rectangle.mapToItem(null, 0, 0, width, height) | ||
344 | |||
345 | if(parentMouseArea.globalX > thisPosition.x && | ||
346 | parentMouseArea.globalY > thisPosition.y && | ||
347 | parentMouseArea.globalX < (thisPosition.x + width) && | ||
348 | parentMouseArea.globalY < (thisPosition.y + height)) { | ||
349 | |||
350 | if(!rectangle.isSelected) { | ||
351 | rectangle.isSelected = true | ||
352 | |||
353 | var newDate = new Date(internal.timePicked) // Grab a new date from existing | ||
354 | |||
355 | var time = parseInt(modelData) | ||
356 | if(isHours) { | ||
357 | if(!prefer24Hour && !amPmPicker.isAm && time < 12) { | ||
358 | time += 12 | ||
359 | } | ||
360 | else if(!prefer24Hour && amPmPicker.isAm && time === 12) { | ||
361 | time = 0 | ||
362 | } | ||
363 | |||
364 | newDate.setHours(time) | ||
365 | } else { | ||
366 | newDate.setMinutes(time) | ||
367 | } | ||
368 | |||
369 | internal.timePicked = newDate | ||
370 | } | ||
371 | } | ||
372 | else { | ||
373 | rectangle.isSelected = false | ||
374 | } | ||
375 | } | ||
376 | } | ||
377 | } | ||
378 | } | ||
379 | } | ||
380 | |||
381 | MouseArea { | ||
382 | property bool leftButtonPressed | ||
383 | property int globalX | ||
384 | property int globalY | ||
385 | id: parentMouseArea | ||
386 | anchors.fill: circle | ||
387 | hoverEnabled: true | ||
388 | |||
389 | onClicked: { | ||
390 | globalX = parentMouseArea.mapToItem(null, mouse.x, mouse.y).x | ||
391 | globalY = parentMouseArea.mapToItem(null, mouse.x, mouse.y).y | ||
392 | } | ||
393 | |||
394 | onPositionChanged: { | ||
395 | if(containsPress) | ||
396 | { | ||
397 | leftButtonPressed = true | ||
398 | globalX = parentMouseArea.mapToItem(null, mouse.x, mouse.y).x | ||
399 | globalY = parentMouseArea.mapToItem(null, mouse.x, mouse.y).y | ||
400 | } | ||
401 | else | ||
402 | { | ||
403 | leftButtonPressed = false | ||
404 | } | ||
405 | } | ||
406 | } | ||
407 | |||
408 | |||
409 | PathView { | ||
410 | id: hoursPathView | ||
411 | anchors.fill: parent | ||
412 | visible: isHours | ||
413 | model: { | ||
414 | var limit = prefer24Hour ? 24 : 12 | ||
415 | var zeroBased = prefer24Hour | ||
416 | return getTimeList(limit, zeroBased) | ||
417 | } | ||
418 | highlightRangeMode: PathView.NoHighlightRange | ||
419 | highlightMoveDuration: 200 | ||
420 | |||
421 | onCurrentIndexChanged: { | ||
422 | var newText = currentIndex | ||
423 | if(currentIndex == 0 && !prefer24Hour) | ||
424 | newText = 12 | ||
425 | hoursLabel.text = newText | ||
426 | } | ||
427 | |||
428 | delegate: pathViewItem | ||
429 | |||
430 | interactive: false | ||
431 | highlight: pathViewHighlight | ||
432 | |||
433 | path: Path { | ||
434 | startX: circle.width / 2 | ||
435 | startY: clockPadding | ||
436 | |||
437 | PathArc { | ||
438 | x: circle.width / 2 | ||
439 | y: circle.height - clockPadding | ||
440 | radiusX: circle.width / 2 - clockPadding | ||
441 | radiusY: circle.width / 2 - clockPadding | ||
442 | useLargeArc: false | ||
443 | } | ||
444 | |||
445 | PathArc { | ||
446 | x: circle.width / 2 | ||
447 | y: clockPadding | ||
448 | radiusX: circle.width / 2 - clockPadding | ||
449 | radiusY: circle.width / 2 - clockPadding | ||
450 | useLargeArc: false | ||
451 | } | ||
452 | } | ||
453 | } | ||
454 | |||
455 | PathView { | ||
456 | id: minutesPathView | ||
457 | anchors.fill: parent | ||
458 | visible: !isHours | ||
459 | model: { | ||
460 | return getTimeList(60, true) | ||
461 | } | ||
462 | highlightRangeMode: PathView.NoHighlightRange | ||
463 | highlightMoveDuration: 200 | ||
464 | delegate: pathViewItem | ||
465 | highlight: pathViewHighlight | ||
466 | interactive: false | ||
467 | |||
468 | path: Path { | ||
469 | startX: circle.width / 2 | ||
470 | startY: clockPadding | ||
471 | |||
472 | PathArc { | ||
473 | x: circle.width / 2 | ||
474 | y: circle.height - clockPadding | ||
475 | radiusX: circle.width / 2 - clockPadding | ||
476 | radiusY: circle.width / 2 - clockPadding | ||
477 | useLargeArc: false | ||
478 | } | ||
479 | |||
480 | PathArc { | ||
481 | x: circle.width / 2 | ||
482 | y: clockPadding | ||
483 | radiusX: circle.width / 2 - clockPadding | ||
484 | radiusY: circle.width / 2 - clockPadding | ||
485 | useLargeArc: false | ||
486 | } | ||
487 | } | ||
488 | } | ||
489 | } | ||
490 | } | ||
491 | } | ||
492 | |||
493 | /** | ||
494 | Switches contexts | ||
495 | |||
496 | If previously we hadn't set hours, and we're now switching contexts, disable the auto switch to minutes | ||
497 | */ | ||
498 | function setIsHours(_isHours) { | ||
499 | if(_isHours == isHours) | ||
500 | return | ||
501 | |||
502 | if(!internal.resetFlag) | ||
503 | internal.resetFlag = true | ||
504 | |||
505 | var prevRotation = pointerRotation.duration | ||
506 | pointerRotation.duration = 0 | ||
507 | isHours = _isHours | ||
508 | pointerRotation.duration = prevRotation | ||
509 | } | ||
510 | |||
511 | function getCurrentTime() { | ||
512 | var date = new Date(internal.timePicked) | ||
513 | if(amPmPicker.isAm && date.getHours() > 11) | ||
514 | date.setHours(date.getHours() - 12) | ||
515 | else if(!amPmPicker.isAm && date.getHours() < 11) | ||
516 | date.setHours(date.getHours() + 12) | ||
517 | |||
518 | return date | ||
519 | } | ||
520 | |||
521 | /*! | ||
522 | \internal | ||
523 | Resets the view after closing | ||
524 | */ | ||
525 | function reset() { | ||
526 | isHours = true | ||
527 | internal.resetFlag = false | ||
528 | amPmPicker.isAm = true | ||
529 | internal.timePicked = new Date(Date.now()) | ||
530 | } | ||
531 | |||
532 | /*! | ||
533 | \internal | ||
534 | Provides list of ints for pathview based on the context and user prefs | ||
535 | */ | ||
536 | function getTimeList(limit, isZeroBased) { | ||
537 | var items = [] | ||
538 | if(!isZeroBased) { | ||
539 | items[0] = limit | ||
540 | } | ||
541 | |||
542 | var start = isZeroBased ? 0 : 1 | ||
543 | |||
544 | var jump = limit > 24 ? 1 : 1 | ||
545 | for(var i = start; i < limit; i += jump) { | ||
546 | items[i / jump] = i | ||
547 | } | ||
548 | return items | ||
549 | } | ||
550 | |||
551 | /*! | ||
552 | \internal | ||
553 | */ | ||
554 | function setDigitsPressed(minute) | ||
555 | { | ||
556 | if(__digitsPressed.length > 1) { | ||
557 | __digitsPressed = "" | ||
558 | __digitsPressed = minute | ||
559 | } | ||
560 | else { | ||
561 | __digitsPressed += minute | ||
562 | } | ||
563 | |||
564 | var date = internal.timePicked | ||
565 | var value = parseInt(__digitsPressed) | ||
566 | |||
567 | if((isHours && value > 23) || (!isHours && value > 59)) { | ||
568 | __digitsPressed = "" | ||
569 | return | ||
570 | } | ||
571 | |||
572 | if(isHours) | ||
573 | date.setHours(value) | ||
574 | else | ||
575 | date.setMinutes(value) | ||
576 | |||
577 | internal.timePicked = date | ||
578 | } | ||
579 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/Tooltip.qml b/prototype_2016/third_party/qml-material/src/components/Tooltip.qml deleted file mode 100644 index 8ea259f..0000000 --- a/prototype_2016/third_party/qml-material/src/components/Tooltip.qml +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015 Jordan Neidlinger <jneidlinger@gmail.com> | ||
5 | * 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import Material 0.3 | ||
14 | import Material.Extras 0.1 | ||
15 | |||
16 | /*! | ||
17 | \qmltype Tooltip | ||
18 | \inqmlmodule Material | ||
19 | |||
20 | \brief A tooltip is a label that appears on hover and explains a non-text UI element. | ||
21 | |||
22 | To display a tooltip for your view, simply create an instance of Tooltip, | ||
23 | set the text property to your tooltip text, and then set the mouseArea property | ||
24 | to your MouseArea or Ink that will trigger the tooltip. If you use a MouseArea, | ||
25 | make sure hoverEnabled is set to true. | ||
26 | |||
27 | See the Material Design guidelines for more details: | ||
28 | http://www.google.com/design/spec/components/tooltips.html | ||
29 | */ | ||
30 | Popover { | ||
31 | id: dropdown | ||
32 | |||
33 | property alias text: tooltipLabel.text | ||
34 | |||
35 | property MouseArea mouseArea | ||
36 | |||
37 | overlayLayer: "tooltipOverlayLayer" | ||
38 | globalMouseAreaEnabled: false | ||
39 | |||
40 | width: tooltipLabel.paintedWidth + 32 * Units.dp | ||
41 | implicitHeight: Device.isMobile ? 44 * Units.dp : 40 * Units.dp | ||
42 | |||
43 | backgroundColor: Qt.rgba(0.2, 0.2, 0.2, 0.9) | ||
44 | |||
45 | Timer { | ||
46 | id: timer | ||
47 | |||
48 | interval: 1000 | ||
49 | onTriggered: open(mouseArea, 0, 4 * Units.dp) | ||
50 | } | ||
51 | |||
52 | Connections { | ||
53 | target: mouseArea | ||
54 | |||
55 | onReleased: { | ||
56 | if(showing) | ||
57 | close() | ||
58 | } | ||
59 | |||
60 | onPressAndHold: { | ||
61 | if(text !== "" && !showing) | ||
62 | open(mouseArea, 0, 4 * Units.dp) | ||
63 | } | ||
64 | |||
65 | onEntered: { | ||
66 | if(text !== "" && !showing) | ||
67 | timer.start() | ||
68 | } | ||
69 | |||
70 | onExited: { | ||
71 | timer.stop() | ||
72 | |||
73 | if(showing) | ||
74 | close() | ||
75 | } | ||
76 | } | ||
77 | |||
78 | Label { | ||
79 | id: tooltipLabel | ||
80 | style: "tooltip" | ||
81 | color: Theme.dark.textColor | ||
82 | anchors.centerIn: parent | ||
83 | } | ||
84 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/Wave.qml b/prototype_2016/third_party/qml-material/src/components/Wave.qml deleted file mode 100644 index 3a0afb4..0000000 --- a/prototype_2016/third_party/qml-material/src/components/Wave.qml +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /***** THIS FILE CANNOT BE RELICENSED UNDER THE MPL YET *****/ | ||
2 | |||
3 | /* | ||
4 | * QML Material - An application framework implementing Material Design. | ||
5 | * Copyright (C) 2014 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
6 | * | ||
7 | * This program is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU Lesser General Public License as | ||
9 | * published by the Free Software Foundation, either version 2.1 of the | ||
10 | * License, or (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU Lesser General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU Lesser General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | import QtQuick 2.4 | ||
22 | |||
23 | /*! | ||
24 | \qmltype Wave | ||
25 | \inqmlmodule Material | ||
26 | |||
27 | \brief Provides a wave animation for transitioning between views of content. | ||
28 | */ | ||
29 | Rectangle { | ||
30 | id: wave | ||
31 | |||
32 | property bool opened | ||
33 | property real size | ||
34 | property real initialX | ||
35 | property real initialY | ||
36 | property real abstractWidth: parent.width | ||
37 | property real abstractHeight: parent.height | ||
38 | property real diameter: 2*Math.sqrt(Math.pow(Math.max(initialX, abstractWidth - initialX), 2) + Math.pow(Math.max(initialY, abstractHeight - initialY), 2)) | ||
39 | |||
40 | signal finished(bool opened) | ||
41 | |||
42 | function open(x, y) { | ||
43 | wave.initialX = x; | ||
44 | wave.initialY = y; | ||
45 | wave.opened = true; | ||
46 | } | ||
47 | |||
48 | function close(x, y) { | ||
49 | wave.initialX = x; | ||
50 | wave.initialY = y; | ||
51 | wave.opened = false; | ||
52 | } | ||
53 | |||
54 | width: size | ||
55 | height: size | ||
56 | radius: size/2 | ||
57 | x: initialX - size/2 | ||
58 | y: initialY - size/2 | ||
59 | |||
60 | states: State { | ||
61 | name: "opened" | ||
62 | when: wave.opened | ||
63 | |||
64 | PropertyChanges { | ||
65 | target: wave | ||
66 | size: wave.diameter | ||
67 | } | ||
68 | } | ||
69 | |||
70 | transitions: Transition { | ||
71 | from: "" | ||
72 | to: "opened" | ||
73 | reversible: true | ||
74 | |||
75 | SequentialAnimation { | ||
76 | NumberAnimation { | ||
77 | property: "size" | ||
78 | easing.type: Easing.OutCubic | ||
79 | } | ||
80 | ScriptAction { | ||
81 | script: wave.finished(wave.opened) | ||
82 | } | ||
83 | } | ||
84 | } | ||
85 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/components/components.qrc b/prototype_2016/third_party/qml-material/src/components/components.qrc deleted file mode 100644 index 8d22f1e..0000000 --- a/prototype_2016/third_party/qml-material/src/components/components.qrc +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/Material"> | ||
5 | <file>ActionButton.qml</file> | ||
6 | <file>Card.qml</file> | ||
7 | <file>DatePicker.qml</file> | ||
8 | <file>IconButton.qml</file> | ||
9 | <file>OverlayLayer.qml</file> | ||
10 | <file>OverlayView.qml</file> | ||
11 | <file>ProgressCircle.qml</file> | ||
12 | <file>Scrollbar.qml</file> | ||
13 | <file>Snackbar.qml</file> | ||
14 | <file>ThinDivider.qml</file> | ||
15 | <file>TimePicker.qml</file> | ||
16 | <file>Tooltip.qml</file> | ||
17 | <file>Wave.qml</file> | ||
18 | </qresource> | ||
19 | |||
20 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/Action.qml b/prototype_2016/third_party/qml-material/src/controls/Action.qml deleted file mode 100644 index a8ad35b..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/Action.qml +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | /*! | ||
14 | \qmltype Action | ||
15 | \inqmlmodule Material | ||
16 | |||
17 | \brief Represents an action shown in an action bar, context menu, or list. | ||
18 | |||
19 | One of the most common uses of actions is displaying actions in the action bar of a page | ||
20 | using the \l Page::actions property. See the example for \l Page for more details. | ||
21 | */ | ||
22 | Controls.Action { | ||
23 | id: action | ||
24 | |||
25 | /*! | ||
26 | Set to \c true to display a divider between this action and the next action. Used in lists | ||
27 | or context menus. | ||
28 | */ | ||
29 | property bool hasDividerAfter | ||
30 | |||
31 | /*! | ||
32 | A URL pointing to an image to display as the icon. By default, this is | ||
33 | a special URL representing the icon named by \l iconName from the Material Design | ||
34 | icon collection or FontAwesome. The icon will be colorized using the specificed \l color, | ||
35 | unless you put ".color." in the filename, for example, "app-icon.color.svg". | ||
36 | |||
37 | \sa iconName | ||
38 | \sa Icon | ||
39 | */ | ||
40 | property string iconSource: "icon://" + iconName | ||
41 | |||
42 | /*! | ||
43 | The text displayed for the action. | ||
44 | */ | ||
45 | property string name | ||
46 | |||
47 | /*! | ||
48 | A short summary of the action, which may be displayed depending on the UI showing the | ||
49 | action. For example, a list of actions could display the summary as the secondary line of | ||
50 | text. | ||
51 | */ | ||
52 | property string summary | ||
53 | |||
54 | /*! | ||
55 | Set to \c false to hide the action in the UI. | ||
56 | */ | ||
57 | property bool visible: true | ||
58 | |||
59 | /*! | ||
60 | Set to \c true to rotate the icon 90 degrees on mouseover. | ||
61 | */ | ||
62 | property bool hoverAnimation: false | ||
63 | |||
64 | property alias text: action.name | ||
65 | property alias tooltip: action.summary | ||
66 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/Button.qml b/prototype_2016/third_party/qml-material/src/controls/Button.qml deleted file mode 100644 index 1df4cac..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/Button.qml +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle | ||
14 | import Material 0.3 | ||
15 | |||
16 | /*! | ||
17 | \qmltype Button | ||
18 | \inqmlmodule Material | ||
19 | |||
20 | \brief A push button with a text label. | ||
21 | |||
22 | A button clearly communicates what action will occur when the user touches it. | ||
23 | It consists of text, an image, or both, designed in accordance with your app’s color theme. | ||
24 | |||
25 | There are three standard types of buttons: | ||
26 | |||
27 | \list | ||
28 | \li Floating action button: A circular material button that lifts and displays | ||
29 | an ink reaction on press. | ||
30 | \li Raised button: A typically rectangular material button that lifts and | ||
31 | displays ink reactions on press. | ||
32 | \li Flat button: A button made of ink that displays ink reactions on press but | ||
33 | does not lift. | ||
34 | \endlist | ||
35 | |||
36 | This componenent provides raised and flat buttons. For floating action buttons, | ||
37 | see \l ActionButton. | ||
38 | |||
39 | Here are some example buttons: | ||
40 | |||
41 | \image buttons.png Button examples | ||
42 | |||
43 | See the \l {http://www.google.com/design/spec/components/buttons.html} | ||
44 | {Material Design spec} for details on how to use buttons. | ||
45 | |||
46 | \sa ActionButton | ||
47 | */ | ||
48 | Controls.Button { | ||
49 | id: button | ||
50 | |||
51 | /*! | ||
52 | The background color of the button. By default, this is white for a raised | ||
53 | button and transparent for a flat button. | ||
54 | */ | ||
55 | property color backgroundColor: elevation > 0 ? "white" : "transparent" | ||
56 | |||
57 | /*! | ||
58 | \internal | ||
59 | |||
60 | The context of the button, which is used to control special styling of | ||
61 | buttons in dialogs or snackbars. | ||
62 | */ | ||
63 | property string context: "default" // or "dialog" or "snackbar" | ||
64 | |||
65 | /*! | ||
66 | Set to \c true if the button has a dark background color | ||
67 | */ | ||
68 | property bool darkButton: Theme.isDarkColor(backgroundColor) | ||
69 | |||
70 | /*! | ||
71 | Set to \c true if the button is on a dark background | ||
72 | */ | ||
73 | property bool darkBackground | ||
74 | |||
75 | /*! | ||
76 | The elevation of the button. Normally either \c 0 or \c 1. | ||
77 | */ | ||
78 | property int elevation | ||
79 | |||
80 | /*! | ||
81 | The text color of the button. By default, this is calculated based on the background color, | ||
82 | but it can be customized to the theme's primary color or another color. | ||
83 | */ | ||
84 | property color textColor: button.darkButton ? Theme.dark.textColor : Theme.light.textColor | ||
85 | |||
86 | style: MaterialStyle.ButtonStyle {} | ||
87 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/CheckBox.qml b/prototype_2016/third_party/qml-material/src/controls/CheckBox.qml deleted file mode 100644 index 87a54e9..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/CheckBox.qml +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014 Jordan Neidlinger <JNeidlinger@gmail.com> | ||
5 | * 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Controls 1.3 as Controls | ||
14 | import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle | ||
15 | import Material 0.3 | ||
16 | |||
17 | /*! | ||
18 | \qmltype CheckBox | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief Checkboxes allow the user to select multiple options from a set. | ||
22 | */ | ||
23 | Controls.CheckBox { | ||
24 | id: checkBox | ||
25 | |||
26 | /*! | ||
27 | The checkbox color. By default this is the app's accent color | ||
28 | */ | ||
29 | property color color: darkBackground ? Theme.dark.accentColor : Theme.light.accentColor | ||
30 | |||
31 | /*! | ||
32 | Set to \c true if the checkbox is on a dark background | ||
33 | */ | ||
34 | property bool darkBackground | ||
35 | |||
36 | style: MaterialStyle.CheckBoxStyle {} | ||
37 | |||
38 | Ink { | ||
39 | anchors { | ||
40 | verticalCenter: parent.verticalCenter | ||
41 | left: parent.left | ||
42 | leftMargin: 4 * Units.dp | ||
43 | } | ||
44 | |||
45 | width: 40 * Units.dp | ||
46 | height: 40 * Units.dp | ||
47 | color: checkBox.checked ? Theme.alpha(checkBox.color, 0.20) | ||
48 | : checkBox.darkBackground ? Qt.rgba(1,1,1,0.1) | ||
49 | : Qt.rgba(0,0,0,0.1) | ||
50 | enabled: checkBox.enabled | ||
51 | |||
52 | circular: true | ||
53 | centered: true | ||
54 | |||
55 | onClicked: { | ||
56 | checkBox.checked = !checkBox.checked | ||
57 | checkBox.clicked() | ||
58 | } | ||
59 | } | ||
60 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/Label.qml b/prototype_2016/third_party/qml-material/src/controls/Label.qml deleted file mode 100644 index ad2cc8d..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/Label.qml +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype Label | ||
16 | \inqmlmodule Material | ||
17 | |||
18 | \brief A text label with many different font styles from Material Design. | ||
19 | */ | ||
20 | Text { | ||
21 | id: label | ||
22 | property string style: "body1" | ||
23 | |||
24 | property var fontStyles: { | ||
25 | "display4": { | ||
26 | "size": 112, | ||
27 | "font": "light" | ||
28 | }, | ||
29 | |||
30 | "display3": { | ||
31 | "size": 56, | ||
32 | "font": "regular" | ||
33 | }, | ||
34 | |||
35 | "display2": { | ||
36 | "size": 45, | ||
37 | "font": "regular" | ||
38 | }, | ||
39 | |||
40 | "display1": { | ||
41 | "size": 34, | ||
42 | "font": "regular" | ||
43 | }, | ||
44 | |||
45 | "headline": { | ||
46 | "size": 24, | ||
47 | "font": "regular" | ||
48 | }, | ||
49 | |||
50 | "title": { | ||
51 | "size": 20, | ||
52 | "font": "medium" | ||
53 | }, | ||
54 | |||
55 | "dialog": { | ||
56 | "size": 18, | ||
57 | "size_desktop": 17, | ||
58 | "font": "regular" | ||
59 | }, | ||
60 | |||
61 | "subheading": { | ||
62 | "size": 16, | ||
63 | "size_desktop": 15, | ||
64 | "font": "regular" | ||
65 | }, | ||
66 | |||
67 | "body2": { | ||
68 | "size": 14, | ||
69 | "size_desktop": 13, | ||
70 | "font": "medium" | ||
71 | }, | ||
72 | |||
73 | "body1": { | ||
74 | "size": 14, | ||
75 | "size_desktop": 13, | ||
76 | "font": "regular" | ||
77 | }, | ||
78 | |||
79 | "caption": { | ||
80 | "size": 12, | ||
81 | "font": "regular" | ||
82 | }, | ||
83 | |||
84 | "menu": { | ||
85 | "size": 14, | ||
86 | "size_desktop": 13, | ||
87 | "font": "medium" | ||
88 | }, | ||
89 | |||
90 | "button": { | ||
91 | "size": 14, | ||
92 | "font": "medium" | ||
93 | }, | ||
94 | |||
95 | "tooltip": { | ||
96 | "size_desktop": 13, | ||
97 | "size": 14, | ||
98 | "font": "medium" | ||
99 | } | ||
100 | } | ||
101 | |||
102 | property var fontInfo: fontStyles[style] | ||
103 | |||
104 | font.pixelSize: (!Device.isMobile && fontInfo.size_desktop | ||
105 | ? fontInfo.size_desktop : fontInfo.size) * Units.dp | ||
106 | font.family: "Roboto" | ||
107 | font.weight: { | ||
108 | var weight = fontInfo.font | ||
109 | |||
110 | if (weight === "medium") { | ||
111 | return Font.DemiBold | ||
112 | } else if (weight === "regular") { | ||
113 | return Font.Normal | ||
114 | } else if (weight === "light") { | ||
115 | return Font.Light | ||
116 | } | ||
117 | } | ||
118 | |||
119 | font.capitalization: style == "button" ? Font.AllUppercase : Font.MixedCase | ||
120 | |||
121 | color: Theme.light.textColor | ||
122 | |||
123 | |||
124 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/ProgressBar.qml b/prototype_2016/third_party/qml-material/src/controls/ProgressBar.qml deleted file mode 100644 index 027fed1..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/ProgressBar.qml +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Controls 1.3 as Controls | ||
14 | import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle | ||
15 | import Material 0.3 | ||
16 | |||
17 | /*! | ||
18 | \qmltype ProgressBar | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief Visual indicator of progress in some operation. | ||
22 | */ | ||
23 | |||
24 | Controls.ProgressBar { | ||
25 | /*! | ||
26 | The color for the progress bar. By default this is | ||
27 | the primary color defined in \l Theme::primaryColor | ||
28 | */ | ||
29 | property color color: Theme.primaryColor | ||
30 | |||
31 | width: 200 * Units.dp | ||
32 | height: 4 * Units.dp | ||
33 | |||
34 | style: MaterialStyle.ProgressBarStyle {} | ||
35 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/RadioButton.qml b/prototype_2016/third_party/qml-material/src/controls/RadioButton.qml deleted file mode 100644 index 733f680..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/RadioButton.qml +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2015 Jordan Neidlinger <JNeidlinger@gmail.com> | ||
5 | * 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Controls 1.3 as Controls | ||
14 | import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle | ||
15 | import Material 0.3 | ||
16 | |||
17 | /*! | ||
18 | \qmltype RadioButton | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief Radio buttons allow the user to select one option from a set. | ||
22 | */ | ||
23 | Controls.RadioButton { | ||
24 | id: radioButton | ||
25 | |||
26 | /*! | ||
27 | The switch color. By default this is the app's accent color | ||
28 | */ | ||
29 | property color color: darkBackground ? Theme.dark.accentColor | ||
30 | : Theme.light.accentColor | ||
31 | |||
32 | /*! | ||
33 | Set to \c true if the switch is on a dark background | ||
34 | */ | ||
35 | property bool darkBackground | ||
36 | |||
37 | /*! | ||
38 | Set to \c true if the radio button can be toggled from checked to unchecked | ||
39 | */ | ||
40 | property bool canToggle | ||
41 | |||
42 | style: MaterialStyle.RadioButtonStyle {} | ||
43 | |||
44 | Ink { | ||
45 | id: inkArea | ||
46 | anchors { | ||
47 | verticalCenter: parent.verticalCenter | ||
48 | left: parent.left | ||
49 | leftMargin: 4 * Units.dp | ||
50 | } | ||
51 | |||
52 | width: 40 * Units.dp | ||
53 | height: 40 * Units.dp | ||
54 | color: radioButton.checked ? Theme.alpha(radioButton.color, 0.20) : Qt.rgba(0,0,0,0.1) | ||
55 | |||
56 | onClicked: { | ||
57 | if(radioButton.canToggle || !radioButton.checked) | ||
58 | radioButton.checked = !radioButton.checked | ||
59 | radioButton.clicked() | ||
60 | } | ||
61 | |||
62 | circular: true | ||
63 | centered: true | ||
64 | } | ||
65 | |||
66 | MouseArea { | ||
67 | anchors { | ||
68 | left: inkArea.right | ||
69 | top: parent.top | ||
70 | right: parent.right | ||
71 | bottom: parent.bottom | ||
72 | } | ||
73 | onClicked: { | ||
74 | if(radioButton.canToggle || !radioButton.checked) | ||
75 | radioButton.checked = !radioButton.checked | ||
76 | radioButton.clicked() | ||
77 | } | ||
78 | } | ||
79 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/Slider.qml b/prototype_2016/third_party/qml-material/src/controls/Slider.qml deleted file mode 100644 index 8dfca9c..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/Slider.qml +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014 Jordan Neidlinger <JNeidlinger@gmail.com> | ||
5 | * 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import Material 0.3 | ||
14 | import QtQuick.Controls 1.3 as Controls | ||
15 | import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle | ||
16 | |||
17 | /*! | ||
18 | \qmltype Slider | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief Sliders let users select a value from a continuous or discrete range of | ||
22 | values by moving the slider thumb. | ||
23 | */ | ||
24 | Controls.Slider { | ||
25 | id: slider | ||
26 | |||
27 | /*! | ||
28 | Set to \c true to enable a floating numeric value label above the slider knob | ||
29 | */ | ||
30 | property bool numericValueLabel: false | ||
31 | |||
32 | /*! | ||
33 | Set to \c true to always show the numeric value label, even when not pressed | ||
34 | */ | ||
35 | property bool alwaysShowValueLabel: false | ||
36 | |||
37 | /*! | ||
38 | Set to \c true if the switch is on a dark background | ||
39 | */ | ||
40 | property bool darkBackground | ||
41 | |||
42 | /*! | ||
43 | The label to display within the value label knob, by default the sliders current value | ||
44 | */ | ||
45 | property string knobLabel: slider.value.toFixed(0) | ||
46 | |||
47 | /*! | ||
48 | The diameter of the value label knob | ||
49 | */ | ||
50 | property int knobDiameter: 32 * Units.dp | ||
51 | |||
52 | property color color: darkBackground ? Theme.dark.accentColor | ||
53 | : Theme.light.accentColor | ||
54 | |||
55 | tickmarksEnabled: false | ||
56 | |||
57 | implicitHeight: numericValueLabel ? 54 * Units.dp : 32 * Units.dp | ||
58 | implicitWidth: 200 * Units.dp | ||
59 | |||
60 | style: MaterialStyle.SliderStyle {} | ||
61 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/Switch.qml b/prototype_2016/third_party/qml-material/src/controls/Switch.qml deleted file mode 100644 index 8fd01b2..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/Switch.qml +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import QtQuick.Controls.Styles 1.3 as ControlStyles | ||
14 | |||
15 | import Material 0.3 | ||
16 | |||
17 | /*! | ||
18 | \qmltype Switch | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief On/off switches toggle the state of a single settings option | ||
22 | */ | ||
23 | Controls.Switch { | ||
24 | id: control | ||
25 | |||
26 | /*! | ||
27 | The switch color. By default this is the app's accent color | ||
28 | */ | ||
29 | property color color: darkBackground ? Theme.dark.accentColor | ||
30 | : Theme.light.accentColor | ||
31 | |||
32 | /*! | ||
33 | Set to \c true if the switch is on a dark background | ||
34 | */ | ||
35 | property bool darkBackground | ||
36 | |||
37 | style: ControlStyles.SwitchStyle { | ||
38 | handle: View { | ||
39 | width: 22 * Units.dp | ||
40 | height: 22 * Units.dp | ||
41 | radius: height / 2 | ||
42 | elevation: 2 | ||
43 | backgroundColor: control.enabled ? control.checked ? control.color | ||
44 | : darkBackground ? "#BDBDBD" | ||
45 | : "#FAFAFA" | ||
46 | : darkBackground ? "#424242" | ||
47 | : "#BDBDBD" | ||
48 | } | ||
49 | |||
50 | groove: Item { | ||
51 | width: 40 * Units.dp | ||
52 | height: 22 * Units.dp | ||
53 | |||
54 | Rectangle { | ||
55 | anchors.centerIn: parent | ||
56 | width: parent.width - 2 * Units.dp | ||
57 | height: 16 * Units.dp | ||
58 | radius: height / 2 | ||
59 | color: control.enabled ? control.checked ? Theme.alpha(control.color, 0.5) | ||
60 | : darkBackground ? Qt.rgba(1, 1, 1, 0.26) | ||
61 | : Qt.rgba(0, 0, 0, 0.26) | ||
62 | : darkBackground ? Qt.rgba(1, 1, 1, 0.12) | ||
63 | : Qt.rgba(0, 0, 0, 0.12) | ||
64 | |||
65 | Behavior on color { | ||
66 | ColorAnimation { | ||
67 | duration: 200 | ||
68 | } | ||
69 | } | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/Tab.qml b/prototype_2016/third_party/qml-material/src/controls/Tab.qml deleted file mode 100644 index f01c802..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/Tab.qml +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | |||
14 | /*! | ||
15 | \qmltype Tab | ||
16 | \inqmlmodule Material | ||
17 | |||
18 | \brief Tab represents the content of a tab in a TabView. | ||
19 | |||
20 | This extends the QtQuick.Controls Tab component to add iconName and iconSource properties. | ||
21 | */ | ||
22 | Controls.Tab { | ||
23 | id: tab | ||
24 | |||
25 | /*! | ||
26 | The icon displayed for the action. This can be a Material Design icon or an icon from | ||
27 | FontAwesome. See \l Icon from more details. | ||
28 | */ | ||
29 | property string iconName | ||
30 | |||
31 | /*! | ||
32 | A URL pointing to an image to display as the icon. By default, this is | ||
33 | a special URL representing the icon named by \l iconName from the Material Design | ||
34 | icon collection or FontAwesome. The icon will be colorized using the specificed \l color, | ||
35 | unless you put ".color." in the filename, for example, "app-icon.color.svg". | ||
36 | |||
37 | \sa iconName | ||
38 | \sa Icon | ||
39 | */ | ||
40 | property string iconSource: "icon://" + iconName | ||
41 | |||
42 | /*! | ||
43 | * Controls whether a close button will be shown for this tab. | ||
44 | * | ||
45 | * \since 0.3 | ||
46 | */ | ||
47 | property bool canRemove: false | ||
48 | |||
49 | /*! | ||
50 | * The index of the tab in a TabbedPage. | ||
51 | * | ||
52 | * \since 0.3 | ||
53 | */ | ||
54 | property int index | ||
55 | |||
56 | /*! | ||
57 | * \internal | ||
58 | * This holds the tab view this tab is in. | ||
59 | * | ||
60 | * \since 0.3 | ||
61 | */ | ||
62 | property Item __tabView | ||
63 | |||
64 | /*! | ||
65 | * This signal is emitted when the user tries to close the tab. | ||
66 | * | ||
67 | * This signal includes a close parameter. The close.accepted property is | ||
68 | * true by default so that the tab is allowed to close; but you can | ||
69 | * implement an onClosing handler and set \c{close.accepted = false} if you | ||
70 | * need to do something else before the tab can be closed. | ||
71 | * | ||
72 | * \since 0.3 | ||
73 | */ | ||
74 | signal closing(var close) | ||
75 | |||
76 | /*! | ||
77 | * Close the tab. | ||
78 | * | ||
79 | * When this method is called, or when the user tries to close the tab | ||
80 | * by its tab close button, the closing signal will be emitted. If there | ||
81 | * is no handler, or the handler does not revoke permission to close, the | ||
82 | * tab will subsequently close. | ||
83 | * | ||
84 | * \since 0.3 | ||
85 | */ | ||
86 | function close() { | ||
87 | var event = {accepted: true} | ||
88 | closing(event) | ||
89 | |||
90 | if (event.accepted) { | ||
91 | __tabView.removeTab(index) | ||
92 | } | ||
93 | } | ||
94 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/TextField.qml b/prototype_2016/third_party/qml-material/src/controls/TextField.qml deleted file mode 100644 index 2d0e689..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/TextField.qml +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2014 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
6 | * 2015 Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt> | ||
7 | * | ||
8 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
9 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
11 | */ | ||
12 | |||
13 | import QtQuick 2.4 | ||
14 | import QtQuick.Controls 1.3 as Controls | ||
15 | import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle | ||
16 | import Material 0.3 | ||
17 | |||
18 | /*! | ||
19 | \qmltype TextField | ||
20 | \inqmlmodule Material | ||
21 | |||
22 | \brief A single-line text input control. | ||
23 | */ | ||
24 | Controls.TextField { | ||
25 | |||
26 | property color color: Theme.accentColor | ||
27 | property color errorColor: Palette.colors["red"]["500"] | ||
28 | property string helperText | ||
29 | property bool floatingLabel: false | ||
30 | property bool hasError: characterLimit && length > characterLimit | ||
31 | property int characterLimit | ||
32 | property bool showBorder: true | ||
33 | |||
34 | style: MaterialStyle.TextFieldStyle {} | ||
35 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/controls/controls.qrc b/prototype_2016/third_party/qml-material/src/controls/controls.qrc deleted file mode 100644 index 140f23b..0000000 --- a/prototype_2016/third_party/qml-material/src/controls/controls.qrc +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/Material"> | ||
5 | <file>Action.qml</file> | ||
6 | <file>Button.qml</file> | ||
7 | <file>CheckBox.qml</file> | ||
8 | <file>Label.qml</file> | ||
9 | <file>ProgressBar.qml</file> | ||
10 | <file>RadioButton.qml</file> | ||
11 | <file>Slider.qml</file> | ||
12 | <file>Switch.qml</file> | ||
13 | <file>Tab.qml</file> | ||
14 | <file>TextField.qml</file> | ||
15 | </qresource> | ||
16 | |||
17 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/AwesomeIcon.qml b/prototype_2016/third_party/qml-material/src/core/AwesomeIcon.qml deleted file mode 100644 index 26de884..0000000 --- a/prototype_2016/third_party/qml-material/src/core/AwesomeIcon.qml +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import "awesome.js" as Awesome | ||
14 | |||
15 | /*! | ||
16 | \qmltype AwesomeIcon | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Displays an icon from the FontAwesome icon collection. | ||
20 | |||
21 | Most of the time, this is used indirectly by the \l Icon component, which | ||
22 | is used by action bars, list items, and many other common Material components. | ||
23 | */ | ||
24 | Item { | ||
25 | id: widget | ||
26 | |||
27 | property string name | ||
28 | property bool rotate: widget.name.match(/.*-rotate/) !== null | ||
29 | property bool valid: text.implicitWidth > 0 | ||
30 | |||
31 | property alias color: text.color | ||
32 | property int size: 24 * Units.dp | ||
33 | |||
34 | width: text.width | ||
35 | height: text.height | ||
36 | |||
37 | property bool shadow: false | ||
38 | |||
39 | property var icons: Awesome.map | ||
40 | |||
41 | property alias weight: text.font.weight | ||
42 | |||
43 | FontLoader { id: fontAwesome; source: Qt.resolvedUrl("FontAwesome.otf") } | ||
44 | |||
45 | Text { | ||
46 | id: text | ||
47 | anchors.centerIn: parent | ||
48 | |||
49 | property string name: widget.name.match(/.*-rotate/) !== null ? widget.name.substring(0, widget.name.length - 7) : widget.name | ||
50 | |||
51 | font.family: fontAwesome.name | ||
52 | font.weight: Font.Light | ||
53 | text: widget.icons.hasOwnProperty(name) ? widget.icons[name] : "" | ||
54 | color: Theme.light.iconColor | ||
55 | style: shadow ? Text.Raised : Text.Normal | ||
56 | styleColor: Qt.rgba(0,0,0,0.5) | ||
57 | font.pixelSize: widget.size | ||
58 | |||
59 | Behavior on color { | ||
60 | ColorAnimation { duration: 200 } | ||
61 | } | ||
62 | |||
63 | NumberAnimation on rotation { | ||
64 | running: widget.rotate | ||
65 | from: 0 | ||
66 | to: 360 | ||
67 | loops: Animation.Infinite | ||
68 | duration: 1100 | ||
69 | } | ||
70 | } | ||
71 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/FontAwesome.otf b/prototype_2016/third_party/qml-material/src/core/FontAwesome.otf deleted file mode 100644 index d4de13e..0000000 --- a/prototype_2016/third_party/qml-material/src/core/FontAwesome.otf +++ /dev/null | |||
Binary files differ | |||
diff --git a/prototype_2016/third_party/qml-material/src/core/Icon.qml b/prototype_2016/third_party/qml-material/src/core/Icon.qml deleted file mode 100644 index 1a54d1f..0000000 --- a/prototype_2016/third_party/qml-material/src/core/Icon.qml +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Window 2.2 | ||
14 | import Material 0.3 | ||
15 | import QtGraphicalEffects 1.0 | ||
16 | |||
17 | /*! | ||
18 | \qmltype Icon | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief Displays an icon from the Material Design and FontAwesome icon collections. | ||
22 | */ | ||
23 | Item { | ||
24 | id: icon | ||
25 | |||
26 | property color color: Theme.light.iconColor | ||
27 | property real size: 24 * Units.dp | ||
28 | |||
29 | /*! | ||
30 | The name of the icon to display. | ||
31 | |||
32 | \sa source | ||
33 | */ | ||
34 | property string name | ||
35 | |||
36 | /*! | ||
37 | A URL pointing to an image to display as the icon. By default, this is | ||
38 | a special URL representing the icon named by \l name from the Material Design | ||
39 | icon collection or FontAwesome. The icon will be colorized using the specified \l color, | ||
40 | unless you put ".color." in the filename, for example, "app-icon.color.svg". | ||
41 | |||
42 | \sa name | ||
43 | */ | ||
44 | property string source: name ? "icon://" + name : "" | ||
45 | |||
46 | property bool valid: source.indexOf("icon://awesome/") == 0 | ||
47 | ? awesomeIcon.valid : image.status == Image.Ready | ||
48 | |||
49 | width: size | ||
50 | height: size | ||
51 | |||
52 | property bool colorize: icon.source.indexOf(".color.") === -1 | ||
53 | |||
54 | Image { | ||
55 | id: image | ||
56 | |||
57 | anchors.fill: parent | ||
58 | visible: source != "" && !colorize | ||
59 | |||
60 | source: { | ||
61 | if (icon.source.indexOf("icon://awesome/") == 0) { | ||
62 | return '' | ||
63 | } else if (icon.source.indexOf('icon://') === 0) { | ||
64 | var name = icon.source.substring(7) | ||
65 | |||
66 | if (name) { | ||
67 | if (Theme.iconsRoot.indexOf('qrc') != -1) | ||
68 | return Theme.iconsRoot + '/' + name + '.svg' | ||
69 | else | ||
70 | return Theme.iconsRoot + '/' + name.replace('/', '_') + '.svg' | ||
71 | } else { | ||
72 | return "" | ||
73 | } | ||
74 | } else { | ||
75 | return icon.source | ||
76 | } | ||
77 | } | ||
78 | |||
79 | sourceSize { | ||
80 | width: size * Screen.devicePixelRatio | ||
81 | height: size * Screen.devicePixelRatio | ||
82 | } | ||
83 | } | ||
84 | |||
85 | ColorOverlay { | ||
86 | id: overlay | ||
87 | |||
88 | anchors.fill: parent | ||
89 | source: image | ||
90 | color: Theme.alpha(icon.color, 1) | ||
91 | cached: true | ||
92 | visible: image.source != "" && colorize | ||
93 | opacity: icon.color.a | ||
94 | } | ||
95 | |||
96 | AwesomeIcon { | ||
97 | id: awesomeIcon | ||
98 | |||
99 | anchors.centerIn: parent | ||
100 | size: icon.size * 0.9 | ||
101 | visible: name != "" | ||
102 | color: icon.color | ||
103 | |||
104 | name: { | ||
105 | if (icon.source.indexOf("icon://awesome/") == 0) { | ||
106 | return icon.source.substring(15) | ||
107 | } else { | ||
108 | return '' | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/Ink.qml b/prototype_2016/third_party/qml-material/src/core/Ink.qml deleted file mode 100644 index af73332..0000000 --- a/prototype_2016/third_party/qml-material/src/core/Ink.qml +++ /dev/null | |||
@@ -1,237 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2014 Marcin Baszczewski | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import Material 0.3 | ||
14 | import Material.Extras 0.1 | ||
15 | |||
16 | /*! | ||
17 | \qmltype Ink | ||
18 | \inqmlmodule Material | ||
19 | |||
20 | \brief Represents a ripple ink animation used in buttons and many other components. | ||
21 | */ | ||
22 | MouseArea { | ||
23 | id: view | ||
24 | |||
25 | clip: true | ||
26 | hoverEnabled: Device.hoverEnabled | ||
27 | z: 2 | ||
28 | |||
29 | property int startRadius: circular ? width/10 : width/6 | ||
30 | property int endRadius | ||
31 | |||
32 | property Item lastCircle | ||
33 | property color color: Qt.rgba(0,0,0,0.1) | ||
34 | |||
35 | property bool circular: false | ||
36 | property bool centered: false | ||
37 | |||
38 | property int focusWidth: width - 32 * Units.dp | ||
39 | property bool focused | ||
40 | property color focusColor: "transparent" | ||
41 | |||
42 | property bool showFocus: true | ||
43 | |||
44 | onPressed: { | ||
45 | createTapCircle(mouse.x, mouse.y) | ||
46 | } | ||
47 | |||
48 | onCanceled: { | ||
49 | lastCircle.removeCircle(); | ||
50 | } | ||
51 | |||
52 | onReleased: { | ||
53 | lastCircle.removeCircle(); | ||
54 | } | ||
55 | |||
56 | function createTapCircle(x, y) { | ||
57 | endRadius = centered ? width/2 : radius(x, y) | ||
58 | showFocus = false | ||
59 | |||
60 | lastCircle = tapCircle.createObject(view, { | ||
61 | "circleX": centered ? width/2 : x, | ||
62 | "circleY": centered ? height/2 : y | ||
63 | }); | ||
64 | } | ||
65 | |||
66 | function radius(x, y) { | ||
67 | var dist1 = Math.max(dist(x, y, 0, 0), dist(x, y, width, height)) | ||
68 | var dist2 = Math.max(dist(x, y, width, 0), dist(x, y, 0, height)) | ||
69 | |||
70 | return Math.max(dist1, dist2) | ||
71 | } | ||
72 | |||
73 | function dist(x1, y1, x2, y2) { | ||
74 | var xs = 0; | ||
75 | var ys = 0; | ||
76 | |||
77 | xs = x2 - x1; | ||
78 | xs = xs * xs; | ||
79 | |||
80 | ys = y2 - y1; | ||
81 | ys = ys * ys; | ||
82 | |||
83 | return Math.sqrt( xs + ys ); | ||
84 | } | ||
85 | |||
86 | Rectangle { | ||
87 | id: focusBackground | ||
88 | |||
89 | anchors.fill: parent | ||
90 | |||
91 | color: Theme.isDarkColor(focusColor) && focusColor.a > 0 | ||
92 | ? Qt.rgba(0,0,0,0.2) : Qt.rgba(0,0,0,0.1) | ||
93 | |||
94 | opacity: showFocus && focused ? 1 : 0 | ||
95 | |||
96 | Behavior on opacity { | ||
97 | NumberAnimation { duration: 500; easing.type: Easing.InOutQuad } | ||
98 | } | ||
99 | } | ||
100 | |||
101 | Rectangle { | ||
102 | id: focusCircle | ||
103 | |||
104 | anchors.centerIn: parent | ||
105 | |||
106 | width: focused | ||
107 | ? focusedState ? focusWidth | ||
108 | : Math.min(parent.width - 8 * Units.dp, focusWidth + 12 * Units.dp) | ||
109 | : parent.width/5 | ||
110 | height: width | ||
111 | |||
112 | radius: width/2 | ||
113 | |||
114 | opacity: showFocus && focused ? 1 : 0 | ||
115 | |||
116 | Behavior on opacity { | ||
117 | NumberAnimation { duration: 500; easing.type: Easing.InOutQuad } | ||
118 | } | ||
119 | |||
120 | Behavior on width { | ||
121 | NumberAnimation { duration: focusTimer.interval; } | ||
122 | } | ||
123 | |||
124 | color: focusColor.a === 0 ? Qt.rgba(1,1,1,0.4) : focusColor | ||
125 | |||
126 | property bool focusedState | ||
127 | |||
128 | Timer { | ||
129 | id: focusTimer | ||
130 | running: focused | ||
131 | repeat: true | ||
132 | interval: 800 | ||
133 | |||
134 | onTriggered: focusCircle.focusedState = !focusCircle.focusedState | ||
135 | } | ||
136 | } | ||
137 | |||
138 | Component { | ||
139 | id: tapCircle | ||
140 | |||
141 | Item { | ||
142 | id: circleItem | ||
143 | |||
144 | anchors.fill: parent | ||
145 | |||
146 | property bool done | ||
147 | |||
148 | function removeCircle() { | ||
149 | done = true | ||
150 | |||
151 | if (fillSizeAnimation.running) { | ||
152 | fillOpacityAnimation.stop() | ||
153 | closeAnimation.start() | ||
154 | |||
155 | circleItem.destroy(500); | ||
156 | } else { | ||
157 | showFocus = true | ||
158 | fadeAnimation.start(); | ||
159 | |||
160 | circleItem.destroy(300); | ||
161 | } | ||
162 | } | ||
163 | |||
164 | property real circleX | ||
165 | property real circleY | ||
166 | |||
167 | property bool closed | ||
168 | |||
169 | Item { | ||
170 | id: circleParent | ||
171 | anchors.fill: parent | ||
172 | visible: !circular | ||
173 | |||
174 | Rectangle { | ||
175 | id: circleRectangle | ||
176 | |||
177 | x: circleItem.circleX - radius | ||
178 | y: circleItem.circleY - radius | ||
179 | |||
180 | width: radius * 2 | ||
181 | height: radius * 2 | ||
182 | |||
183 | opacity: 0 | ||
184 | color: view.color | ||
185 | |||
186 | NumberAnimation { | ||
187 | id: fillSizeAnimation | ||
188 | running: true | ||
189 | |||
190 | target: circleRectangle; property: "radius"; duration: 500; | ||
191 | from: startRadius; to: endRadius; easing.type: Easing.InOutQuad | ||
192 | |||
193 | onStopped: { | ||
194 | if (done) | ||
195 | showFocus = true | ||
196 | } | ||
197 | } | ||
198 | |||
199 | NumberAnimation { | ||
200 | id: fillOpacityAnimation | ||
201 | running: true | ||
202 | |||
203 | target: circleRectangle; property: "opacity"; duration: 300; | ||
204 | from: 0; to: 1; easing.type: Easing.InOutQuad | ||
205 | } | ||
206 | |||
207 | NumberAnimation { | ||
208 | id: fadeAnimation | ||
209 | |||
210 | target: circleRectangle; property: "opacity"; duration: 300; | ||
211 | from: 1; to: 0; easing.type: Easing.InOutQuad | ||
212 | } | ||
213 | |||
214 | SequentialAnimation { | ||
215 | id: closeAnimation | ||
216 | |||
217 | NumberAnimation { | ||
218 | target: circleRectangle; property: "opacity"; duration: 250; | ||
219 | to: 1; easing.type: Easing.InOutQuad | ||
220 | } | ||
221 | |||
222 | NumberAnimation { | ||
223 | target: circleRectangle; property: "opacity"; duration: 250; | ||
224 | from: 1; to: 0; easing.type: Easing.InOutQuad | ||
225 | } | ||
226 | } | ||
227 | } | ||
228 | } | ||
229 | |||
230 | CircleMask { | ||
231 | anchors.fill: parent | ||
232 | source: circleParent | ||
233 | visible: circular | ||
234 | } | ||
235 | } | ||
236 | } | ||
237 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/MaterialAnimation.qml b/prototype_2016/third_party/qml-material/src/core/MaterialAnimation.qml deleted file mode 100644 index fda13ff..0000000 --- a/prototype_2016/third_party/qml-material/src/core/MaterialAnimation.qml +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | pragma Singleton | ||
14 | |||
15 | /*! | ||
16 | \qmltype MaterialAnimation | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A singleton with common animation durations. | ||
20 | */ | ||
21 | QtObject { | ||
22 | id: materialAnimation | ||
23 | |||
24 | property int pageTransitionDuration: 250 | ||
25 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/Object.qml b/prototype_2016/third_party/qml-material/src/core/Object.qml deleted file mode 100644 index 995ee5f..0000000 --- a/prototype_2016/third_party/qml-material/src/core/Object.qml +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | /*! | ||
14 | \qmltype Object | ||
15 | \inqmlmodule Material | ||
16 | |||
17 | \brief A base class for non-visual objects. | ||
18 | */ | ||
19 | QtObject { | ||
20 | id: object | ||
21 | default property alias children: object.__childrenFix | ||
22 | property list<QtObject> __childrenFix: [QtObject {}] | ||
23 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/Palette.qml b/prototype_2016/third_party/qml-material/src/core/Palette.qml deleted file mode 100644 index 225bdfd..0000000 --- a/prototype_2016/third_party/qml-material/src/core/Palette.qml +++ /dev/null | |||
@@ -1,322 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | pragma Singleton | ||
14 | |||
15 | /*! | ||
16 | \qmltype Palette | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Provides access to the Material Design color palette. | ||
20 | */ | ||
21 | Object { | ||
22 | property var colors: { | ||
23 | 'red': { | ||
24 | '500': '#F44336', | ||
25 | '50': '#FFEBEE', | ||
26 | '100': '#FFCDD2', | ||
27 | '200': '#EF9A9A', | ||
28 | '300': '#E57373', | ||
29 | '400': '#EF5350', | ||
30 | '600': '#E53935', | ||
31 | '700': '#D32F2F', | ||
32 | '800': '#C62828', | ||
33 | '900': '#B71C1C', | ||
34 | 'A100': '#FF8A80', | ||
35 | 'A200': '#FF5252', | ||
36 | 'A400': '#FF1744', | ||
37 | 'A700': '#D50000' | ||
38 | }, | ||
39 | 'pink': { | ||
40 | '500': '#E91E63', | ||
41 | '50': '#FCE4EC', | ||
42 | '100': '#F8BBD0', | ||
43 | '200': '#F48FB1', | ||
44 | '300': '#F06292', | ||
45 | '400': '#EC407A', | ||
46 | '600': '#D81B60', | ||
47 | '700': '#C2185B', | ||
48 | '800': '#AD1457', | ||
49 | '900': '#880E4F', | ||
50 | 'A100': '#FF80AB', | ||
51 | 'A200': '#FF4081', | ||
52 | 'A400': '#F50057', | ||
53 | 'A700': '#C51162' | ||
54 | }, | ||
55 | 'purple': { | ||
56 | '500': '#9C27B0', | ||
57 | '50': '#F3E5F5', | ||
58 | '100': '#E1BEE7', | ||
59 | '200': '#CE93D8', | ||
60 | '300': '#BA68C8', | ||
61 | '400': '#AB47BC', | ||
62 | '600': '#8E24AA', | ||
63 | '700': '#7B1FA2', | ||
64 | '800': '#6A1B9A', | ||
65 | '900': '#4A148C', | ||
66 | 'A100': '#EA80FC', | ||
67 | 'A200': '#E040FB', | ||
68 | 'A400': '#D500F9', | ||
69 | 'A700': '#AA00FF' | ||
70 | }, | ||
71 | 'deepPurple': { | ||
72 | '500': '#673AB7', | ||
73 | '50': '#EDE7F6', | ||
74 | '100': '#D1C4E9', | ||
75 | '200': '#B39DDB', | ||
76 | '300': '#9575CD', | ||
77 | '400': '#7E57C2', | ||
78 | '600': '#5E35B1', | ||
79 | '700': '#512DA8', | ||
80 | '800': '#4527A0', | ||
81 | '900': '#311B92', | ||
82 | 'A100': '#B388FF', | ||
83 | 'A200': '#7C4DFF', | ||
84 | 'A400': '#651FFF', | ||
85 | 'A700': '#6200EA' | ||
86 | }, | ||
87 | 'indigo': { | ||
88 | '500': '#3F51B5', | ||
89 | '50': '#E8EAF6', | ||
90 | '100': '#C5CAE9', | ||
91 | '200': '#9FA8DA', | ||
92 | '300': '#7986CB', | ||
93 | '400': '#5C6BC0', | ||
94 | '600': '#3949AB', | ||
95 | '700': '#303F9F', | ||
96 | '800': '#283593', | ||
97 | '900': '#1A237E', | ||
98 | 'A100': '#8C9EFF', | ||
99 | 'A200': '#536DFE', | ||
100 | 'A400': '#3D5AFE', | ||
101 | 'A700': '#304FFE' | ||
102 | }, | ||
103 | 'blue': { | ||
104 | '500': '#2196F3', | ||
105 | '50': '#E3F2FD', | ||
106 | '100': '#BBDEFB', | ||
107 | '200': '#90CAF9', | ||
108 | '300': '#64B5F6', | ||
109 | '400': '#42A5F5', | ||
110 | '600': '#1E88E5', | ||
111 | '700': '#1976D2', | ||
112 | '800': '#1565C0', | ||
113 | '900': '#0D47A1', | ||
114 | 'A100': '#82B1FF', | ||
115 | 'A200': '#448AFF', | ||
116 | 'A400': '#2979FF', | ||
117 | 'A700': '#2962FF' | ||
118 | }, | ||
119 | 'lightBlue': { | ||
120 | '500': '#03A9F4', | ||
121 | '50': '#E1F5FE', | ||
122 | '100': '#B3E5FC', | ||
123 | '200': '#81D4FA', | ||
124 | '300': '#4FC3F7', | ||
125 | '400': '#29B6F6', | ||
126 | '600': '#039BE5', | ||
127 | '700': '#0288D1', | ||
128 | '800': '#0277BD', | ||
129 | '900': '#01579B', | ||
130 | 'A100': '#80D8FF', | ||
131 | 'A200': '#40C4FF', | ||
132 | 'A400': '#00B0FF', | ||
133 | 'A700': '#0091EA' | ||
134 | }, | ||
135 | 'cyan': { | ||
136 | '500': '#00BCD4', | ||
137 | '50': '#E0F7FA', | ||
138 | '100': '#B2EBF2', | ||
139 | '200': '#80DEEA', | ||
140 | '300': '#4DD0E1', | ||
141 | '400': '#26C6DA', | ||
142 | '600': '#00ACC1', | ||
143 | '700': '#0097A7', | ||
144 | '800': '#00838F', | ||
145 | '900': '#006064', | ||
146 | 'A100': '#84FFFF', | ||
147 | 'A200': '#18FFFF', | ||
148 | 'A400': '#00E5FF', | ||
149 | 'A700': '#00B8D4' | ||
150 | }, | ||
151 | 'teal': { | ||
152 | '500': '#009688', | ||
153 | '50': '#E0F2F1', | ||
154 | '100': '#B2DFDB', | ||
155 | '200': '#80CBC4', | ||
156 | '300': '#4DB6AC', | ||
157 | '400': '#26A69A', | ||
158 | '600': '#00897B', | ||
159 | '700': '#00796B', | ||
160 | '800': '#00695C', | ||
161 | '900': '#004D40', | ||
162 | 'A100': '#A7FFEB', | ||
163 | 'A200': '#64FFDA', | ||
164 | 'A400': '#1DE9B6', | ||
165 | 'A700': '#00BFA5' | ||
166 | }, | ||
167 | 'green': { | ||
168 | '500': '#4CAF50', | ||
169 | '50': '#E8F5E9', | ||
170 | '100': '#C8E6C9', | ||
171 | '200': '#A5D6A7', | ||
172 | '300': '#81C784', | ||
173 | '400': '#66BB6A', | ||
174 | '600': '#43A047', | ||
175 | '700': '#388E3C', | ||
176 | '800': '#2E7D32', | ||
177 | '900': '#1B5E20', | ||
178 | 'A100': '#B9F6CA', | ||
179 | 'A200': '#69F0AE', | ||
180 | 'A400': '#00E676', | ||
181 | 'A700': '#00C853' | ||
182 | }, | ||
183 | 'lightGreen': { | ||
184 | '500': '#8BC34A', | ||
185 | '50': '#F1F8E9', | ||
186 | '100': '#DCEDC8', | ||
187 | '200': '#C5E1A5', | ||
188 | '300': '#AED581', | ||
189 | '400': '#9CCC65', | ||
190 | '600': '#7CB342', | ||
191 | '700': '#689F38', | ||
192 | '800': '#558B2F', | ||
193 | '900': '#33691E', | ||
194 | 'A100': '#CCFF90', | ||
195 | 'A200': '#B2FF59', | ||
196 | 'A400': '#76FF03', | ||
197 | 'A700': '#64DD17' | ||
198 | }, | ||
199 | 'lime': { | ||
200 | '500': '#CDDC39', | ||
201 | '50': '#F9FBE7', | ||
202 | '100': '#F0F4C3', | ||
203 | '200': '#E6EE9C', | ||
204 | '300': '#DCE775', | ||
205 | '400': '#D4E157', | ||
206 | '600': '#C0CA33', | ||
207 | '700': '#AFB42B', | ||
208 | '800': '#9E9D24', | ||
209 | '900': '#827717', | ||
210 | 'A100': '#F4FF81', | ||
211 | 'A200': '#EEFF41', | ||
212 | 'A400': '#C6FF00', | ||
213 | 'A700': '#AEEA00' | ||
214 | }, | ||
215 | 'yellow': { | ||
216 | '500': '#FFEB3B', | ||
217 | '50': '#FFFDE7', | ||
218 | '100': '#FFF9C4', | ||
219 | '200': '#FFF59D', | ||
220 | '300': '#FFF176', | ||
221 | '400': '#FFEE58', | ||
222 | '600': '#FDD835', | ||
223 | '700': '#FBC02D', | ||
224 | '800': '#F9A825', | ||
225 | '900': '#F57F17', | ||
226 | 'A100': '#FFFF8D', | ||
227 | 'A200': '#FFFF00', | ||
228 | 'A400': '#FFEA00', | ||
229 | 'A700': '#FFD600' | ||
230 | }, | ||
231 | 'amber': { | ||
232 | '500': '#FFC107', | ||
233 | '50': '#FFF8E1', | ||
234 | '100': '#FFECB3', | ||
235 | '200': '#FFE082', | ||
236 | '300': '#FFD54F', | ||
237 | '400': '#FFCA28', | ||
238 | '600': '#FFB300', | ||
239 | '700': '#FFA000', | ||
240 | '800': '#FF8F00', | ||
241 | '900': '#FF6F00', | ||
242 | 'A100': '#FFE57F', | ||
243 | 'A200': '#FFD740', | ||
244 | 'A400': '#FFC400', | ||
245 | 'A700': '#FFAB00' | ||
246 | }, | ||
247 | 'orange': { | ||
248 | '500': '#FF9800', | ||
249 | '50': '#FFF3E0', | ||
250 | '100': '#FFE0B2', | ||
251 | '200': '#FFCC80', | ||
252 | '300': '#FFB74D', | ||
253 | '400': '#FFA726', | ||
254 | '600': '#FB8C00', | ||
255 | '700': '#F57C00', | ||
256 | '800': '#EF6C00', | ||
257 | '900': '#E65100', | ||
258 | 'A100': '#FFD180', | ||
259 | 'A200': '#FFAB40', | ||
260 | 'A400': '#FF9100', | ||
261 | 'A700': '#FF6D00' | ||
262 | }, | ||
263 | 'deepOrange': { | ||
264 | '500': '#FF5722', | ||
265 | '50': '#FBE9E7', | ||
266 | '100': '#FFCCBC', | ||
267 | '200': '#FFAB91', | ||
268 | '300': '#FF8A65', | ||
269 | '400': '#FF7043', | ||
270 | '600': '#F4511E', | ||
271 | '700': '#E64A19', | ||
272 | '800': '#D84315', | ||
273 | '900': '#BF360C', | ||
274 | 'A100': '#FF9E80', | ||
275 | 'A200': '#FF6E40', | ||
276 | 'A400': '#FF3D00', | ||
277 | 'A700': '#DD2C00' | ||
278 | }, | ||
279 | 'grey': { | ||
280 | '500': '#9E9E9E', | ||
281 | '50': '#FAFAFA', | ||
282 | '100': '#F5F5F5', | ||
283 | '200': '#EEEEEE', | ||
284 | '300': '#E0E0E0', | ||
285 | '400': '#BDBDBD', | ||
286 | '600': '#757575', | ||
287 | '700': '#616161', | ||
288 | '800': '#424242', | ||
289 | '900': '#212121' | ||
290 | }, | ||
291 | 'blueGrey': { | ||
292 | '500': '#607D8B', | ||
293 | '50': '#ECEFF1', | ||
294 | '100': '#CFD8DC', | ||
295 | '200': '#B0BEC5', | ||
296 | '300': '#90A4AE', | ||
297 | '400': '#78909C', | ||
298 | '600': '#546E7A', | ||
299 | '700': '#455A64', | ||
300 | '800': '#37474F', | ||
301 | '900': '#263238' | ||
302 | }, | ||
303 | 'brown': { | ||
304 | '500': '#795548', | ||
305 | '50': '#EFEBE9', | ||
306 | '100': '#D7CCC8', | ||
307 | '200': '#BCAAA4', | ||
308 | '300': '#A1887F', | ||
309 | '400': '#8D6E63', | ||
310 | '600': '#6D4C41', | ||
311 | '700': '#5D4037', | ||
312 | '800': '#4E342E', | ||
313 | '900': '#3E2723' | ||
314 | }, | ||
315 | 'black': { | ||
316 | '500': '#000000' | ||
317 | }, | ||
318 | 'white': { | ||
319 | '500': '#FFFFFF' | ||
320 | } | ||
321 | } | ||
322 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/PlatformExtensions.qml b/prototype_2016/third_party/qml-material/src/core/PlatformExtensions.qml deleted file mode 100644 index 8e8f4c1..0000000 --- a/prototype_2016/third_party/qml-material/src/core/PlatformExtensions.qml +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.0 | ||
12 | import Material 0.3 | ||
13 | |||
14 | Object { | ||
15 | id: platform | ||
16 | |||
17 | property var platformExtensions | ||
18 | |||
19 | property color decorationColor: Theme.primaryDarkColor | ||
20 | property var window: null | ||
21 | readonly property real multiplier: platformExtensions ? platformExtensions.multiplier : 1 | ||
22 | |||
23 | onDecorationColorChanged: { | ||
24 | if (platformExtensions && color != "#000000") { | ||
25 | platformExtensions.decorationColor = decorationColor | ||
26 | } | ||
27 | } | ||
28 | |||
29 | onWindowChanged: { | ||
30 | if (platformExtensions) { | ||
31 | platformExtensions.window = window | ||
32 | } | ||
33 | } | ||
34 | |||
35 | Component.onCompleted: { | ||
36 | try { | ||
37 | var code = 'import Papyros.Material 0.1; PlatformExtensions {}' | ||
38 | platformExtensions = Qt.createQmlObject(code, platform, "PapyrosExtensions"); | ||
39 | |||
40 | platformExtensions.window = window | ||
41 | if (decorationColor != "#000000") | ||
42 | platformExtensions.decorationColor = decorationColor | ||
43 | } catch (error) { | ||
44 | // Ignore the error; it only means that the Papyros | ||
45 | // platform extensions are not available | ||
46 | } | ||
47 | } | ||
48 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/Theme.qml b/prototype_2016/third_party/qml-material/src/core/Theme.qml deleted file mode 100644 index c8b2e95..0000000 --- a/prototype_2016/third_party/qml-material/src/core/Theme.qml +++ /dev/null | |||
@@ -1,127 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | pragma Singleton | ||
14 | |||
15 | /*! | ||
16 | \qmltype Theme | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Provides access to standard colors that follow the Material Design specification. | ||
20 | |||
21 | See \l {http://www.google.com/design/spec/style/color.html#color-ui-color-application} for | ||
22 | details about choosing a color scheme for your application. | ||
23 | */ | ||
24 | Object { | ||
25 | id: theme | ||
26 | |||
27 | /*! | ||
28 | The primary color used for the toolbar background unless a page specifies its own color. | ||
29 | This can be customized via the \l ApplicationWindow::theme group property. According to the | ||
30 | Material Design guidelines, this should normally be a 500 color from one of the color | ||
31 | palettes at \l {http://www.google.com/design/spec/style/color.html#color-color-palette}. | ||
32 | */ | ||
33 | property color primaryColor: "#FAFAFA" | ||
34 | |||
35 | /*! | ||
36 | A darker version of the primary color used for the window titlebar (if client-side | ||
37 | decorations are not used), unless a \l Page specifies its own primary and primary dark | ||
38 | colors. This can be customized via the \l ApplicationWindow::theme group property. According | ||
39 | to the Material Design guidelines, this should normally be the 700 color version of your | ||
40 | aplication's primary color, taken from one of the color palettes at | ||
41 | \l {http://www.google.com/design/spec/style/color.html#color-color-palette}. | ||
42 | */ | ||
43 | property color primaryDarkColor: Qt.rgba(0,0,0, 0.54) | ||
44 | |||
45 | /*! | ||
46 | The accent color complements the primary color, and is used for any primary action buttons | ||
47 | along with switches, sliders, and other components that do not specifically set a color. | ||
48 | This can be customized via the \l ApplicationWindow::theme group property. According | ||
49 | to the Material Design guidelines, this should taken from a second color palette that | ||
50 | complements the primary color palette at | ||
51 | \l {http://www.google.com/design/spec/style/color.html#color-color-palette}. | ||
52 | */ | ||
53 | property color accentColor: "#2196F3" | ||
54 | |||
55 | /*! | ||
56 | The default background color for the application. | ||
57 | */ | ||
58 | property color backgroundColor: "#f3f3f3" | ||
59 | |||
60 | /*! | ||
61 | The color of the higlight indicator for selected tabs. By default this is the accent color, | ||
62 | but it can also be white (for a dark primary color/toolbar background). | ||
63 | */ | ||
64 | property color tabHighlightColor: accentColor | ||
65 | |||
66 | /*! | ||
67 | Standard colors specifically meant for light surfaces. This includes text colors along with | ||
68 | a light version of the accent color. | ||
69 | */ | ||
70 | property ThemePalette light: ThemePalette { | ||
71 | light: true | ||
72 | } | ||
73 | |||
74 | /*! | ||
75 | Standard colors specifically meant for dark surfaces. This includes text colors along with | ||
76 | a dark version of the accent color. | ||
77 | */ | ||
78 | property ThemePalette dark: ThemePalette { | ||
79 | light: false | ||
80 | } | ||
81 | |||
82 | property string iconsRoot: "qrc:/icons" | ||
83 | |||
84 | /*! | ||
85 | A utility method for changing the alpha on colors. Returns a new object, and does not modify | ||
86 | the original color at all. | ||
87 | */ | ||
88 | function alpha(color, alpha) { | ||
89 | // Make sure we have a real color object to work with (versus a string like "#ccc") | ||
90 | var realColor = Qt.darker(color, 1) | ||
91 | |||
92 | realColor.a = alpha | ||
93 | |||
94 | return realColor | ||
95 | } | ||
96 | |||
97 | /*! | ||
98 | Select a color depending on whether the background is light or dark. | ||
99 | |||
100 | \c lightColor is the color used on a light background. | ||
101 | |||
102 | \c darkColor is the color used on a dark background. | ||
103 | */ | ||
104 | function lightDark(background, lightColor, darkColor) { | ||
105 | return isDarkColor(background) ? darkColor : lightColor | ||
106 | } | ||
107 | |||
108 | /*! | ||
109 | Returns true if the color is dark and should have light content on top | ||
110 | */ | ||
111 | function isDarkColor(background) { | ||
112 | var temp = Qt.darker(background, 1) | ||
113 | |||
114 | var a = 1 - ( 0.299 * temp.r + 0.587 * temp.g + 0.114 * temp.b); | ||
115 | |||
116 | return temp.a > 0 && a >= 0.3 | ||
117 | } | ||
118 | |||
119 | Component.onCompleted: { | ||
120 | try { | ||
121 | var code = 'import Material.Fonts 0.1; MaterialFontLoader {}' | ||
122 | Qt.createQmlObject(code, theme, "MaterialFontLoader") | ||
123 | } catch (error) { | ||
124 | // Ignore the error; it only means that the fonts were not enabled | ||
125 | } | ||
126 | } | ||
127 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/ThemePalette.qml b/prototype_2016/third_party/qml-material/src/core/ThemePalette.qml deleted file mode 100644 index 1b90e23..0000000 --- a/prototype_2016/third_party/qml-material/src/core/ThemePalette.qml +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | /*! | ||
14 | \qmltype Theme | ||
15 | \inqmlmodule Material | ||
16 | |||
17 | \brief Provides access to standard colors that follow the Material Design specification, but | ||
18 | specifically designed for light or dark surfaces. | ||
19 | |||
20 | See \l {http://www.google.com/design/spec/style/color.html#color-ui-color-application} for | ||
21 | details about choosing a color scheme for your application. | ||
22 | */ | ||
23 | QtObject { | ||
24 | id: palette | ||
25 | |||
26 | property bool light | ||
27 | |||
28 | readonly property color textColor: light ? shade(0.87) : shade(1) | ||
29 | readonly property color subTextColor: light ? shade(0.54) : shade(0.70) | ||
30 | readonly property color iconColor: light ? subTextColor : textColor | ||
31 | readonly property color disabledColor: light ? shade(0.38) : shade(0.50) | ||
32 | readonly property color hintColor: disabledColor | ||
33 | readonly property color dividerColor: shade(0.12) | ||
34 | |||
35 | /*! | ||
36 | A version of the accent color specifically for lighter or darker backgrounds. This is | ||
37 | normally the same as the global \l Theme::accentColor, but for some application's color | ||
38 | schemes, the accent color is too dark or too light and a lighter/darker version is needed | ||
39 | for some surfaces. This can be customized via the \l ApplicationWindow::theme group property. | ||
40 | According to the Material Design guidelines, this should taken from a second color palette | ||
41 | that complements the primary color palette at | ||
42 | \l {http://www.google.com/design/spec/style/color.html#color-color-palette}. | ||
43 | */ | ||
44 | property color accentColor: theme.accentColor | ||
45 | |||
46 | function shade(alpha) { | ||
47 | if (light) { | ||
48 | return Qt.rgba(0,0,0,alpha) | ||
49 | } else { | ||
50 | return Qt.rgba(1,1,1,alpha) | ||
51 | } | ||
52 | } | ||
53 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/UnitsHelper.qml b/prototype_2016/third_party/qml-material/src/core/UnitsHelper.qml deleted file mode 100644 index 3f0b17d..0000000 --- a/prototype_2016/third_party/qml-material/src/core/UnitsHelper.qml +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | /*! | ||
14 | \qmltype Units | ||
15 | \inqmlmodule Material | ||
16 | |||
17 | \brief Provides access to screen-independent Units known as DPs (device-independent pixels). | ||
18 | |||
19 | This singleton provides methods for building a user interface that automatically scales based on | ||
20 | the screen density. Use the \l Units::dp function wherever you need to specify a screen size, | ||
21 | and your app will automatically scale to any screen density. | ||
22 | |||
23 | Here is a short example: | ||
24 | |||
25 | \qml | ||
26 | import QtQuick 2.4 | ||
27 | import Material 0.3 | ||
28 | |||
29 | Rectangle { | ||
30 | width: dp(100) | ||
31 | height: dp(80) | ||
32 | |||
33 | Label { | ||
34 | text:"A" | ||
35 | font.pixelSize: dp(50) | ||
36 | } | ||
37 | } | ||
38 | \endqml | ||
39 | */ | ||
40 | Object { | ||
41 | id: units | ||
42 | |||
43 | /*! | ||
44 | This is the standard function to use for accessing device-independent pixels. You should use | ||
45 | this anywhere you need to refer to distances on the screen. | ||
46 | */ | ||
47 | function dp(number) { | ||
48 | return Math.round(number * dp); | ||
49 | } | ||
50 | |||
51 | function gu(number) { | ||
52 | return dp(number * Device.gridUnit) | ||
53 | } | ||
54 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/View.qml b/prototype_2016/third_party/qml-material/src/core/View.qml deleted file mode 100644 index 6de175b..0000000 --- a/prototype_2016/third_party/qml-material/src/core/View.qml +++ /dev/null | |||
@@ -1,170 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtGraphicalEffects 1.0 | ||
13 | import Material 0.3 | ||
14 | |||
15 | /*! | ||
16 | \qmltype View | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Provides a base view component, with support for Material Design elevation, | ||
20 | background colors, and tinting. | ||
21 | */ | ||
22 | Item { | ||
23 | id: item | ||
24 | width: 100 | ||
25 | height: 62 | ||
26 | |||
27 | property int elevation: 0 | ||
28 | property real radius: 0 | ||
29 | |||
30 | property string style: "default" | ||
31 | |||
32 | property color backgroundColor: elevation > 0 ? "white" : "transparent" | ||
33 | property color tintColor: "transparent" | ||
34 | |||
35 | property alias border: rect.border | ||
36 | |||
37 | property bool fullWidth | ||
38 | property bool fullHeight | ||
39 | |||
40 | property alias clipContent: rect.clip | ||
41 | |||
42 | default property alias data: rect.data | ||
43 | |||
44 | property bool elevationInverted: false | ||
45 | |||
46 | property var topShadow: [ | ||
47 | { | ||
48 | "opacity": 0, | ||
49 | "offset": 0, | ||
50 | "blur": 0 | ||
51 | }, | ||
52 | |||
53 | { | ||
54 | "opacity": 0.12, | ||
55 | "offset": 1 * Units.dp, | ||
56 | "blur": 1.5 * Units.dp | ||
57 | }, | ||
58 | |||
59 | { | ||
60 | "opacity": 0.16, | ||
61 | "offset": 3 * Units.dp, | ||
62 | "blur": 3 * Units.dp | ||
63 | }, | ||
64 | |||
65 | { | ||
66 | "opacity": 0.19, | ||
67 | "offset": 10 * Units.dp, | ||
68 | "blur": 10 * Units.dp | ||
69 | }, | ||
70 | |||
71 | { | ||
72 | "opacity": 0.25, | ||
73 | "offset": 14 * Units.dp, | ||
74 | "blur": 14 * Units.dp | ||
75 | }, | ||
76 | |||
77 | { | ||
78 | "opacity": 0.30, | ||
79 | "offset": 19 * Units.dp, | ||
80 | "blur": 19 * Units.dp | ||
81 | } | ||
82 | ] | ||
83 | |||
84 | property var bottomShadow: [ | ||
85 | { | ||
86 | "opacity": 0, | ||
87 | "offset": 0 * Units.dp, | ||
88 | "blur": 0 * Units.dp | ||
89 | }, | ||
90 | |||
91 | { | ||
92 | "opacity": 0.24, | ||
93 | "offset": 1 * Units.dp, | ||
94 | "blur": 1 * Units.dp | ||
95 | }, | ||
96 | |||
97 | { | ||
98 | "opacity": 0.23, | ||
99 | "offset": 3 * Units.dp, | ||
100 | "blur": 3 * Units.dp | ||
101 | }, | ||
102 | |||
103 | { | ||
104 | "opacity": 0.23, | ||
105 | "offset": 6 * Units.dp, | ||
106 | "blur": 3 * Units.dp | ||
107 | }, | ||
108 | |||
109 | { | ||
110 | "opacity": 0.22, | ||
111 | "offset": 10 * Units.dp, | ||
112 | "blur": 5 * Units.dp | ||
113 | }, | ||
114 | |||
115 | { | ||
116 | "opacity": 0.22, | ||
117 | "offset": 15 * Units.dp, | ||
118 | "blur": 6 * Units.dp | ||
119 | } | ||
120 | ] | ||
121 | |||
122 | RectangularGlow { | ||
123 | property var elevationInfo: bottomShadow[Math.min(elevation, 5)] | ||
124 | property real horizontalShadowOffset: elevationInfo.offset * Math.sin((2 * Math.PI) * (parent.rotation / 360.0)) | ||
125 | property real verticalShadowOffset: elevationInfo.offset * Math.cos((2 * Math.PI) * (parent.rotation / 360.0)) | ||
126 | |||
127 | anchors.centerIn: parent | ||
128 | width: parent.width + (fullWidth ? 10 * Units.dp : 0) | ||
129 | height: parent.height + (fullHeight ? 20 * Units.dp : 0) | ||
130 | anchors.horizontalCenterOffset: horizontalShadowOffset * (elevationInverted ? -1 : 1) | ||
131 | anchors.verticalCenterOffset: verticalShadowOffset * (elevationInverted ? -1 : 1) | ||
132 | glowRadius: elevationInfo.blur | ||
133 | opacity: elevationInfo.opacity | ||
134 | spread: 0.05 | ||
135 | color: "black" | ||
136 | cornerRadius: item.radius + glowRadius * 2.5 | ||
137 | //visible: parent.opacity == 1 | ||
138 | } | ||
139 | |||
140 | RectangularGlow { | ||
141 | property var elevationInfo: topShadow[Math.min(elevation, 5)] | ||
142 | property real horizontalShadowOffset: elevationInfo.offset * Math.sin((2 * Math.PI) * (parent.rotation / 360.0)) | ||
143 | property real verticalShadowOffset: elevationInfo.offset * Math.cos((2 * Math.PI) * (parent.rotation / 360.0)) | ||
144 | |||
145 | anchors.centerIn: parent | ||
146 | width: parent.width + (fullWidth ? 10 * Units.dp : 0) | ||
147 | height: parent.height + (fullHeight ? 20 * Units.dp : 0) | ||
148 | anchors.horizontalCenterOffset: horizontalShadowOffset * (elevationInverted ? -1 : 1) | ||
149 | anchors.verticalCenterOffset: verticalShadowOffset * (elevationInverted ? -1 : 1) | ||
150 | glowRadius: elevationInfo.blur | ||
151 | opacity: elevationInfo.opacity | ||
152 | spread: 0.05 | ||
153 | color: "black" | ||
154 | cornerRadius: item.radius + glowRadius * 2.5 | ||
155 | //visible: parent.opacity == 1 | ||
156 | } | ||
157 | |||
158 | Rectangle { | ||
159 | id: rect | ||
160 | anchors.fill: parent | ||
161 | color: Qt.tint(backgroundColor, tintColor) | ||
162 | radius: item.radius | ||
163 | antialiasing: parent.rotation || radius > 0 ? true : false | ||
164 | clip: true | ||
165 | |||
166 | Behavior on color { | ||
167 | ColorAnimation { duration: 200 } | ||
168 | } | ||
169 | } | ||
170 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/awesome.js b/prototype_2016/third_party/qml-material/src/core/awesome.js deleted file mode 100644 index f53cbe5..0000000 --- a/prototype_2016/third_party/qml-material/src/core/awesome.js +++ /dev/null | |||
@@ -1,722 +0,0 @@ | |||
1 | |||
2 | .pragma library | ||
3 | |||
4 | var map = { | ||
5 | '500px': '\uf26e', | ||
6 | 'adjust': '\uf042', | ||
7 | 'adn': '\uf170', | ||
8 | 'align_center': '\uf037', | ||
9 | 'align_justify': '\uf039', | ||
10 | 'align_left': '\uf036', | ||
11 | 'align_right': '\uf038', | ||
12 | 'amazon': '\uf270', | ||
13 | 'ambulance': '\uf0f9', | ||
14 | 'american_sign_language_interpreting': '\uf2a3', | ||
15 | 'anchor': '\uf13d', | ||
16 | 'android': '\uf17b', | ||
17 | 'angellist': '\uf209', | ||
18 | 'angle_double_down': '\uf103', | ||
19 | 'angle_double_left': '\uf100', | ||
20 | 'angle_double_right': '\uf101', | ||
21 | 'angle_double_up': '\uf102', | ||
22 | 'angle_down': '\uf107', | ||
23 | 'angle_left': '\uf104', | ||
24 | 'angle_right': '\uf105', | ||
25 | 'angle_up': '\uf106', | ||
26 | 'apple': '\uf179', | ||
27 | 'archive': '\uf187', | ||
28 | 'area_chart': '\uf1fe', | ||
29 | 'arrow_circle_down': '\uf0ab', | ||
30 | 'arrow_circle_left': '\uf0a8', | ||
31 | 'arrow_circle_o_down': '\uf01a', | ||
32 | 'arrow_circle_o_left': '\uf190', | ||
33 | 'arrow_circle_o_right': '\uf18e', | ||
34 | 'arrow_circle_o_up': '\uf01b', | ||
35 | 'arrow_circle_right': '\uf0a9', | ||
36 | 'arrow_circle_up': '\uf0aa', | ||
37 | 'arrow_down': '\uf063', | ||
38 | 'arrow_left': '\uf060', | ||
39 | 'arrow_right': '\uf061', | ||
40 | 'arrow_up': '\uf062', | ||
41 | 'arrows': '\uf047', | ||
42 | 'arrows_alt': '\uf0b2', | ||
43 | 'arrows_h': '\uf07e', | ||
44 | 'arrows_v': '\uf07d', | ||
45 | 'asl_interpreting': '\uf2a3', | ||
46 | 'assistive_listening_systems': '\uf2a2', | ||
47 | 'asterisk': '\uf069', | ||
48 | 'at': '\uf1fa', | ||
49 | 'audio_description': '\uf29e', | ||
50 | 'automobile': '\uf1b9', | ||
51 | 'backward': '\uf04a', | ||
52 | 'balance_scale': '\uf24e', | ||
53 | 'ban': '\uf05e', | ||
54 | 'bank': '\uf19c', | ||
55 | 'bar_chart': '\uf080', | ||
56 | 'bar_chart_o': '\uf080', | ||
57 | 'barcode': '\uf02a', | ||
58 | 'bars': '\uf0c9', | ||
59 | 'battery_0': '\uf244', | ||
60 | 'battery_1': '\uf243', | ||
61 | 'battery_2': '\uf242', | ||
62 | 'battery_3': '\uf241', | ||
63 | 'battery_4': '\uf240', | ||
64 | 'battery_empty': '\uf244', | ||
65 | 'battery_full': '\uf240', | ||
66 | 'battery_half': '\uf242', | ||
67 | 'battery_quarter': '\uf243', | ||
68 | 'battery_three_quarters': '\uf241', | ||
69 | 'bed': '\uf236', | ||
70 | 'beer': '\uf0fc', | ||
71 | 'behance': '\uf1b4', | ||
72 | 'behance_square': '\uf1b5', | ||
73 | 'bell': '\uf0f3', | ||
74 | 'bell_o': '\uf0a2', | ||
75 | 'bell_slash': '\uf1f6', | ||
76 | 'bell_slash_o': '\uf1f7', | ||
77 | 'bicycle': '\uf206', | ||
78 | 'binoculars': '\uf1e5', | ||
79 | 'birthday_cake': '\uf1fd', | ||
80 | 'bitbucket': '\uf171', | ||
81 | 'bitbucket_square': '\uf172', | ||
82 | 'bitcoin': '\uf15a', | ||
83 | 'black_tie': '\uf27e', | ||
84 | 'blind': '\uf29d', | ||
85 | 'bluetooth': '\uf293', | ||
86 | 'bluetooth_b': '\uf294', | ||
87 | 'bold': '\uf032', | ||
88 | 'bolt': '\uf0e7', | ||
89 | 'bomb': '\uf1e2', | ||
90 | 'book': '\uf02d', | ||
91 | 'bookmark': '\uf02e', | ||
92 | 'bookmark_o': '\uf097', | ||
93 | 'braille': '\uf2a1', | ||
94 | 'briefcase': '\uf0b1', | ||
95 | 'btc': '\uf15a', | ||
96 | 'bug': '\uf188', | ||
97 | 'building': '\uf1ad', | ||
98 | 'building_o': '\uf0f7', | ||
99 | 'bullhorn': '\uf0a1', | ||
100 | 'bullseye': '\uf140', | ||
101 | 'bus': '\uf207', | ||
102 | 'buysellads': '\uf20d', | ||
103 | 'cab': '\uf1ba', | ||
104 | 'calculator': '\uf1ec', | ||
105 | 'calendar': '\uf073', | ||
106 | 'calendar_check_o': '\uf274', | ||
107 | 'calendar_minus_o': '\uf272', | ||
108 | 'calendar_o': '\uf133', | ||
109 | 'calendar_plus_o': '\uf271', | ||
110 | 'calendar_times_o': '\uf273', | ||
111 | 'camera': '\uf030', | ||
112 | 'camera_retro': '\uf083', | ||
113 | 'car': '\uf1b9', | ||
114 | 'caret_down': '\uf0d7', | ||
115 | 'caret_left': '\uf0d9', | ||
116 | 'caret_right': '\uf0da', | ||
117 | 'caret_square_o_down': '\uf150', | ||
118 | 'caret_square_o_left': '\uf191', | ||
119 | 'caret_square_o_right': '\uf152', | ||
120 | 'caret_square_o_up': '\uf151', | ||
121 | 'caret_up': '\uf0d8', | ||
122 | 'cart_arrow_down': '\uf218', | ||
123 | 'cart_plus': '\uf217', | ||
124 | 'cc': '\uf20a', | ||
125 | 'cc_amex': '\uf1f3', | ||
126 | 'cc_diners_club': '\uf24c', | ||
127 | 'cc_discover': '\uf1f2', | ||
128 | 'cc_jcb': '\uf24b', | ||
129 | 'cc_mastercard': '\uf1f1', | ||
130 | 'cc_paypal': '\uf1f4', | ||
131 | 'cc_stripe': '\uf1f5', | ||
132 | 'cc_visa': '\uf1f0', | ||
133 | 'certificate': '\uf0a3', | ||
134 | 'chain': '\uf0c1', | ||
135 | 'chain_broken': '\uf127', | ||
136 | 'check': '\uf00c', | ||
137 | 'check_circle': '\uf058', | ||
138 | 'check_circle_o': '\uf05d', | ||
139 | 'check_square': '\uf14a', | ||
140 | 'check_square_o': '\uf046', | ||
141 | 'chevron_circle_down': '\uf13a', | ||
142 | 'chevron_circle_left': '\uf137', | ||
143 | 'chevron_circle_right': '\uf138', | ||
144 | 'chevron_circle_up': '\uf139', | ||
145 | 'chevron_down': '\uf078', | ||
146 | 'chevron_left': '\uf053', | ||
147 | 'chevron_right': '\uf054', | ||
148 | 'chevron_up': '\uf077', | ||
149 | 'child': '\uf1ae', | ||
150 | 'chrome': '\uf268', | ||
151 | 'circle': '\uf111', | ||
152 | 'circle_o': '\uf10c', | ||
153 | 'circle_o_notch': '\uf1ce', | ||
154 | 'circle_thin': '\uf1db', | ||
155 | 'clipboard': '\uf0ea', | ||
156 | 'clock_o': '\uf017', | ||
157 | 'clone': '\uf24d', | ||
158 | 'close': '\uf00d', | ||
159 | 'cloud': '\uf0c2', | ||
160 | 'cloud_download': '\uf0ed', | ||
161 | 'cloud_upload': '\uf0ee', | ||
162 | 'cny': '\uf157', | ||
163 | 'code': '\uf121', | ||
164 | 'code_fork': '\uf126', | ||
165 | 'codepen': '\uf1cb', | ||
166 | 'codiepie': '\uf284', | ||
167 | 'coffee': '\uf0f4', | ||
168 | 'cog': '\uf013', | ||
169 | 'cogs': '\uf085', | ||
170 | 'columns': '\uf0db', | ||
171 | 'comment': '\uf075', | ||
172 | 'comment_o': '\uf0e5', | ||
173 | 'commenting': '\uf27a', | ||
174 | 'commenting_o': '\uf27b', | ||
175 | 'comments': '\uf086', | ||
176 | 'comments_o': '\uf0e6', | ||
177 | 'compass': '\uf14e', | ||
178 | 'compress': '\uf066', | ||
179 | 'connectdevelop': '\uf20e', | ||
180 | 'contao': '\uf26d', | ||
181 | 'copy': '\uf0c5', | ||
182 | 'copyright': '\uf1f9', | ||
183 | 'creative_commons': '\uf25e', | ||
184 | 'credit_card': '\uf09d', | ||
185 | 'credit_card_alt': '\uf283', | ||
186 | 'crop': '\uf125', | ||
187 | 'crosshairs': '\uf05b', | ||
188 | 'css3': '\uf13c', | ||
189 | 'cube': '\uf1b2', | ||
190 | 'cubes': '\uf1b3', | ||
191 | 'cut': '\uf0c4', | ||
192 | 'cutlery': '\uf0f5', | ||
193 | 'dashboard': '\uf0e4', | ||
194 | 'dashcube': '\uf210', | ||
195 | 'database': '\uf1c0', | ||
196 | 'deaf': '\uf2a4', | ||
197 | 'deafness': '\uf2a4', | ||
198 | 'dedent': '\uf03b', | ||
199 | 'delicious': '\uf1a5', | ||
200 | 'desktop': '\uf108', | ||
201 | 'deviantart': '\uf1bd', | ||
202 | 'diamond': '\uf219', | ||
203 | 'digg': '\uf1a6', | ||
204 | 'dollar': '\uf155', | ||
205 | 'dot_circle_o': '\uf192', | ||
206 | 'download': '\uf019', | ||
207 | 'dribbble': '\uf17d', | ||
208 | 'dropbox': '\uf16b', | ||
209 | 'drupal': '\uf1a9', | ||
210 | 'edge': '\uf282', | ||
211 | 'edit': '\uf044', | ||
212 | 'eject': '\uf052', | ||
213 | 'ellipsis_h': '\uf141', | ||
214 | 'ellipsis_v': '\uf142', | ||
215 | 'empire': '\uf1d1', | ||
216 | 'envelope': '\uf0e0', | ||
217 | 'envelope_o': '\uf003', | ||
218 | 'envelope_square': '\uf199', | ||
219 | 'envira': '\uf299', | ||
220 | 'eraser': '\uf12d', | ||
221 | 'eur': '\uf153', | ||
222 | 'euro': '\uf153', | ||
223 | 'exchange': '\uf0ec', | ||
224 | 'exclamation': '\uf12a', | ||
225 | 'exclamation_circle': '\uf06a', | ||
226 | 'exclamation_triangle': '\uf071', | ||
227 | 'expand': '\uf065', | ||
228 | 'expeditedssl': '\uf23e', | ||
229 | 'external_link': '\uf08e', | ||
230 | 'external_link_square': '\uf14c', | ||
231 | 'eye': '\uf06e', | ||
232 | 'eye_slash': '\uf070', | ||
233 | 'eyedropper': '\uf1fb', | ||
234 | 'fa': '\uf2b4', | ||
235 | 'facebook': '\uf09a', | ||
236 | 'facebook_f': '\uf09a', | ||
237 | 'facebook_official': '\uf230', | ||
238 | 'facebook_square': '\uf082', | ||
239 | 'fast_backward': '\uf049', | ||
240 | 'fast_forward': '\uf050', | ||
241 | 'fax': '\uf1ac', | ||
242 | 'feed': '\uf09e', | ||
243 | 'female': '\uf182', | ||
244 | 'fighter_jet': '\uf0fb', | ||
245 | 'file': '\uf15b', | ||
246 | 'file_archive_o': '\uf1c6', | ||
247 | 'file_audio_o': '\uf1c7', | ||
248 | 'file_code_o': '\uf1c9', | ||
249 | 'file_excel_o': '\uf1c3', | ||
250 | 'file_image_o': '\uf1c5', | ||
251 | 'file_movie_o': '\uf1c8', | ||
252 | 'file_o': '\uf016', | ||
253 | 'file_pdf_o': '\uf1c1', | ||
254 | 'file_photo_o': '\uf1c5', | ||
255 | 'file_picture_o': '\uf1c5', | ||
256 | 'file_powerpoint_o': '\uf1c4', | ||
257 | 'file_sound_o': '\uf1c7', | ||
258 | 'file_text': '\uf15c', | ||
259 | 'file_text_o': '\uf0f6', | ||
260 | 'file_video_o': '\uf1c8', | ||
261 | 'file_word_o': '\uf1c2', | ||
262 | 'file_zip_o': '\uf1c6', | ||
263 | 'files_o': '\uf0c5', | ||
264 | 'film': '\uf008', | ||
265 | 'filter': '\uf0b0', | ||
266 | 'fire': '\uf06d', | ||
267 | 'fire_extinguisher': '\uf134', | ||
268 | 'firefox': '\uf269', | ||
269 | 'first_order': '\uf2b0', | ||
270 | 'flag': '\uf024', | ||
271 | 'flag_checkered': '\uf11e', | ||
272 | 'flag_o': '\uf11d', | ||
273 | 'flash': '\uf0e7', | ||
274 | 'flask': '\uf0c3', | ||
275 | 'flickr': '\uf16e', | ||
276 | 'floppy_o': '\uf0c7', | ||
277 | 'folder': '\uf07b', | ||
278 | 'folder_o': '\uf114', | ||
279 | 'folder_open': '\uf07c', | ||
280 | 'folder_open_o': '\uf115', | ||
281 | 'font': '\uf031', | ||
282 | 'font_awesome': '\uf2b4', | ||
283 | 'fonticons': '\uf280', | ||
284 | 'fort_awesome': '\uf286', | ||
285 | 'forumbee': '\uf211', | ||
286 | 'forward': '\uf04e', | ||
287 | 'foursquare': '\uf180', | ||
288 | 'frown_o': '\uf119', | ||
289 | 'futbol_o': '\uf1e3', | ||
290 | 'gamepad': '\uf11b', | ||
291 | 'gavel': '\uf0e3', | ||
292 | 'gbp': '\uf154', | ||
293 | 'ge': '\uf1d1', | ||
294 | 'gear': '\uf013', | ||
295 | 'gears': '\uf085', | ||
296 | 'get_pocket': '\uf265', | ||
297 | 'gg': '\uf260', | ||
298 | 'gg_circle': '\uf261', | ||
299 | 'gift': '\uf06b', | ||
300 | 'git': '\uf1d3', | ||
301 | 'git_square': '\uf1d2', | ||
302 | 'github': '\uf09b', | ||
303 | 'github_alt': '\uf113', | ||
304 | 'github_square': '\uf092', | ||
305 | 'gitlab': '\uf296', | ||
306 | 'gittip': '\uf184', | ||
307 | 'glass': '\uf000', | ||
308 | 'glide': '\uf2a5', | ||
309 | 'glide_g': '\uf2a6', | ||
310 | 'globe': '\uf0ac', | ||
311 | 'google': '\uf1a0', | ||
312 | 'google_plus': '\uf0d5', | ||
313 | 'google_plus_circle': '\uf2b3', | ||
314 | 'google_plus_official': '\uf2b3', | ||
315 | 'google_plus_square': '\uf0d4', | ||
316 | 'google_wallet': '\uf1ee', | ||
317 | 'graduation_cap': '\uf19d', | ||
318 | 'gratipay': '\uf184', | ||
319 | 'group': '\uf0c0', | ||
320 | 'h_square': '\uf0fd', | ||
321 | 'hacker_news': '\uf1d4', | ||
322 | 'hand_grab_o': '\uf255', | ||
323 | 'hand_lizard_o': '\uf258', | ||
324 | 'hand_o_down': '\uf0a7', | ||
325 | 'hand_o_left': '\uf0a5', | ||
326 | 'hand_o_right': '\uf0a4', | ||
327 | 'hand_o_up': '\uf0a6', | ||
328 | 'hand_paper_o': '\uf256', | ||
329 | 'hand_peace_o': '\uf25b', | ||
330 | 'hand_pointer_o': '\uf25a', | ||
331 | 'hand_rock_o': '\uf255', | ||
332 | 'hand_scissors_o': '\uf257', | ||
333 | 'hand_spock_o': '\uf259', | ||
334 | 'hand_stop_o': '\uf256', | ||
335 | 'hard_of_hearing': '\uf2a4', | ||
336 | 'hashtag': '\uf292', | ||
337 | 'hdd_o': '\uf0a0', | ||
338 | 'header': '\uf1dc', | ||
339 | 'headphones': '\uf025', | ||
340 | 'heart': '\uf004', | ||
341 | 'heart_o': '\uf08a', | ||
342 | 'heartbeat': '\uf21e', | ||
343 | 'history': '\uf1da', | ||
344 | 'home': '\uf015', | ||
345 | 'hospital_o': '\uf0f8', | ||
346 | 'hotel': '\uf236', | ||
347 | 'hourglass': '\uf254', | ||
348 | 'hourglass_1': '\uf251', | ||
349 | 'hourglass_2': '\uf252', | ||
350 | 'hourglass_3': '\uf253', | ||
351 | 'hourglass_end': '\uf253', | ||
352 | 'hourglass_half': '\uf252', | ||
353 | 'hourglass_o': '\uf250', | ||
354 | 'hourglass_start': '\uf251', | ||
355 | 'houzz': '\uf27c', | ||
356 | 'html5': '\uf13b', | ||
357 | 'i_cursor': '\uf246', | ||
358 | 'ils': '\uf20b', | ||
359 | 'image': '\uf03e', | ||
360 | 'inbox': '\uf01c', | ||
361 | 'indent': '\uf03c', | ||
362 | 'industry': '\uf275', | ||
363 | 'info': '\uf129', | ||
364 | 'info_circle': '\uf05a', | ||
365 | 'inr': '\uf156', | ||
366 | 'instagram': '\uf16d', | ||
367 | 'institution': '\uf19c', | ||
368 | 'internet_explorer': '\uf26b', | ||
369 | 'ioxhost': '\uf208', | ||
370 | 'italic': '\uf033', | ||
371 | 'joomla': '\uf1aa', | ||
372 | 'jpy': '\uf157', | ||
373 | 'jsfiddle': '\uf1cc', | ||
374 | 'key': '\uf084', | ||
375 | 'keyboard_o': '\uf11c', | ||
376 | 'krw': '\uf159', | ||
377 | 'language': '\uf1ab', | ||
378 | 'laptop': '\uf109', | ||
379 | 'lastfm': '\uf202', | ||
380 | 'lastfm_square': '\uf203', | ||
381 | 'leaf': '\uf06c', | ||
382 | 'leanpub': '\uf212', | ||
383 | 'legal': '\uf0e3', | ||
384 | 'lemon_o': '\uf094', | ||
385 | 'level_down': '\uf149', | ||
386 | 'level_up': '\uf148', | ||
387 | 'life_bouy': '\uf1cd', | ||
388 | 'life_buoy': '\uf1cd', | ||
389 | 'life_ring': '\uf1cd', | ||
390 | 'life_saver': '\uf1cd', | ||
391 | 'lightbulb_o': '\uf0eb', | ||
392 | 'line_chart': '\uf201', | ||
393 | 'link': '\uf0c1', | ||
394 | 'linkedin': '\uf0e1', | ||
395 | 'linkedin_square': '\uf08c', | ||
396 | 'linux': '\uf17c', | ||
397 | 'list': '\uf03a', | ||
398 | 'list_alt': '\uf022', | ||
399 | 'list_ol': '\uf0cb', | ||
400 | 'list_ul': '\uf0ca', | ||
401 | 'location_arrow': '\uf124', | ||
402 | 'lock': '\uf023', | ||
403 | 'long_arrow_down': '\uf175', | ||
404 | 'long_arrow_left': '\uf177', | ||
405 | 'long_arrow_right': '\uf178', | ||
406 | 'long_arrow_up': '\uf176', | ||
407 | 'low_vision': '\uf2a8', | ||
408 | 'magic': '\uf0d0', | ||
409 | 'magnet': '\uf076', | ||
410 | 'mail_forward': '\uf064', | ||
411 | 'mail_reply': '\uf112', | ||
412 | 'mail_reply_all': '\uf122', | ||
413 | 'male': '\uf183', | ||
414 | 'map': '\uf279', | ||
415 | 'map_marker': '\uf041', | ||
416 | 'map_o': '\uf278', | ||
417 | 'map_pin': '\uf276', | ||
418 | 'map_signs': '\uf277', | ||
419 | 'maxcdn': '\uf136', | ||
420 | 'meanpath': '\uf20c', | ||
421 | 'medium': '\uf23a', | ||
422 | 'medkit': '\uf0fa', | ||
423 | 'meh_o': '\uf11a', | ||
424 | 'microphone': '\uf130', | ||
425 | 'microphone_slash': '\uf131', | ||
426 | 'minus': '\uf068', | ||
427 | 'minus_circle': '\uf056', | ||
428 | 'minus_square': '\uf146', | ||
429 | 'minus_square_o': '\uf147', | ||
430 | 'mixcloud': '\uf289', | ||
431 | 'mobile': '\uf10b', | ||
432 | 'mobile_phone': '\uf10b', | ||
433 | 'modx': '\uf285', | ||
434 | 'money': '\uf0d6', | ||
435 | 'moon_o': '\uf186', | ||
436 | 'mortar_board': '\uf19d', | ||
437 | 'motorcycle': '\uf21c', | ||
438 | 'mouse_pointer': '\uf245', | ||
439 | 'music': '\uf001', | ||
440 | 'navicon': '\uf0c9', | ||
441 | 'newspaper_o': '\uf1ea', | ||
442 | 'object_group': '\uf247', | ||
443 | 'object_ungroup': '\uf248', | ||
444 | 'odnoklassniki': '\uf263', | ||
445 | 'odnoklassniki_square': '\uf264', | ||
446 | 'opencart': '\uf23d', | ||
447 | 'openid': '\uf19b', | ||
448 | 'opera': '\uf26a', | ||
449 | 'optin_monster': '\uf23c', | ||
450 | 'outdent': '\uf03b', | ||
451 | 'pagelines': '\uf18c', | ||
452 | 'paint_brush': '\uf1fc', | ||
453 | 'paper_plane': '\uf1d8', | ||
454 | 'paper_plane_o': '\uf1d9', | ||
455 | 'paperclip': '\uf0c6', | ||
456 | 'paragraph': '\uf1dd', | ||
457 | 'paste': '\uf0ea', | ||
458 | 'pause': '\uf04c', | ||
459 | 'pause_circle': '\uf28b', | ||
460 | 'pause_circle_o': '\uf28c', | ||
461 | 'paw': '\uf1b0', | ||
462 | 'paypal': '\uf1ed', | ||
463 | 'pencil': '\uf040', | ||
464 | 'pencil_square': '\uf14b', | ||
465 | 'pencil_square_o': '\uf044', | ||
466 | 'percent': '\uf295', | ||
467 | 'phone': '\uf095', | ||
468 | 'phone_square': '\uf098', | ||
469 | 'photo': '\uf03e', | ||
470 | 'picture_o': '\uf03e', | ||
471 | 'pie_chart': '\uf200', | ||
472 | 'pied_piper': '\uf2ae', | ||
473 | 'pied_piper_alt': '\uf1a8', | ||
474 | 'pied_piper_pp': '\uf1a7', | ||
475 | 'pinterest': '\uf0d2', | ||
476 | 'pinterest_p': '\uf231', | ||
477 | 'pinterest_square': '\uf0d3', | ||
478 | 'plane': '\uf072', | ||
479 | 'play': '\uf04b', | ||
480 | 'play_circle': '\uf144', | ||
481 | 'play_circle_o': '\uf01d', | ||
482 | 'plug': '\uf1e6', | ||
483 | 'plus': '\uf067', | ||
484 | 'plus_circle': '\uf055', | ||
485 | 'plus_square': '\uf0fe', | ||
486 | 'plus_square_o': '\uf196', | ||
487 | 'power_off': '\uf011', | ||
488 | 'print': '\uf02f', | ||
489 | 'product_hunt': '\uf288', | ||
490 | 'puzzle_piece': '\uf12e', | ||
491 | 'qq': '\uf1d6', | ||
492 | 'qrcode': '\uf029', | ||
493 | 'question': '\uf128', | ||
494 | 'question_circle': '\uf059', | ||
495 | 'question_circle_o': '\uf29c', | ||
496 | 'quote_left': '\uf10d', | ||
497 | 'quote_right': '\uf10e', | ||
498 | 'ra': '\uf1d0', | ||
499 | 'random': '\uf074', | ||
500 | 'rebel': '\uf1d0', | ||
501 | 'recycle': '\uf1b8', | ||
502 | 'reddit': '\uf1a1', | ||
503 | 'reddit_alien': '\uf281', | ||
504 | 'reddit_square': '\uf1a2', | ||
505 | 'refresh': '\uf021', | ||
506 | 'registered': '\uf25d', | ||
507 | 'remove': '\uf00d', | ||
508 | 'renren': '\uf18b', | ||
509 | 'reorder': '\uf0c9', | ||
510 | 'repeat': '\uf01e', | ||
511 | 'reply': '\uf112', | ||
512 | 'reply_all': '\uf122', | ||
513 | 'resistance': '\uf1d0', | ||
514 | 'retweet': '\uf079', | ||
515 | 'rmb': '\uf157', | ||
516 | 'road': '\uf018', | ||
517 | 'rocket': '\uf135', | ||
518 | 'rotate_left': '\uf0e2', | ||
519 | 'rotate_right': '\uf01e', | ||
520 | 'rouble': '\uf158', | ||
521 | 'rss': '\uf09e', | ||
522 | 'rss_square': '\uf143', | ||
523 | 'rub': '\uf158', | ||
524 | 'ruble': '\uf158', | ||
525 | 'rupee': '\uf156', | ||
526 | 'safari': '\uf267', | ||
527 | 'save': '\uf0c7', | ||
528 | 'scissors': '\uf0c4', | ||
529 | 'scribd': '\uf28a', | ||
530 | 'search': '\uf002', | ||
531 | 'search_minus': '\uf010', | ||
532 | 'search_plus': '\uf00e', | ||
533 | 'sellsy': '\uf213', | ||
534 | 'send': '\uf1d8', | ||
535 | 'send_o': '\uf1d9', | ||
536 | 'server': '\uf233', | ||
537 | 'share': '\uf064', | ||
538 | 'share_alt': '\uf1e0', | ||
539 | 'share_alt_square': '\uf1e1', | ||
540 | 'share_square': '\uf14d', | ||
541 | 'share_square_o': '\uf045', | ||
542 | 'shekel': '\uf20b', | ||
543 | 'sheqel': '\uf20b', | ||
544 | 'shield': '\uf132', | ||
545 | 'ship': '\uf21a', | ||
546 | 'shirtsinbulk': '\uf214', | ||
547 | 'shopping_bag': '\uf290', | ||
548 | 'shopping_basket': '\uf291', | ||
549 | 'shopping_cart': '\uf07a', | ||
550 | 'sign_in': '\uf090', | ||
551 | 'sign_language': '\uf2a7', | ||
552 | 'sign_out': '\uf08b', | ||
553 | 'signal': '\uf012', | ||
554 | 'signing': '\uf2a7', | ||
555 | 'simplybuilt': '\uf215', | ||
556 | 'sitemap': '\uf0e8', | ||
557 | 'skyatlas': '\uf216', | ||
558 | 'skype': '\uf17e', | ||
559 | 'slack': '\uf198', | ||
560 | 'sliders': '\uf1de', | ||
561 | 'slideshare': '\uf1e7', | ||
562 | 'smile_o': '\uf118', | ||
563 | 'snapchat': '\uf2ab', | ||
564 | 'snapchat_ghost': '\uf2ac', | ||
565 | 'snapchat_square': '\uf2ad', | ||
566 | 'soccer_ball_o': '\uf1e3', | ||
567 | 'sort': '\uf0dc', | ||
568 | 'sort_alpha_asc': '\uf15d', | ||
569 | 'sort_alpha_desc': '\uf15e', | ||
570 | 'sort_amount_asc': '\uf160', | ||
571 | 'sort_amount_desc': '\uf161', | ||
572 | 'sort_asc': '\uf0de', | ||
573 | 'sort_desc': '\uf0dd', | ||
574 | 'sort_down': '\uf0dd', | ||
575 | 'sort_numeric_asc': '\uf162', | ||
576 | 'sort_numeric_desc': '\uf163', | ||
577 | 'sort_up': '\uf0de', | ||
578 | 'soundcloud': '\uf1be', | ||
579 | 'space_shuttle': '\uf197', | ||
580 | 'spinner': '\uf110', | ||
581 | 'spoon': '\uf1b1', | ||
582 | 'spotify': '\uf1bc', | ||
583 | 'square': '\uf0c8', | ||
584 | 'square_o': '\uf096', | ||
585 | 'stack_exchange': '\uf18d', | ||
586 | 'stack_overflow': '\uf16c', | ||
587 | 'star': '\uf005', | ||
588 | 'star_half': '\uf089', | ||
589 | 'star_half_empty': '\uf123', | ||
590 | 'star_half_full': '\uf123', | ||
591 | 'star_half_o': '\uf123', | ||
592 | 'star_o': '\uf006', | ||
593 | 'steam': '\uf1b6', | ||
594 | 'steam_square': '\uf1b7', | ||
595 | 'step_backward': '\uf048', | ||
596 | 'step_forward': '\uf051', | ||
597 | 'stethoscope': '\uf0f1', | ||
598 | 'sticky_note': '\uf249', | ||
599 | 'sticky_note_o': '\uf24a', | ||
600 | 'stop': '\uf04d', | ||
601 | 'stop_circle': '\uf28d', | ||
602 | 'stop_circle_o': '\uf28e', | ||
603 | 'street_view': '\uf21d', | ||
604 | 'strikethrough': '\uf0cc', | ||
605 | 'stumbleupon': '\uf1a4', | ||
606 | 'stumbleupon_circle': '\uf1a3', | ||
607 | 'subscript': '\uf12c', | ||
608 | 'subway': '\uf239', | ||
609 | 'suitcase': '\uf0f2', | ||
610 | 'sun_o': '\uf185', | ||
611 | 'superscript': '\uf12b', | ||
612 | 'support': '\uf1cd', | ||
613 | 'table': '\uf0ce', | ||
614 | 'tablet': '\uf10a', | ||
615 | 'tachometer': '\uf0e4', | ||
616 | 'tag': '\uf02b', | ||
617 | 'tags': '\uf02c', | ||
618 | 'tasks': '\uf0ae', | ||
619 | 'taxi': '\uf1ba', | ||
620 | 'television': '\uf26c', | ||
621 | 'tencent_weibo': '\uf1d5', | ||
622 | 'terminal': '\uf120', | ||
623 | 'text_height': '\uf034', | ||
624 | 'text_width': '\uf035', | ||
625 | 'th': '\uf00a', | ||
626 | 'th_large': '\uf009', | ||
627 | 'th_list': '\uf00b', | ||
628 | 'themeisle': '\uf2b2', | ||
629 | 'thumb_tack': '\uf08d', | ||
630 | 'thumbs_down': '\uf165', | ||
631 | 'thumbs_o_down': '\uf088', | ||
632 | 'thumbs_o_up': '\uf087', | ||
633 | 'thumbs_up': '\uf164', | ||
634 | 'ticket': '\uf145', | ||
635 | 'times': '\uf00d', | ||
636 | 'times_circle': '\uf057', | ||
637 | 'times_circle_o': '\uf05c', | ||
638 | 'tint': '\uf043', | ||
639 | 'toggle_down': '\uf150', | ||
640 | 'toggle_left': '\uf191', | ||
641 | 'toggle_off': '\uf204', | ||
642 | 'toggle_on': '\uf205', | ||
643 | 'toggle_right': '\uf152', | ||
644 | 'toggle_up': '\uf151', | ||
645 | 'trademark': '\uf25c', | ||
646 | 'train': '\uf238', | ||
647 | 'trash': '\uf1f8', | ||
648 | 'trash_o': '\uf014', | ||
649 | 'tree': '\uf1bb', | ||
650 | 'trello': '\uf181', | ||
651 | 'tripadvisor': '\uf262', | ||
652 | 'trophy': '\uf091', | ||
653 | 'truck': '\uf0d1', | ||
654 | 'try': '\uf195', | ||
655 | 'tty': '\uf1e4', | ||
656 | 'tumblr': '\uf173', | ||
657 | 'tumblr_square': '\uf174', | ||
658 | 'turkish_lira': '\uf195', | ||
659 | 'tv': '\uf26c', | ||
660 | 'twitch': '\uf1e8', | ||
661 | 'twitter': '\uf099', | ||
662 | 'twitter_square': '\uf081', | ||
663 | 'umbrella': '\uf0e9', | ||
664 | 'underline': '\uf0cd', | ||
665 | 'undo': '\uf0e2', | ||
666 | 'universal_access': '\uf29a', | ||
667 | 'university': '\uf19c', | ||
668 | 'unlink': '\uf127', | ||
669 | 'unlock': '\uf09c', | ||
670 | 'unlock_alt': '\uf13e', | ||
671 | 'unsorted': '\uf0dc', | ||
672 | 'upload': '\uf093', | ||
673 | 'usb': '\uf287', | ||
674 | 'usd': '\uf155', | ||
675 | 'user': '\uf007', | ||
676 | 'user_md': '\uf0f0', | ||
677 | 'user_plus': '\uf234', | ||
678 | 'user_secret': '\uf21b', | ||
679 | 'user_times': '\uf235', | ||
680 | 'users': '\uf0c0', | ||
681 | 'viacoin': '\uf237', | ||
682 | 'viadeo': '\uf2a9', | ||
683 | 'viadeo_square': '\uf2aa', | ||
684 | 'video_camera': '\uf03d', | ||
685 | 'vimeo': '\uf27d', | ||
686 | 'vimeo_square': '\uf194', | ||
687 | 'vine': '\uf1ca', | ||
688 | 'vk': '\uf189', | ||
689 | 'volume_control_phone': '\uf2a0', | ||
690 | 'volume_down': '\uf027', | ||
691 | 'volume_off': '\uf026', | ||
692 | 'volume_up': '\uf028', | ||
693 | 'warning': '\uf071', | ||
694 | 'wechat': '\uf1d7', | ||
695 | 'weibo': '\uf18a', | ||
696 | 'weixin': '\uf1d7', | ||
697 | 'whatsapp': '\uf232', | ||
698 | 'wheelchair': '\uf193', | ||
699 | 'wheelchair_alt': '\uf29b', | ||
700 | 'wifi': '\uf1eb', | ||
701 | 'wikipedia_w': '\uf266', | ||
702 | 'windows': '\uf17a', | ||
703 | 'won': '\uf159', | ||
704 | 'wordpress': '\uf19a', | ||
705 | 'wpbeginner': '\uf297', | ||
706 | 'wpforms': '\uf298', | ||
707 | 'wrench': '\uf0ad', | ||
708 | 'xing': '\uf168', | ||
709 | 'xing_square': '\uf169', | ||
710 | 'y_combinator': '\uf23b', | ||
711 | 'y_combinator_square': '\uf1d4', | ||
712 | 'yahoo': '\uf19e', | ||
713 | 'yc': '\uf23b', | ||
714 | 'yc_square': '\uf1d4', | ||
715 | 'yelp': '\uf1e9', | ||
716 | 'yen': '\uf157', | ||
717 | 'yoast': '\uf2b1', | ||
718 | 'youtube': '\uf167', | ||
719 | 'youtube_play': '\uf16a', | ||
720 | 'youtube_square': '\uf166', | ||
721 | |||
722 | }; | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/core.qrc b/prototype_2016/third_party/qml-material/src/core/core.qrc deleted file mode 100644 index 56a5854..0000000 --- a/prototype_2016/third_party/qml-material/src/core/core.qrc +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/Material"> | ||
5 | <file>AwesomeIcon.qml</file> | ||
6 | <file>FontAwesome.otf</file> | ||
7 | <file>Icon.qml</file> | ||
8 | <file>Ink.qml</file> | ||
9 | <file>MaterialAnimation.qml</file> | ||
10 | <file>Object.qml</file> | ||
11 | <file>Palette.qml</file> | ||
12 | <file>PlatformExtensions.qml</file> | ||
13 | <file>Theme.qml</file> | ||
14 | <file>ThemePalette.qml</file> | ||
15 | <file>UnitsHelper.qml</file> | ||
16 | <file>View.qml</file> | ||
17 | <file>awesome.js</file> | ||
18 | <file>utils.js</file> | ||
19 | </qresource> | ||
20 | |||
21 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/device.cpp b/prototype_2016/third_party/qml-material/src/core/device.cpp deleted file mode 100644 index 7ca842c..0000000 --- a/prototype_2016/third_party/qml-material/src/core/device.cpp +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | #include "device.h" | ||
12 | |||
13 | Device::Device(QObject *parent) | ||
14 | : QObject(parent) | ||
15 | { | ||
16 | QGuiApplication *app = (QGuiApplication *) QGuiApplication::instance(); | ||
17 | m_screen = app->primaryScreen(); | ||
18 | |||
19 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
20 | connect(app, &QGuiApplication::primaryScreenChanged, | ||
21 | this, &Device::screenChanged); | ||
22 | #endif | ||
23 | } | ||
24 | |||
25 | QObject *Device::qmlSingleton(QQmlEngine *engine, QJSEngine *scriptEngine) | ||
26 | { | ||
27 | Q_UNUSED(engine) | ||
28 | Q_UNUSED(scriptEngine) | ||
29 | |||
30 | return new Device(); | ||
31 | } | ||
32 | |||
33 | Device::FormFactor Device::formFactor() const | ||
34 | { | ||
35 | float diagonal = calculateDiagonal(); | ||
36 | |||
37 | if (diagonal >= 3.5 && diagonal < 5) { //iPhone 1st generation to phablet | ||
38 | return Device::Phone; | ||
39 | } else if (diagonal >= 5 && diagonal < 6.5) { | ||
40 | return Device::Phablet; | ||
41 | } else if (diagonal >= 6.5 && diagonal < 10.1) { | ||
42 | return Device::Tablet; | ||
43 | } else if (diagonal >= 10.1 && diagonal < 29) { | ||
44 | return Device::Computer; | ||
45 | } else if (diagonal >= 29 && diagonal < 92) { | ||
46 | return Device::TV; | ||
47 | } else { | ||
48 | return Device::Unknown; | ||
49 | } | ||
50 | } | ||
51 | |||
52 | QString Device::name() const | ||
53 | { | ||
54 | switch (formFactor()) { | ||
55 | case Phone: | ||
56 | return tr("phone"); | ||
57 | case Phablet: | ||
58 | return tr("phablet"); | ||
59 | case Tablet: | ||
60 | return tr("tablet"); | ||
61 | case Computer: | ||
62 | return tr("computer"); | ||
63 | case TV: | ||
64 | return tr("TV"); | ||
65 | case Unknown: | ||
66 | return tr("device"); | ||
67 | default: | ||
68 | return tr("unknown"); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | QString Device::iconName() const | ||
73 | { | ||
74 | switch (formFactor()) { | ||
75 | case Phone: | ||
76 | return "hardware/smartphone"; | ||
77 | case Phablet: | ||
78 | return "hardware/tablet"; | ||
79 | case Tablet: | ||
80 | return "hardware/tablet"; | ||
81 | case Computer: | ||
82 | return "hardware/desktop_windows"; | ||
83 | case TV: | ||
84 | return "hardware/tv"; | ||
85 | case Unknown: | ||
86 | default: | ||
87 | return "hardware/computer"; | ||
88 | } | ||
89 | } | ||
90 | |||
91 | bool Device::isPortrait() const | ||
92 | { | ||
93 | return m_screen->physicalSize().height() > m_screen->physicalSize().width(); | ||
94 | } | ||
95 | |||
96 | bool Device::hasTouchScreen() const | ||
97 | { | ||
98 | // QTBUG-36007 | ||
99 | #if defined(Q_OS_ANDROID) | ||
100 | return true; | ||
101 | #else | ||
102 | const auto devices = QTouchDevice::devices(); | ||
103 | foreach(const QTouchDevice *dev, devices) { | ||
104 | if (dev->type() == QTouchDevice::TouchScreen) | ||
105 | return true; | ||
106 | } | ||
107 | return false; | ||
108 | #endif | ||
109 | } | ||
110 | |||
111 | bool Device::isMobile() const | ||
112 | { | ||
113 | #if defined(Q_OS_IOS) || defined(Q_OS_ANDROID) || defined(Q_OS_BLACKBERRY) || defined(Q_OS_QNX) || defined(Q_OS_WINRT) | ||
114 | return true; | ||
115 | #else | ||
116 | if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE")) { | ||
117 | return true; | ||
118 | } | ||
119 | return false; | ||
120 | #endif | ||
121 | } | ||
122 | |||
123 | bool Device::hoverEnabled() const | ||
124 | { | ||
125 | return !isMobile() || !hasTouchScreen(); | ||
126 | } | ||
127 | |||
128 | int Device::gridUnit() const | ||
129 | { | ||
130 | Device::FormFactor formFactor = this->formFactor(); | ||
131 | |||
132 | if (formFactor == Device::Phone || formFactor == Device::Phablet) { | ||
133 | return isPortrait() ? 56 : 48; | ||
134 | } else if (formFactor == Device::Tablet) { | ||
135 | return 64; | ||
136 | } else { | ||
137 | return hasTouchScreen() ? 64 : 48; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | void Device::screenChanged() | ||
142 | { | ||
143 | if (m_screen) | ||
144 | m_screen->disconnect(this); | ||
145 | |||
146 | QGuiApplication *app = (QGuiApplication *) QGuiApplication::instance(); | ||
147 | m_screen = app->primaryScreen(); | ||
148 | |||
149 | connect(m_screen, &QScreen::geometryChanged, this, &Device::geometryChanged); | ||
150 | |||
151 | emit geometryChanged(); | ||
152 | } | ||
153 | |||
154 | float Device::calculateDiagonal() const | ||
155 | { | ||
156 | return sqrt(pow((m_screen->physicalSize().width()), 2) + | ||
157 | pow((m_screen->physicalSize().height()), 2)) * 0.039370; | ||
158 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/device.h b/prototype_2016/third_party/qml-material/src/core/device.h deleted file mode 100644 index 682de79..0000000 --- a/prototype_2016/third_party/qml-material/src/core/device.h +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | #ifndef DEVICE_H | ||
12 | #define DEVICE_H | ||
13 | |||
14 | #include <QObject> | ||
15 | |||
16 | #include <cmath> | ||
17 | #include <QQmlEngine> | ||
18 | #include <QGuiApplication> | ||
19 | #include <QScreen> | ||
20 | #include <QTouchDevice> | ||
21 | |||
22 | class Device : public QObject { | ||
23 | Q_OBJECT | ||
24 | |||
25 | Q_PROPERTY(FormFactor formFactor READ formFactor NOTIFY geometryChanged) | ||
26 | Q_PROPERTY(QString name READ name NOTIFY geometryChanged) | ||
27 | Q_PROPERTY(QString iconName READ iconName NOTIFY geometryChanged) | ||
28 | |||
29 | Q_PROPERTY(bool isPortrait READ isPortrait NOTIFY geometryChanged) | ||
30 | Q_PROPERTY(bool isMobile READ isMobile CONSTANT) | ||
31 | Q_PROPERTY(bool hasTouchScreen READ hasTouchScreen CONSTANT) | ||
32 | Q_PROPERTY(bool hoverEnabled READ hoverEnabled CONSTANT) | ||
33 | |||
34 | Q_PROPERTY(int gridUnit READ gridUnit NOTIFY geometryChanged) | ||
35 | |||
36 | public: | ||
37 | enum FormFactor { | ||
38 | Phone, | ||
39 | Phablet, | ||
40 | Tablet, | ||
41 | Computer, | ||
42 | TV, | ||
43 | Unknown | ||
44 | }; | ||
45 | Q_ENUM(FormFactor) | ||
46 | |||
47 | Device(QObject *parent = nullptr); | ||
48 | |||
49 | static QObject *qmlSingleton(QQmlEngine *engine, QJSEngine *scriptEngine); | ||
50 | |||
51 | FormFactor formFactor() const; | ||
52 | QString name() const; | ||
53 | QString iconName() const; | ||
54 | |||
55 | bool isPortrait() const; | ||
56 | bool hasTouchScreen() const; | ||
57 | bool isMobile() const; | ||
58 | bool hoverEnabled() const; | ||
59 | |||
60 | int gridUnit() const; | ||
61 | int dpMultiplier() const; | ||
62 | |||
63 | signals: | ||
64 | void geometryChanged(); | ||
65 | |||
66 | private slots: | ||
67 | void screenChanged(); | ||
68 | |||
69 | private: | ||
70 | float calculateDiagonal() const; | ||
71 | |||
72 | QScreen *m_screen; | ||
73 | }; | ||
74 | |||
75 | #endif // DEVICE_H | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/units.cpp b/prototype_2016/third_party/qml-material/src/core/units.cpp deleted file mode 100644 index 60d135c..0000000 --- a/prototype_2016/third_party/qml-material/src/core/units.cpp +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | #include "units.h" | ||
12 | |||
13 | #include <QGuiApplication> | ||
14 | #include <QQuickItem> | ||
15 | |||
16 | #if defined(Q_OS_ANDROID) | ||
17 | #include <QtAndroidExtras> | ||
18 | #endif | ||
19 | |||
20 | #define DEFAULT_DPI 72 | ||
21 | |||
22 | UnitsAttached::UnitsAttached(QObject *attachee) | ||
23 | : QObject(attachee), m_screen(nullptr), m_window(nullptr), m_dpi(0), m_multiplier(1) | ||
24 | { | ||
25 | m_attachee = qobject_cast<QQuickItem *>(attachee); | ||
26 | |||
27 | if (m_attachee) { | ||
28 | if (m_attachee->window()) // It might not be assigned to a window yet | ||
29 | windowChanged(m_attachee->window()); | ||
30 | } else { | ||
31 | QQuickWindow *window = qobject_cast<QQuickWindow *>(attachee); | ||
32 | if (window) | ||
33 | windowChanged(window); | ||
34 | } | ||
35 | |||
36 | if (!m_screen) | ||
37 | screenChanged(QGuiApplication::primaryScreen()); | ||
38 | } | ||
39 | |||
40 | void UnitsAttached::windowChanged(QQuickWindow *window) | ||
41 | { | ||
42 | if (m_window) | ||
43 | disconnect(m_window, &QQuickWindow::screenChanged, this, &UnitsAttached::screenChanged); | ||
44 | |||
45 | m_window = window; | ||
46 | screenChanged(window ? window->screen() : nullptr); | ||
47 | |||
48 | if (window) | ||
49 | connect(window, &QQuickWindow::screenChanged, this, &UnitsAttached::screenChanged); | ||
50 | } | ||
51 | |||
52 | void UnitsAttached::screenChanged(QScreen *screen) | ||
53 | { | ||
54 | if (screen != m_screen) { | ||
55 | QScreen *oldScreen = m_screen; | ||
56 | m_screen = screen; | ||
57 | |||
58 | if (oldScreen) | ||
59 | oldScreen->disconnect(this); | ||
60 | |||
61 | if (oldScreen == nullptr || screen == nullptr || | ||
62 | screen->physicalDotsPerInch() != oldScreen->physicalDotsPerInch() || | ||
63 | screen->logicalDotsPerInch() != oldScreen->logicalDotsPerInch() || | ||
64 | screen->devicePixelRatio() != oldScreen->devicePixelRatio()) { | ||
65 | updateDPI(); | ||
66 | emit dpChanged(); | ||
67 | } | ||
68 | } | ||
69 | } | ||
70 | |||
71 | int UnitsAttached::dp() const | ||
72 | { | ||
73 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) | ||
74 | return m_multiplier; | ||
75 | #else | ||
76 | auto dp = dpi() / 160; | ||
77 | |||
78 | return dp > 0 ? dp * m_multiplier : m_multiplier; | ||
79 | #endif | ||
80 | } | ||
81 | |||
82 | int UnitsAttached::dpi() const { return m_dpi; } | ||
83 | |||
84 | qreal UnitsAttached::multiplier() const { return m_multiplier; } | ||
85 | |||
86 | void UnitsAttached::setMultiplier(qreal multiplier) | ||
87 | { | ||
88 | if (m_multiplier != multiplier) { | ||
89 | m_multiplier = multiplier; | ||
90 | emit multiplierChanged(); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | void UnitsAttached::updateDPI() | ||
95 | { | ||
96 | if (m_screen == nullptr) { | ||
97 | m_dpi = DEFAULT_DPI; | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | #if defined(Q_OS_IOS) | ||
102 | // iOS integration of scaling (retina, non-retina, 4K) does itself. | ||
103 | m_dpi = m_screen->physicalDotsPerInch(); | ||
104 | #elif defined(Q_OS_ANDROID) | ||
105 | // https://bugreports.qt-project.org/browse/QTBUG-35701 | ||
106 | // recalculate dpi for Android | ||
107 | |||
108 | QAndroidJniEnvironment env; | ||
109 | QAndroidJniObject activity = QtAndroid::androidActivity(); | ||
110 | QAndroidJniObject resources = | ||
111 | activity.callObjectMethod("getResources", "()Landroid/content/res/Resources;"); | ||
112 | if (env->ExceptionCheck()) { | ||
113 | env->ExceptionDescribe(); | ||
114 | env->ExceptionClear(); | ||
115 | |||
116 | m_dpi = DEFAULT_DPI; | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | QAndroidJniObject displayMetrics = | ||
121 | resources.callObjectMethod("getDisplayMetrics", "()Landroid/util/DisplayMetrics;"); | ||
122 | if (env->ExceptionCheck()) { | ||
123 | env->ExceptionDescribe(); | ||
124 | env->ExceptionClear(); | ||
125 | |||
126 | m_dpi = DEFAULT_DPI; | ||
127 | return; | ||
128 | } | ||
129 | m_dpi = displayMetrics.getField<int>("densityDpi"); | ||
130 | m_multiplier = displayMetrics.getField<float>("density"); | ||
131 | #else | ||
132 | // standard dpi | ||
133 | m_dpi = m_screen->logicalDotsPerInch() * m_screen->devicePixelRatio(); | ||
134 | #endif | ||
135 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/units.h b/prototype_2016/third_party/qml-material/src/core/units.h deleted file mode 100644 index 374626a..0000000 --- a/prototype_2016/third_party/qml-material/src/core/units.h +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | #ifndef UNITS_H | ||
12 | #define UNITS_H | ||
13 | |||
14 | #include <QObject> | ||
15 | |||
16 | #include <QScreen> | ||
17 | #include <QQuickWindow> | ||
18 | #include <QPointer> | ||
19 | |||
20 | class UnitsAttached : public QObject | ||
21 | { | ||
22 | Q_OBJECT | ||
23 | |||
24 | Q_PROPERTY(int dp READ dp NOTIFY dpChanged) | ||
25 | Q_PROPERTY(qreal multiplier READ multiplier WRITE setMultiplier NOTIFY multiplierChanged) | ||
26 | |||
27 | public: | ||
28 | UnitsAttached(QObject *attachee); | ||
29 | |||
30 | int dp() const; | ||
31 | int dpi() const; | ||
32 | qreal multiplier() const; | ||
33 | |||
34 | public slots: | ||
35 | void setMultiplier(qreal multiplier); | ||
36 | |||
37 | signals: | ||
38 | void dpChanged(); | ||
39 | void multiplierChanged(); | ||
40 | |||
41 | protected slots: | ||
42 | void screenChanged(QScreen *); | ||
43 | |||
44 | private: | ||
45 | void updateDPI(); | ||
46 | void windowChanged(QQuickWindow *); | ||
47 | |||
48 | QPointer<QScreen> m_screen; | ||
49 | QQuickWindow *m_window; | ||
50 | QQuickItem *m_attachee; | ||
51 | |||
52 | int m_dpi; | ||
53 | qreal m_multiplier; | ||
54 | }; | ||
55 | |||
56 | class Units : public QObject | ||
57 | { | ||
58 | Q_OBJECT | ||
59 | |||
60 | public: | ||
61 | static UnitsAttached *qmlAttachedProperties(QObject *object) | ||
62 | { | ||
63 | return new UnitsAttached(object); | ||
64 | } | ||
65 | }; | ||
66 | |||
67 | QML_DECLARE_TYPEINFO(Units, QML_HAS_ATTACHED_PROPERTIES) | ||
68 | |||
69 | #endif // UNITS_H | ||
diff --git a/prototype_2016/third_party/qml-material/src/core/utils.js b/prototype_2016/third_party/qml-material/src/core/utils.js deleted file mode 100644 index b6ea137..0000000 --- a/prototype_2016/third_party/qml-material/src/core/utils.js +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | function findRoot(obj) { | ||
12 | while (obj.parent) { | ||
13 | obj = obj.parent; | ||
14 | } | ||
15 | |||
16 | return obj; | ||
17 | } | ||
18 | |||
19 | function findRootChild(obj, objectName) { | ||
20 | obj = findRoot(obj); | ||
21 | |||
22 | var childs = new Array(0); | ||
23 | childs.push(obj); | ||
24 | while (childs.length > 0) { | ||
25 | if (childs[0].objectName == objectName) { | ||
26 | return childs[0]; | ||
27 | } | ||
28 | for (var i in childs[0].data) { | ||
29 | childs.push(childs[0].data[i]); | ||
30 | } | ||
31 | childs.splice(0, 1); | ||
32 | } | ||
33 | return null; | ||
34 | } | ||
35 | |||
36 | function findChild(obj,objectName) { | ||
37 | var childs = new Array(0); | ||
38 | childs.push(obj); | ||
39 | while (childs.length > 0) { | ||
40 | if (childs[0].objectName == objectName) { | ||
41 | return childs[0]; | ||
42 | } | ||
43 | for (var i in childs[0].data) { | ||
44 | childs.push(childs[0].data[i]); | ||
45 | } | ||
46 | childs.splice(0, 1); | ||
47 | } | ||
48 | return null; | ||
49 | } | ||
50 | |||
51 | function newObject(path, args, parent) { | ||
52 | if (!args) | ||
53 | args = {}; | ||
54 | |||
55 | args.parent = parent; | ||
56 | |||
57 | var component = Qt.createComponent(path); | ||
58 | if (component.status === QtQuick.Component.Error) { | ||
59 | // Error Handling | ||
60 | print("Unable to load object: " + path + "\n" + component.errorString()); | ||
61 | return null; | ||
62 | } | ||
63 | |||
64 | return component.createObject(parent, args); | ||
65 | } | ||
66 | |||
67 | function filter(list, filter) { | ||
68 | var filtered = []; | ||
69 | |||
70 | forEach(list, function(item) { | ||
71 | if (filter(item)) | ||
72 | filtered.push(item) | ||
73 | }) | ||
74 | |||
75 | return filtered; | ||
76 | } | ||
77 | |||
78 | function forEach(list, callback) { | ||
79 | for (var i = 0; i < length(list); i++) { | ||
80 | var item = getItem(list, i) | ||
81 | callback(item) | ||
82 | } | ||
83 | } | ||
84 | |||
85 | function getItem(model, index) { | ||
86 | var item = model.get ? model.get(index) : model[index] | ||
87 | |||
88 | if (model.get && item.modelData) | ||
89 | item = item.modelData | ||
90 | |||
91 | return item | ||
92 | } | ||
93 | |||
94 | function length(model) { | ||
95 | if (model === undefined || model === null) | ||
96 | return 0 | ||
97 | else | ||
98 | return model.count ? model.count : model.length | ||
99 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/extras/AutomaticGrid.qml b/prototype_2016/third_party/qml-material/src/extras/AutomaticGrid.qml deleted file mode 100644 index 8bfc939..0000000 --- a/prototype_2016/third_party/qml-material/src/extras/AutomaticGrid.qml +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
5 | * 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | |||
14 | Grid { | ||
15 | id: grid | ||
16 | |||
17 | default property alias delegate: repeater.delegate | ||
18 | property real cellWidth | ||
19 | property real cellHeight | ||
20 | property alias model: repeater.model | ||
21 | property real widthOverride: parent.width | ||
22 | property real heightOverride: parent.height | ||
23 | property real minColumnSpacing | ||
24 | |||
25 | |||
26 | columns: { | ||
27 | var flooredResult = Math.floor(widthOverride/cellWidth); | ||
28 | if (flooredResult >= 1 && flooredResult <= repeater.count) | ||
29 | if ((widthOverride-(flooredResult*cellWidth))/(flooredResult+1) < minColumnSpacing) | ||
30 | return flooredResult-1; | ||
31 | else | ||
32 | return flooredResult; | ||
33 | else if (flooredResult > repeater.count) | ||
34 | return repeater.count; | ||
35 | else | ||
36 | return 1; | ||
37 | } | ||
38 | |||
39 | columnSpacing: (widthOverride-(columns*cellWidth))/(columns+1) < (minColumnSpacing/2) ? (minColumnSpacing/2) : (widthOverride-(columns*cellWidth))/(columns+1) | ||
40 | width: widthOverride - 2*columnSpacing | ||
41 | anchors{ | ||
42 | horizontalCenter: parent.horizontalCenter | ||
43 | top: parent.top | ||
44 | topMargin: rowSpacing | ||
45 | } | ||
46 | |||
47 | Repeater { | ||
48 | id: repeater | ||
49 | } | ||
50 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/extras/CircleImage.qml b/prototype_2016/third_party/qml-material/src/extras/CircleImage.qml deleted file mode 100644 index 777f412..0000000 --- a/prototype_2016/third_party/qml-material/src/extras/CircleImage.qml +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material.Extras 0.1 as Extras | ||
13 | import QtGraphicalEffects 1.0 | ||
14 | |||
15 | Item { | ||
16 | id: item | ||
17 | |||
18 | property alias source: image.source | ||
19 | property alias status: image.status | ||
20 | property alias averageColor: image.averageColor | ||
21 | property alias sourceSize: image.sourceSize | ||
22 | property alias asynchronous: image.asynchronous | ||
23 | property alias cache: image.cache | ||
24 | property alias fillMode: image.fillMode | ||
25 | |||
26 | width: image.implicitWidth | ||
27 | height: image.implicitHeight | ||
28 | |||
29 | Extras.Image { | ||
30 | id: image | ||
31 | anchors.fill: parent | ||
32 | smooth: true | ||
33 | visible: false | ||
34 | mipmap: true | ||
35 | } | ||
36 | |||
37 | CircleMask { | ||
38 | anchors.fill: image | ||
39 | source: image | ||
40 | } | ||
41 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/extras/CircleMask.qml b/prototype_2016/third_party/qml-material/src/extras/CircleMask.qml deleted file mode 100644 index cd92028..0000000 --- a/prototype_2016/third_party/qml-material/src/extras/CircleMask.qml +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtGraphicalEffects 1.0 | ||
13 | |||
14 | Item { | ||
15 | id: item | ||
16 | |||
17 | property alias source: mask.source | ||
18 | |||
19 | Rectangle { | ||
20 | id: circleMask | ||
21 | anchors.fill: parent | ||
22 | |||
23 | smooth: true | ||
24 | visible: false | ||
25 | |||
26 | radius: Math.max(width/2, height/2) | ||
27 | } | ||
28 | |||
29 | OpacityMask { | ||
30 | id: mask | ||
31 | |||
32 | anchors.fill: parent | ||
33 | maskSource: circleMask | ||
34 | } | ||
35 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/extras/ColumnFlow.qml b/prototype_2016/third_party/qml-material/src/extras/ColumnFlow.qml deleted file mode 100644 index d9b4a54..0000000 --- a/prototype_2016/third_party/qml-material/src/extras/ColumnFlow.qml +++ /dev/null | |||
@@ -1,168 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | /* | ||
14 | example usage: | ||
15 | |||
16 | Rectangle { | ||
17 | width: 600 | ||
18 | height: 600 | ||
19 | |||
20 | ColumnFlow { | ||
21 | id: grid | ||
22 | anchors.fill: parent | ||
23 | columns: 5 | ||
24 | model: 20 | ||
25 | |||
26 | delegate: Rectangle { | ||
27 | id: item | ||
28 | height: 100.0 * Math.random() | ||
29 | color: Qt.rgba(Math.random(), Math.random(), Math.random(), Math.random()) | ||
30 | Text {text: index} | ||
31 | } | ||
32 | } | ||
33 | } | ||
34 | */ | ||
35 | Item { | ||
36 | id: columnFlow | ||
37 | |||
38 | property int columnWidth | ||
39 | |||
40 | property int columns: Math.max(0, Math.floor(width/columnWidth)) | ||
41 | property bool repeaterCompleted: false | ||
42 | property alias model: repeater.model | ||
43 | property alias delegate: repeater.delegate | ||
44 | property int contentHeight: 0 | ||
45 | |||
46 | height: contentHeight | ||
47 | |||
48 | onColumnsChanged: reEvalColumns() | ||
49 | onModelChanged: reEvalColumns() | ||
50 | |||
51 | onWidthChanged: updateWidths() | ||
52 | |||
53 | function updateWidths() { | ||
54 | if (repeaterCompleted) { | ||
55 | var count = 0 | ||
56 | |||
57 | //dump(columnFlow) | ||
58 | |||
59 | //add the first <column> elements | ||
60 | for (var i = 0; count < columns && i < columnFlow.children.length; i++) { | ||
61 | if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0) continue | ||
62 | |||
63 | columnFlow.children[i].width = width / columns | ||
64 | count++ | ||
65 | } | ||
66 | } | ||
67 | } | ||
68 | |||
69 | function dump(obj, indent) { | ||
70 | if (indent === undefined) | ||
71 | indent = 0 | ||
72 | var spacing = "" | ||
73 | for (var a = 0; a < indent; a++) { | ||
74 | spacing += " " | ||
75 | } | ||
76 | print(spacing + String(obj)) | ||
77 | if (obj.hasOwnProperty("children")) { | ||
78 | for (var i = 0; i < obj.children.length; i++) { | ||
79 | dump(obj.children[i], indent+1) | ||
80 | } | ||
81 | } | ||
82 | } | ||
83 | |||
84 | function reEvalColumns() { | ||
85 | if (!repeaterCompleted) | ||
86 | return | ||
87 | var i, j | ||
88 | var columnHeights = new Array(columns); | ||
89 | var lastItem = new Array(columns) | ||
90 | var lastI = -1 | ||
91 | var count = 0 | ||
92 | |||
93 | //dump(columnFlow) | ||
94 | |||
95 | //add the first <column> elements | ||
96 | for (i = 0; count < columns && i < columnFlow.children.length; i++) { | ||
97 | if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0 | ||
98 | || !columnFlow.children[i].visible) continue | ||
99 | |||
100 | lastItem[count] = i | ||
101 | columnHeights[count] = columnFlow.children[i].height | ||
102 | |||
103 | columnFlow.children[i].anchors.top = columnFlow.top | ||
104 | columnFlow.children[i].anchors.left = (lastI === -1 ? columnFlow.left : columnFlow.children[lastI].right) | ||
105 | columnFlow.children[i].anchors.right = undefined | ||
106 | columnFlow.children[i].width = columnFlow.width / columns | ||
107 | |||
108 | lastI = i | ||
109 | count++ | ||
110 | } | ||
111 | |||
112 | //add the other elements | ||
113 | for (i = i; i < columnFlow.children.length; i++) { | ||
114 | var highestHeight = Number.MAX_VALUE | ||
115 | var newColumn = 0 | ||
116 | |||
117 | if (!columnFlow.children[i] || !columnFlow.children[i].visible) continue | ||
118 | |||
119 | // find the shortest column | ||
120 | for (j = 0; j < columns; j++) { | ||
121 | if (columnHeights[j] < highestHeight) { | ||
122 | newColumn = j | ||
123 | highestHeight = columnHeights[j] | ||
124 | } | ||
125 | } | ||
126 | |||
127 | // add the element to the shortest column | ||
128 | columnFlow.children[i].anchors.top = columnFlow.children[lastItem[newColumn]].bottom | ||
129 | columnFlow.children[i].anchors.left = columnFlow.children[lastItem[newColumn]].left | ||
130 | columnFlow.children[i].anchors.right = columnFlow.children[lastItem[newColumn]].right | ||
131 | |||
132 | lastItem[newColumn] = i | ||
133 | columnHeights[newColumn] += columnFlow.children[i].height | ||
134 | } | ||
135 | |||
136 | var cHeight = 0 | ||
137 | for (i = 0; i < columns; i++) { | ||
138 | if (!columnHeights[i]) | ||
139 | continue | ||
140 | cHeight = Math.max(cHeight, columnHeights[i]) | ||
141 | } | ||
142 | contentHeight = cHeight | ||
143 | |||
144 | updateWidths() | ||
145 | } | ||
146 | |||
147 | |||
148 | // function appendToModel (item) { | ||
149 | // // only if model is an array | ||
150 | // if ((model instanceof Array) !== (item instanceof Array)) | ||
151 | // return | ||
152 | |||
153 | // if (item instanceof Array) | ||
154 | // for (var i = 0; i < item.length; i++) | ||
155 | // repeater.model.push(item) | ||
156 | // } | ||
157 | |||
158 | |||
159 | Repeater { | ||
160 | id: repeater | ||
161 | model: columnFlow.model | ||
162 | |||
163 | Component.onCompleted: { | ||
164 | columnFlow.repeaterCompleted = true | ||
165 | columnFlow.reEvalColumns() | ||
166 | } | ||
167 | } | ||
168 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/extras/Image.qml b/prototype_2016/third_party/qml-material/src/extras/Image.qml deleted file mode 100644 index cdb3dd3..0000000 --- a/prototype_2016/third_party/qml-material/src/extras/Image.qml +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
5 | * 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | |||
14 | Image { | ||
15 | id: image | ||
16 | |||
17 | property color averageColor | ||
18 | |||
19 | Canvas { | ||
20 | id: canvas | ||
21 | |||
22 | opacity: 0 | ||
23 | |||
24 | onAvailableChanged: { | ||
25 | var imgSource = image.source; | ||
26 | canvas.loadImage(String(imgSource)); | ||
27 | var context = canvas.getContext("2d"), | ||
28 | pixelInterval = 5, | ||
29 | count = 0, | ||
30 | i = -4, | ||
31 | rgba = {"r": 0, "g": 0, "b": 0, "a": 0}, | ||
32 | data = context.createImageData(String(imgSource)).data, | ||
33 | length = data.length; | ||
34 | while ((i += pixelInterval * 4) < length) { | ||
35 | count++; | ||
36 | rgba.r += data[i]; | ||
37 | rgba.g += data[i+1]; | ||
38 | rgba.b += data[i+2]; | ||
39 | rgba.a += data[i+3]; | ||
40 | }; | ||
41 | rgba.r = Math.floor(rgba.r/count); | ||
42 | rgba.g = Math.floor(rgba.g/count); | ||
43 | rgba.b = Math.floor(rgba.b/count); | ||
44 | rgba.a = Math.floor(rgba.a/count); | ||
45 | image.averageColor = Qt.rgba(rgba.r/255, rgba.g/255, rgba.b/255, rgba.a/255); | ||
46 | } | ||
47 | } | ||
48 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/extras/extras.qrc b/prototype_2016/third_party/qml-material/src/extras/extras.qrc deleted file mode 100644 index cb2452c..0000000 --- a/prototype_2016/third_party/qml-material/src/extras/extras.qrc +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/Material/Extras"> | ||
5 | <file>AutomaticGrid.qml</file> | ||
6 | <file>CircleImage.qml</file> | ||
7 | <file>CircleMask.qml</file> | ||
8 | <file>ColumnFlow.qml</file> | ||
9 | <file>Image.qml</file> | ||
10 | <file>qmldir</file> | ||
11 | </qresource> | ||
12 | |||
13 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/extras/qmldir b/prototype_2016/third_party/qml-material/src/extras/qmldir deleted file mode 100644 index 9cb93ae..0000000 --- a/prototype_2016/third_party/qml-material/src/extras/qmldir +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | module Material.Extras | ||
2 | |||
3 | AutomaticGrid 0.1 AutomaticGrid.qml | ||
4 | CircleImage 0.1 CircleImage.qml | ||
5 | CircleMask 0.1 CircleMask.qml | ||
6 | ColumnFlow 0.1 ColumnFlow.qml | ||
7 | Image 0.1 Image.qml | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/BaseListItem.qml b/prototype_2016/third_party/qml-material/src/listitems/BaseListItem.qml deleted file mode 100644 index 2aeeb59..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/BaseListItem.qml +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype BaseListItem | ||
16 | \inqmlmodule Material.ListItems | ||
17 | |||
18 | \brief The base class for list items. | ||
19 | |||
20 | Provides ink effects, mouse/touch handling and tinting on mouse hover. | ||
21 | */ | ||
22 | View { | ||
23 | id: listItem | ||
24 | anchors { | ||
25 | left: parent ? parent.left : undefined | ||
26 | right: parent ? parent.right : undefined | ||
27 | } | ||
28 | |||
29 | property bool darkBackground | ||
30 | property int margins: 16 * Units.dp | ||
31 | |||
32 | property bool selected | ||
33 | property bool interactive: true | ||
34 | |||
35 | property int dividerInset: 0 | ||
36 | property bool showDivider: false | ||
37 | |||
38 | signal clicked() | ||
39 | signal pressAndHold() | ||
40 | |||
41 | opacity: enabled ? 1 : 0.6 | ||
42 | |||
43 | ThinDivider { | ||
44 | anchors.bottom: parent.bottom | ||
45 | anchors.leftMargin: dividerInset | ||
46 | |||
47 | visible: showDivider | ||
48 | darkBackground: listItem.darkBackground | ||
49 | } | ||
50 | |||
51 | Ink { | ||
52 | id: ink | ||
53 | |||
54 | onClicked: listItem.clicked() | ||
55 | onPressAndHold: listItem.pressAndHold() | ||
56 | |||
57 | anchors.fill: parent | ||
58 | |||
59 | enabled: listItem.interactive && listItem.enabled | ||
60 | z: -1 | ||
61 | } | ||
62 | |||
63 | tintColor: selected | ||
64 | ? Qt.rgba(0,0,0,0.05) | ||
65 | : ink.containsMouse ? Qt.rgba(0,0,0,0.03) : Qt.rgba(0,0,0,0) | ||
66 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/CMakeLists.txt b/prototype_2016/third_party/qml-material/src/listitems/CMakeLists.txt deleted file mode 100644 index 0f042b1..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/CMakeLists.txt +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | file(GLOB QML_FILES *.qml) | ||
2 | |||
3 | install(FILES ${QML_FILES} qmldir | ||
4 | DESTINATION ${QML_INSTALL_DIR}/Material/ListItems) | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/Divider.qml b/prototype_2016/third_party/qml-material/src/listitems/Divider.qml deleted file mode 100644 index d5e5754..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/Divider.qml +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype Divider | ||
16 | \inqmlmodule Material.ListItems | ||
17 | |||
18 | \brief A divider divides content in a list. | ||
19 | */ | ||
20 | Item { | ||
21 | id: divider | ||
22 | |||
23 | anchors { | ||
24 | left: parent.left | ||
25 | right: parent.right | ||
26 | } | ||
27 | |||
28 | property bool darkBackground | ||
29 | |||
30 | height: 16 * Units.dp | ||
31 | |||
32 | ThinDivider { | ||
33 | anchors.verticalCenter: parent.verticalCenter | ||
34 | darkBackground: divider.darkBackground | ||
35 | } | ||
36 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/SectionHeader.qml b/prototype_2016/third_party/qml-material/src/listitems/SectionHeader.qml deleted file mode 100644 index 9a0c514..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/SectionHeader.qml +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015 Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt> | ||
5 | * 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Layouts 1.1 | ||
14 | import Material 0.3 | ||
15 | |||
16 | /*! | ||
17 | \qmltype SectionHeader | ||
18 | \inqmlmodule Material.ListItems | ||
19 | |||
20 | \brief A list item that serves as the the header for an expandable list section. | ||
21 | */ | ||
22 | BaseListItem { | ||
23 | id: listItem | ||
24 | |||
25 | property alias text: label.text | ||
26 | property alias iconName: icon.name | ||
27 | property bool expanded: false | ||
28 | |||
29 | height: 48 * Units.dp | ||
30 | |||
31 | RowLayout { | ||
32 | anchors.fill: parent | ||
33 | |||
34 | anchors.leftMargin: listItem.margins | ||
35 | anchors.rightMargin: listItem.margins | ||
36 | |||
37 | spacing: 16 * Units.dp | ||
38 | |||
39 | Item { | ||
40 | Layout.preferredWidth: 40 * Units.dp | ||
41 | Layout.preferredHeight: width | ||
42 | Layout.alignment: Qt.AlignCenter | ||
43 | |||
44 | visible: children.length > 1 || iconName != "" | ||
45 | |||
46 | Icon { | ||
47 | id: icon | ||
48 | |||
49 | anchors { | ||
50 | verticalCenter: parent.verticalCenter | ||
51 | left: parent.left | ||
52 | } | ||
53 | |||
54 | visible: name != "" | ||
55 | color: listItem.expanded ? Theme.primaryColor | ||
56 | : darkBackground ? Theme.dark.iconColor : Theme.light.iconColor | ||
57 | size: 24 * Units.dp | ||
58 | } | ||
59 | } | ||
60 | |||
61 | Label { | ||
62 | id: label | ||
63 | |||
64 | Layout.alignment: Qt.AlignVCenter | ||
65 | Layout.fillWidth: true | ||
66 | |||
67 | elide: Text.ElideRight | ||
68 | style: "subheading" | ||
69 | |||
70 | color: listItem.expanded ? Theme.primaryColor | ||
71 | : darkBackground ? Theme.dark.textColor : Theme.light.textColor | ||
72 | } | ||
73 | |||
74 | Item { | ||
75 | Layout.preferredWidth: 40 * Units.dp | ||
76 | Layout.preferredHeight: width | ||
77 | Layout.alignment: Qt.AlignRight | ||
78 | |||
79 | Icon { | ||
80 | anchors { | ||
81 | verticalCenter: parent.verticalCenter | ||
82 | left: parent.left | ||
83 | } | ||
84 | |||
85 | name: "navigation/expand_more" | ||
86 | rotation: listItem.expanded ? 180 : 0 | ||
87 | size: 24 * Units.dp | ||
88 | color: darkBackground ? Theme.dark.iconColor : Theme.light.iconColor | ||
89 | |||
90 | Behavior on rotation { | ||
91 | NumberAnimation { duration: 200 } | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | } | ||
96 | |||
97 | onClicked: listItem.expanded = !listItem.expanded | ||
98 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/SimpleMenu.qml b/prototype_2016/third_party/qml-material/src/listitems/SimpleMenu.qml deleted file mode 100644 index f336700..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/SimpleMenu.qml +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import Material.Extras 0.1 | ||
14 | |||
15 | /*! | ||
16 | \qmltype SimpleMenu | ||
17 | \inqmlmodule Material.ListItems | ||
18 | |||
19 | \brief A list item that opens a dropdown menu when tapped. | ||
20 | */ | ||
21 | Subtitled { | ||
22 | id: listItem | ||
23 | |||
24 | property var model | ||
25 | property alias selectedIndex: listView.currentIndex | ||
26 | |||
27 | subText: listView.currentItem.text | ||
28 | |||
29 | onClicked: menu.open(listItem, 16 * Units.dp, 0) | ||
30 | |||
31 | property int __maxWidth: 0 | ||
32 | |||
33 | Label { | ||
34 | id: hiddenLabel | ||
35 | style: "subheading" | ||
36 | visible: false | ||
37 | color: darkBackground ? Theme.dark.textColor : Theme.light.textColor | ||
38 | |||
39 | onContentWidthChanged: { | ||
40 | __maxWidth = Math.max(contentWidth + 33 * Units.dp, __maxWidth) | ||
41 | } | ||
42 | } | ||
43 | |||
44 | onModelChanged: { | ||
45 | var longestString = 0; | ||
46 | for (var i = 0; i < model.length; i++) { | ||
47 | if(model[i].length > longestString) | ||
48 | { | ||
49 | longestString = model[i].length | ||
50 | hiddenLabel.text = model[i] | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | |||
55 | Dropdown { | ||
56 | id: menu | ||
57 | |||
58 | anchor: Item.TopLeft | ||
59 | |||
60 | width: Math.max(56 * 2 * Units.dp, Math.min(listItem.width - 32 * Units.dp, __maxWidth)) | ||
61 | height: Math.min(10 * 48 * Units.dp + 16 * Units.dp, model.length * 48 * Units.dp + 16 * Units.dp) | ||
62 | |||
63 | Rectangle { | ||
64 | anchors.fill: parent | ||
65 | radius: 2 * Units.dp | ||
66 | } | ||
67 | |||
68 | ListView { | ||
69 | id: listView | ||
70 | |||
71 | anchors { | ||
72 | left: parent.left | ||
73 | right: parent.right | ||
74 | top: parent.top | ||
75 | topMargin: 8 * Units.dp | ||
76 | } | ||
77 | |||
78 | interactive: false | ||
79 | height: count > 0 ? contentHeight : 0 | ||
80 | model: listItem.model | ||
81 | |||
82 | delegate: Standard { | ||
83 | id: delegateItem | ||
84 | |||
85 | text: modelData | ||
86 | |||
87 | onClicked: { | ||
88 | listView.currentIndex = index | ||
89 | menu.close() | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/Standard.qml b/prototype_2016/third_party/qml-material/src/listitems/Standard.qml deleted file mode 100644 index 3c3341b..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/Standard.qml +++ /dev/null | |||
@@ -1,152 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtGraphicalEffects 1.0 | ||
13 | import QtQuick.Layouts 1.1 | ||
14 | import Material 0.3 | ||
15 | |||
16 | /*! | ||
17 | \qmltype Standard | ||
18 | \inqmlmodule Material.ListItems | ||
19 | |||
20 | \brief A simple list item with a single line of text and optional primary and secondary actions. | ||
21 | */ | ||
22 | BaseListItem { | ||
23 | id: listItem | ||
24 | |||
25 | implicitHeight: 48 * Units.dp | ||
26 | height: 48 * Units.dp | ||
27 | |||
28 | property alias text: label.text | ||
29 | property alias valueText: valueLabel.text | ||
30 | |||
31 | property alias action: actionItem.children | ||
32 | property alias iconName: icon.name | ||
33 | property alias iconSource: icon.source | ||
34 | property alias secondaryItem: secondaryItem.children | ||
35 | property alias content: contentItem.children | ||
36 | |||
37 | property alias itemLabel: label | ||
38 | property alias itemValueLabel: valueLabel | ||
39 | |||
40 | property alias textColor: label.color | ||
41 | property alias iconColor: icon.color | ||
42 | |||
43 | dividerInset: actionItem.visible ? listItem.height : 0 | ||
44 | |||
45 | interactive: contentItem.children.length === 0 | ||
46 | |||
47 | implicitWidth: { | ||
48 | var width = listItem.margins * 2 | ||
49 | |||
50 | if (actionItem.visible) | ||
51 | width += actionItem.width + row.spacing | ||
52 | |||
53 | if (contentItem.visible) | ||
54 | width += contentItem.implicitWidth + row.spacing | ||
55 | else | ||
56 | width += label.implicitWidth + row.spacing | ||
57 | |||
58 | if (valueLabel.visible) | ||
59 | width += valueLabel.width + row.spacing | ||
60 | |||
61 | if (secondaryItem.visible) | ||
62 | width += secondaryItem.width + row.spacing | ||
63 | |||
64 | return width | ||
65 | } | ||
66 | |||
67 | RowLayout { | ||
68 | id: row | ||
69 | anchors.fill: parent | ||
70 | |||
71 | anchors.leftMargin: listItem.margins | ||
72 | anchors.rightMargin: listItem.margins | ||
73 | |||
74 | spacing: 16 * Units.dp | ||
75 | |||
76 | Item { | ||
77 | id: actionItem | ||
78 | |||
79 | Layout.preferredWidth: 40 * Units.dp | ||
80 | Layout.preferredHeight: width | ||
81 | Layout.alignment: Qt.AlignCenter | ||
82 | |||
83 | visible: children.length > 1 || icon.valid | ||
84 | |||
85 | Icon { | ||
86 | id: icon | ||
87 | |||
88 | anchors { | ||
89 | verticalCenter: parent.verticalCenter | ||
90 | left: parent.left | ||
91 | } | ||
92 | |||
93 | visible: valid | ||
94 | color: listItem.selected ? Theme.primaryColor | ||
95 | : darkBackground ? Theme.dark.iconColor : Theme.light.iconColor | ||
96 | |||
97 | size: 24 * Units.dp | ||
98 | } | ||
99 | } | ||
100 | |||
101 | ColumnLayout { | ||
102 | Layout.alignment: Qt.AlignVCenter | ||
103 | Layout.preferredHeight: parent.height | ||
104 | |||
105 | Item { | ||
106 | id: contentItem | ||
107 | |||
108 | Layout.fillWidth: true | ||
109 | Layout.preferredHeight: parent.height | ||
110 | |||
111 | visible: children.length > 0 | ||
112 | } | ||
113 | |||
114 | Label { | ||
115 | id: label | ||
116 | |||
117 | Layout.alignment: Qt.AlignVCenter | ||
118 | Layout.fillWidth: true | ||
119 | |||
120 | elide: Text.ElideRight | ||
121 | style: "subheading" | ||
122 | |||
123 | color: listItem.selected ? Theme.primaryColor | ||
124 | : darkBackground ? Theme.dark.textColor : Theme.light.textColor | ||
125 | |||
126 | visible: !contentItem.visible | ||
127 | } | ||
128 | } | ||
129 | |||
130 | Label { | ||
131 | id: valueLabel | ||
132 | |||
133 | Layout.alignment: Qt.AlignVCenter | ||
134 | |||
135 | color: darkBackground ? Theme.dark.subTextColor : Theme.light.subTextColor | ||
136 | elide: Text.ElideRight | ||
137 | style: "body1" | ||
138 | |||
139 | visible: text != "" | ||
140 | } | ||
141 | |||
142 | Item { | ||
143 | id: secondaryItem | ||
144 | |||
145 | Layout.alignment: Qt.AlignCenter | ||
146 | Layout.preferredWidth: childrenRect.width | ||
147 | Layout.preferredHeight: parent.height | ||
148 | |||
149 | visible: children.length > 0 | ||
150 | } | ||
151 | } | ||
152 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/Subheader.qml b/prototype_2016/third_party/qml-material/src/listitems/Subheader.qml deleted file mode 100644 index 5e692a0..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/Subheader.qml +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype Subheader | ||
16 | \inqmlmodule Material.ListItems | ||
17 | |||
18 | \brief Subheaders are special list tiles that delineate distinct sections of a list or grid list. | ||
19 | */ | ||
20 | View { | ||
21 | id: listItem | ||
22 | |||
23 | //----- STYLE PROPERTIES -----// | ||
24 | |||
25 | height: 48 * Units.dp | ||
26 | property int margins: 16 * Units.dp | ||
27 | |||
28 | anchors { | ||
29 | left: parent.left | ||
30 | right: parent.right | ||
31 | } | ||
32 | |||
33 | property int spacing | ||
34 | |||
35 | property alias text: label.text | ||
36 | property alias style: label.style | ||
37 | property alias textColor: label.color | ||
38 | property bool darkBackground | ||
39 | |||
40 | Label { | ||
41 | id: label | ||
42 | |||
43 | font.pixelSize: 14 * Units.dp | ||
44 | font.family: "Roboto" | ||
45 | font.weight: Font.DemiBold | ||
46 | |||
47 | anchors { | ||
48 | verticalCenter: parent.verticalCenter | ||
49 | left: parent.left | ||
50 | right: parent.right | ||
51 | margins: margins | ||
52 | } | ||
53 | |||
54 | color: darkBackground ? Theme.dark.subTextColor : Theme.light.subTextColor | ||
55 | } | ||
56 | |||
57 | property bool showDivider: false | ||
58 | |||
59 | ThinDivider { | ||
60 | anchors.bottom: parent.bottom | ||
61 | visible: showDivider | ||
62 | darkBackground: listItem.darkBackground | ||
63 | } | ||
64 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/Subtitled.qml b/prototype_2016/third_party/qml-material/src/listitems/Subtitled.qml deleted file mode 100644 index a0b53da..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/Subtitled.qml +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Jordan Neidlinger <jneidlinger@barracuda.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Layouts 1.1 | ||
14 | import Material 0.3 | ||
15 | |||
16 | /*! | ||
17 | \qmltype Subtitled | ||
18 | \inqmlmodule Material.ListItems | ||
19 | |||
20 | \brief A list item with a two or three lines of text and optional primary and secondary actions. | ||
21 | */ | ||
22 | BaseListItem { | ||
23 | id: listItem | ||
24 | |||
25 | height: maximumLineCount == 2 ? 72 * Units.dp : 88 * Units.dp | ||
26 | |||
27 | property alias text: label.text | ||
28 | property alias subText: subLabel.text | ||
29 | property alias valueText: valueLabel.text | ||
30 | |||
31 | property alias iconName: icon.name | ||
32 | property alias iconSource: icon.source | ||
33 | |||
34 | property alias action: actionItem.children | ||
35 | property alias secondaryItem: secondaryItem.children | ||
36 | property alias content: contentItem.children | ||
37 | |||
38 | property alias itemLabel: label | ||
39 | property alias itemSubLabel: subLabel | ||
40 | property alias itemValueLabel: valueLabel | ||
41 | |||
42 | interactive: !contentItem.showing | ||
43 | |||
44 | dividerInset: actionItem.visible ? listItem.height : 0 | ||
45 | |||
46 | property int maximumLineCount: 2 | ||
47 | |||
48 | GridLayout { | ||
49 | anchors.fill: parent | ||
50 | |||
51 | anchors.leftMargin: listItem.margins | ||
52 | anchors.rightMargin: listItem.margins | ||
53 | |||
54 | columns: 4 | ||
55 | rows: 1 | ||
56 | columnSpacing: 16 * Units.dp | ||
57 | |||
58 | Item { | ||
59 | id: actionItem | ||
60 | |||
61 | Layout.preferredWidth: 40 * Units.dp | ||
62 | Layout.preferredHeight: width | ||
63 | Layout.alignment: Qt.AlignCenter | ||
64 | Layout.column: 1 | ||
65 | |||
66 | visible: children.length > 1 || icon.valid | ||
67 | |||
68 | Icon { | ||
69 | id: icon | ||
70 | |||
71 | anchors { | ||
72 | verticalCenter: parent.verticalCenter | ||
73 | left: parent.left | ||
74 | } | ||
75 | |||
76 | visible: valid | ||
77 | color: listItem.selected ? Theme.primaryColor | ||
78 | : darkBackground ? Theme.dark.iconColor : Theme.light.iconColor | ||
79 | size: 24 * Units.dp | ||
80 | } | ||
81 | } | ||
82 | |||
83 | ColumnLayout { | ||
84 | Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter | ||
85 | Layout.fillWidth: true | ||
86 | Layout.column: 2 | ||
87 | |||
88 | spacing: 3 * Units.dp | ||
89 | |||
90 | RowLayout { | ||
91 | Layout.fillWidth: true | ||
92 | |||
93 | spacing: 8 * Units.dp | ||
94 | |||
95 | Label { | ||
96 | id: label | ||
97 | |||
98 | Layout.alignment: Qt.AlignVCenter | ||
99 | Layout.fillWidth: true | ||
100 | |||
101 | elide: Text.ElideRight | ||
102 | style: "subheading" | ||
103 | color: darkBackground ? Theme.dark.textColor : Theme.light.textColor | ||
104 | } | ||
105 | |||
106 | Label { | ||
107 | id: valueLabel | ||
108 | |||
109 | Layout.alignment: Qt.AlignVCenter | ||
110 | Layout.preferredWidth: visible ? implicitWidth : 0 | ||
111 | |||
112 | color: darkBackground ? Theme.dark.subTextColor : Theme.light.subTextColor | ||
113 | elide: Text.ElideRight | ||
114 | horizontalAlignment: Qt.AlignHCenter | ||
115 | style: "body1" | ||
116 | visible: text != "" | ||
117 | } | ||
118 | } | ||
119 | |||
120 | Item { | ||
121 | id: contentItem | ||
122 | |||
123 | Layout.fillWidth: true | ||
124 | Layout.preferredHeight: showing ? subLabel.implicitHeight : 0 | ||
125 | |||
126 | property bool showing: visibleChildren.length > 0 | ||
127 | } | ||
128 | |||
129 | Label { | ||
130 | id: subLabel | ||
131 | |||
132 | Layout.fillWidth: true | ||
133 | Layout.preferredHeight: implicitHeight * maximumLineCount/lineCount | ||
134 | |||
135 | color: darkBackground ? Theme.dark.subTextColor : Theme.light.subTextColor | ||
136 | elide: Text.ElideRight | ||
137 | wrapMode: Text.WordWrap | ||
138 | style: "body1" | ||
139 | |||
140 | visible: text != "" && !contentItem.showing | ||
141 | maximumLineCount: listItem.maximumLineCount - 1 | ||
142 | } | ||
143 | } | ||
144 | |||
145 | Item { | ||
146 | id: secondaryItem | ||
147 | Layout.alignment: Qt.AlignCenter | ||
148 | Layout.preferredWidth: childrenRect.width | ||
149 | Layout.preferredHeight: parent.height | ||
150 | Layout.column: 4 | ||
151 | |||
152 | visible: children.length > 0 | ||
153 | } | ||
154 | } | ||
155 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/listitems.qrc b/prototype_2016/third_party/qml-material/src/listitems/listitems.qrc deleted file mode 100644 index 5ff9a32..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/listitems.qrc +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/Material/ListItems"> | ||
5 | <file>BaseListItem.qml</file> | ||
6 | <file>Divider.qml</file> | ||
7 | <file>SectionHeader.qml</file> | ||
8 | <file>SimpleMenu.qml</file> | ||
9 | <file>Standard.qml</file> | ||
10 | <file>Subheader.qml</file> | ||
11 | <file>Subtitled.qml</file> | ||
12 | <file>qmldir</file> | ||
13 | </qresource> | ||
14 | |||
15 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/listitems/qmldir b/prototype_2016/third_party/qml-material/src/listitems/qmldir deleted file mode 100644 index bb37850..0000000 --- a/prototype_2016/third_party/qml-material/src/listitems/qmldir +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | module Material.ListItems | ||
2 | |||
3 | BaseListItem 0.1 BaseListItem.qml | ||
4 | Divider 0.1 Divider.qml | ||
5 | SimpleMenu 0.1 SimpleMenu.qml | ||
6 | Standard 0.1 Standard.qml | ||
7 | Subheader 0.1 Subheader.qml | ||
8 | Subtitled 0.1 Subtitled.qml | ||
9 | SectionHeader 0.1 SectionHeader.qml | ||
diff --git a/prototype_2016/third_party/qml-material/src/material.qrc b/prototype_2016/third_party/qml-material/src/material.qrc deleted file mode 100644 index 2e41eee..0000000 --- a/prototype_2016/third_party/qml-material/src/material.qrc +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | |||
2 | <RCC> | ||
3 | <qresource prefix="/Material"> | ||
4 | <file>qmldir</file> | ||
5 | </qresource> | ||
6 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/plugin.cpp b/prototype_2016/third_party/qml-material/src/plugin.cpp deleted file mode 100644 index 76c5cb8..0000000 --- a/prototype_2016/third_party/qml-material/src/plugin.cpp +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | #include "plugin.h" | ||
12 | |||
13 | #include <QtQml> | ||
14 | |||
15 | #include "core/device.h" | ||
16 | #include "core/units.h" | ||
17 | |||
18 | class MaterialRegisterHelper { | ||
19 | |||
20 | public: | ||
21 | MaterialRegisterHelper(const char *uri) { | ||
22 | qmlRegisterSingletonType<Device>(uri, 0, 1, "Device", Device::qmlSingleton); | ||
23 | qmlRegisterUncreatableType<Units>(uri, 0, 3, "Units", QStringLiteral("Units can only be used via the attached property.")); | ||
24 | } | ||
25 | }; | ||
26 | |||
27 | void MaterialPlugin::registerTypes(const char *uri) | ||
28 | { | ||
29 | // @uri Material | ||
30 | Q_ASSERT(uri == QStringLiteral("Material")); | ||
31 | |||
32 | MaterialRegisterHelper helper(uri); | ||
33 | } | ||
34 | |||
35 | // When using QPM, the C++ plugin is not used and the QML types must be registered manually | ||
36 | #ifdef QPM_INIT | ||
37 | static MaterialRegisterHelper registerHelper("Material"); | ||
38 | #endif | ||
diff --git a/prototype_2016/third_party/qml-material/src/plugin.h b/prototype_2016/third_party/qml-material/src/plugin.h deleted file mode 100644 index 0836309..0000000 --- a/prototype_2016/third_party/qml-material/src/plugin.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | #ifndef MATERIAL_PLUGIN_H | ||
12 | #define MATERIAL_PLUGIN_H | ||
13 | |||
14 | #include <QQmlExtensionPlugin> | ||
15 | |||
16 | class MaterialPlugin : public QQmlExtensionPlugin | ||
17 | { | ||
18 | Q_OBJECT | ||
19 | Q_PLUGIN_METADATA(IID "io.papyros.Material") | ||
20 | |||
21 | public: | ||
22 | void registerTypes(const char *uri); | ||
23 | }; | ||
24 | |||
25 | #endif // MATERIAL_PLUGIN_H | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/BottomActionSheet.qml b/prototype_2016/third_party/qml-material/src/popups/BottomActionSheet.qml deleted file mode 100644 index 1369816..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/BottomActionSheet.qml +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import Material.ListItems 0.1 as ListItem | ||
14 | |||
15 | /*! | ||
16 | \qmltype BottomActionSheet | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Represents a bottom sheet displaying a list of actions with an optional title. | ||
20 | |||
21 | */ | ||
22 | BottomSheet { | ||
23 | id: bottomSheet | ||
24 | |||
25 | property list<Action> actions | ||
26 | |||
27 | property string title | ||
28 | |||
29 | implicitHeight: title !== "" ? header.height + listViewContainer.implicitHeight | ||
30 | : listViewContainer.implicitHeight | ||
31 | |||
32 | Column { | ||
33 | id: column | ||
34 | |||
35 | anchors.fill: parent | ||
36 | |||
37 | ListItem.Subheader { | ||
38 | id: header | ||
39 | text: title | ||
40 | visible: title !== "" | ||
41 | height: 56 * Units.dp | ||
42 | style: "subheading" | ||
43 | backgroundColor: "white" | ||
44 | elevation: listView.atYBeginning ? 0 : 1 | ||
45 | fullWidth: true | ||
46 | z: 2 | ||
47 | } | ||
48 | |||
49 | Item { | ||
50 | id: listViewContainer | ||
51 | |||
52 | width: parent.width | ||
53 | height: title !== "" ? parent.height - header.height : parent.height | ||
54 | |||
55 | implicitHeight: listView.contentHeight + listView.topMargin + listView.bottomMargin | ||
56 | |||
57 | Flickable { | ||
58 | id: listView | ||
59 | width: parent.width | ||
60 | height: parent.height | ||
61 | |||
62 | interactive: bottomSheet.height < bottomSheet.implicitHeight | ||
63 | |||
64 | topMargin: title !== "" ? 0 : 8 * Units.dp | ||
65 | bottomMargin: 8 * Units.dp | ||
66 | |||
67 | contentWidth: width | ||
68 | contentHeight: subColumn.height | ||
69 | |||
70 | Column { | ||
71 | id: subColumn | ||
72 | width: parent.width | ||
73 | |||
74 | Repeater { | ||
75 | model: actions | ||
76 | |||
77 | delegate: Column { | ||
78 | width: parent.width | ||
79 | |||
80 | ListItem.Standard { | ||
81 | id: listItem | ||
82 | text: modelData.name | ||
83 | iconSource: modelData.iconSource | ||
84 | visible: modelData.visible | ||
85 | enabled: modelData.enabled | ||
86 | |||
87 | onClicked: { | ||
88 | bottomSheet.close() | ||
89 | modelData.triggered(listItem) | ||
90 | } | ||
91 | } | ||
92 | |||
93 | ListItem.Divider { | ||
94 | visible: modelData.hasDividerAfter | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | } | ||
99 | } | ||
100 | |||
101 | Scrollbar { | ||
102 | flickableItem: listView | ||
103 | } | ||
104 | } | ||
105 | } | ||
106 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/BottomSheet.qml b/prototype_2016/third_party/qml-material/src/popups/BottomSheet.qml deleted file mode 100644 index 0aa6ee8..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/BottomSheet.qml +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Steve Coffey <scoffey@barracuda.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import Material 0.3 | ||
14 | |||
15 | /*! | ||
16 | \qmltype BottomSheet | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A bottom sheet is a sheet of paper that slides up from the bottom edge | ||
20 | of the screen and presents a set of clear and simple actions. | ||
21 | */ | ||
22 | PopupBase { | ||
23 | id: bottomSheet | ||
24 | |||
25 | /*! | ||
26 | The maximum height of the bottom sheet. This is useful when used with a flickable, | ||
27 | so the bottom sheet will scroll when the content is higher than the maximum height. | ||
28 | */ | ||
29 | property int maxHeight: parent.height * 0.6 | ||
30 | |||
31 | default property alias content: containerView.data | ||
32 | |||
33 | overlayLayer: "dialogOverlayLayer" | ||
34 | overlayColor: Qt.rgba(0, 0, 0, 0.2) | ||
35 | height: Math.min(maxHeight, implicitHeight) | ||
36 | implicitHeight: containerView.childrenRect.height | ||
37 | width: parent.width | ||
38 | |||
39 | visible: percentOpen > 0 | ||
40 | |||
41 | property real percentOpen: showing ? 1 : 0 | ||
42 | |||
43 | Behavior on percentOpen { | ||
44 | |||
45 | NumberAnimation { | ||
46 | duration: 200 | ||
47 | easing { | ||
48 | type: Easing.OutCubic | ||
49 | } | ||
50 | } | ||
51 | } | ||
52 | |||
53 | anchors { | ||
54 | bottom: parent.bottom | ||
55 | bottomMargin: (bottomSheet.percentOpen - 1) * height | ||
56 | } | ||
57 | |||
58 | View { | ||
59 | id:containerView | ||
60 | |||
61 | anchors.fill: parent | ||
62 | |||
63 | elevation: 2 | ||
64 | backgroundColor: "#fff" | ||
65 | } | ||
66 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/Dialog.qml b/prototype_2016/third_party/qml-material/src/popups/Dialog.qml deleted file mode 100644 index dfc2cc5..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/Dialog.qml +++ /dev/null | |||
@@ -1,322 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Bogdan Cuza <bogdan.cuza@hotmail.com> | ||
6 | * 2015 Mikhail Ivchenko <ematirov@gmail.com> | ||
7 | * | ||
8 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
9 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
10 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
11 | */ | ||
12 | |||
13 | import QtQuick 2.4 | ||
14 | import QtQuick.Layouts 1.1 | ||
15 | import Material 0.3 | ||
16 | import Material.Extras 0.1 | ||
17 | |||
18 | /*! | ||
19 | \qmltype Dialog | ||
20 | \inqmlmodule Material | ||
21 | \brief Dialogs inform users about critical information, require users to make | ||
22 | decisions, or encapsulate multiple tasks within a discrete process | ||
23 | */ | ||
24 | PopupBase { | ||
25 | id: dialog | ||
26 | |||
27 | overlayLayer: "dialogOverlayLayer" | ||
28 | overlayColor: Qt.rgba(0, 0, 0, 0.3) | ||
29 | |||
30 | opacity: showing ? 1 : 0 | ||
31 | visible: opacity > 0 | ||
32 | |||
33 | width: Math.max(minimumWidth, | ||
34 | content.contentWidth + 2 * contentMargins) | ||
35 | |||
36 | height: Math.min(parent.height - 64 * Units.dp, | ||
37 | headerView.height + | ||
38 | content.contentHeight + | ||
39 | (floatingActions ? 0 : buttonContainer.height)) | ||
40 | |||
41 | property int contentMargins: 24 * Units.dp | ||
42 | |||
43 | property int minimumWidth: Device.isMobile ? 280 * Units.dp : 300 * Units.dp | ||
44 | |||
45 | property alias title: titleLabel.text | ||
46 | property alias text: textLabel.text | ||
47 | |||
48 | /*! | ||
49 | \qmlproperty Button negativeButton | ||
50 | The negative button, displayed as the leftmost button on the right of the dialog buttons. | ||
51 | This is usually used to dismiss the dialog. | ||
52 | */ | ||
53 | property alias negativeButton: negativeButton | ||
54 | |||
55 | /*! | ||
56 | \qmlproperty Button primaryButton | ||
57 | The primary button, displayed as the rightmost button in the dialog buttons row. This is | ||
58 | usually used to accept the dialog's action. | ||
59 | */ | ||
60 | property alias positiveButton: positiveButton | ||
61 | |||
62 | property string negativeButtonText: "Cancel" | ||
63 | property string positiveButtonText: "Ok" | ||
64 | property alias positiveButtonEnabled: positiveButton.enabled | ||
65 | |||
66 | property bool hasActions: true | ||
67 | property bool floatingActions: false | ||
68 | |||
69 | default property alias dialogContent: column.data | ||
70 | |||
71 | signal accepted() | ||
72 | signal rejected() | ||
73 | |||
74 | anchors { | ||
75 | centerIn: parent | ||
76 | verticalCenterOffset: showing ? 0 : -(dialog.height/3) | ||
77 | |||
78 | Behavior on verticalCenterOffset { | ||
79 | NumberAnimation { duration: 200 } | ||
80 | } | ||
81 | } | ||
82 | |||
83 | Behavior on opacity { | ||
84 | NumberAnimation { duration: 200 } | ||
85 | } | ||
86 | |||
87 | Keys.onPressed: { | ||
88 | if (event.key === Qt.Key_Escape) { | ||
89 | closeKeyPressed(event) | ||
90 | } | ||
91 | } | ||
92 | |||
93 | Keys.onReleased: { | ||
94 | if (event.key === Qt.Key_Back) { | ||
95 | closeKeyPressed(event) | ||
96 | } | ||
97 | } | ||
98 | |||
99 | function closeKeyPressed(event) { | ||
100 | if (dialog.showing) { | ||
101 | if (dialog.dismissOnTap) { | ||
102 | dialog.close() | ||
103 | } | ||
104 | event.accepted = true | ||
105 | } | ||
106 | } | ||
107 | |||
108 | function show() { | ||
109 | open() | ||
110 | } | ||
111 | |||
112 | View { | ||
113 | id: dialogContainer | ||
114 | |||
115 | anchors.fill: parent | ||
116 | elevation: 5 | ||
117 | radius: 2 * Units.dp | ||
118 | backgroundColor: "white" | ||
119 | |||
120 | MouseArea { | ||
121 | anchors.fill: parent | ||
122 | propagateComposedEvents: false | ||
123 | |||
124 | onClicked: { | ||
125 | mouse.accepted = false | ||
126 | } | ||
127 | } | ||
128 | |||
129 | Rectangle { | ||
130 | anchors.fill: content | ||
131 | } | ||
132 | |||
133 | Flickable { | ||
134 | id: content | ||
135 | |||
136 | contentWidth: column.implicitWidth | ||
137 | contentHeight: column.height + (column.height > 0 ? contentMargins : 0) | ||
138 | clip: true | ||
139 | |||
140 | anchors { | ||
141 | left: parent.left | ||
142 | right: parent.right | ||
143 | top: headerView.bottom | ||
144 | bottom: floatingActions ? parent.bottom : buttonContainer.top | ||
145 | } | ||
146 | |||
147 | interactive: contentHeight > height | ||
148 | |||
149 | onContentXChanged: { | ||
150 | if(contentX != 0 && contentWidth <= width) | ||
151 | contentX = 0 | ||
152 | } | ||
153 | |||
154 | onContentYChanged: { | ||
155 | if(contentY != 0 && contentHeight <= height) | ||
156 | contentY = 0 | ||
157 | } | ||
158 | |||
159 | Column { | ||
160 | id: column | ||
161 | anchors { | ||
162 | left: parent.left | ||
163 | leftMargin: contentMargins | ||
164 | } | ||
165 | |||
166 | width: content.width - 2 * contentMargins | ||
167 | spacing: 8 * Units.dp | ||
168 | } | ||
169 | } | ||
170 | |||
171 | Scrollbar { | ||
172 | flickableItem: content | ||
173 | } | ||
174 | |||
175 | Item { | ||
176 | anchors { | ||
177 | left: parent.left | ||
178 | right: parent.right | ||
179 | top: parent.top | ||
180 | } | ||
181 | |||
182 | height: headerView.height | ||
183 | |||
184 | View { | ||
185 | backgroundColor: "white" | ||
186 | elevation: content.atYBeginning ? 0 : 1 | ||
187 | fullWidth: true | ||
188 | radius: dialogContainer.radius | ||
189 | |||
190 | anchors { | ||
191 | left: parent.left | ||
192 | right: parent.right | ||
193 | top: parent.top | ||
194 | } | ||
195 | |||
196 | height: parent.height | ||
197 | } | ||
198 | } | ||
199 | |||
200 | |||
201 | Column { | ||
202 | id: headerView | ||
203 | |||
204 | spacing: 0 | ||
205 | |||
206 | anchors { | ||
207 | left: parent.left | ||
208 | right: parent.right | ||
209 | top: parent.top | ||
210 | |||
211 | leftMargin: contentMargins | ||
212 | rightMargin: contentMargins | ||
213 | } | ||
214 | |||
215 | Item { | ||
216 | width: parent.width | ||
217 | height: contentMargins | ||
218 | visible: titleLabel.visible || textLabel.visible | ||
219 | } | ||
220 | |||
221 | Label { | ||
222 | id: titleLabel | ||
223 | |||
224 | width: parent.width | ||
225 | wrapMode: Text.Wrap | ||
226 | style: "title" | ||
227 | visible: title != "" | ||
228 | } | ||
229 | |||
230 | Item { | ||
231 | width: parent.width | ||
232 | height: 20 * Units.dp | ||
233 | visible: titleLabel.visible | ||
234 | } | ||
235 | |||
236 | Label { | ||
237 | id: textLabel | ||
238 | |||
239 | width: parent.width | ||
240 | wrapMode: Text.Wrap | ||
241 | style: "dialog" | ||
242 | color: Theme.light.subTextColor | ||
243 | visible: text != "" | ||
244 | } | ||
245 | |||
246 | Item { | ||
247 | width: parent.width | ||
248 | height: contentMargins | ||
249 | visible: textLabel.visible | ||
250 | } | ||
251 | } | ||
252 | |||
253 | Item { | ||
254 | id: buttonContainer | ||
255 | |||
256 | anchors { | ||
257 | bottom: parent.bottom | ||
258 | right: parent.right | ||
259 | left: parent.left | ||
260 | } | ||
261 | |||
262 | height: hasActions ? 52 * Units.dp : 2 * Units.dp | ||
263 | |||
264 | View { | ||
265 | id: buttonView | ||
266 | |||
267 | height: parent.height | ||
268 | backgroundColor: floatingActions ? "transparent" : "white" | ||
269 | elevation: content.atYEnd ? 0 : 1 | ||
270 | fullWidth: true | ||
271 | radius: dialogContainer.radius | ||
272 | elevationInverted: true | ||
273 | |||
274 | anchors { | ||
275 | bottom: parent.bottom | ||
276 | right: parent.right | ||
277 | left: parent.left | ||
278 | } | ||
279 | |||
280 | Button { | ||
281 | id: negativeButton | ||
282 | |||
283 | visible: hasActions | ||
284 | text: negativeButtonText | ||
285 | textColor: Theme.accentColor | ||
286 | context: "dialog" | ||
287 | |||
288 | anchors { | ||
289 | verticalCenter: parent.verticalCenter | ||
290 | right: positiveButton.visible ? positiveButton.left : parent.right | ||
291 | rightMargin: 8 * Units.dp | ||
292 | } | ||
293 | |||
294 | onClicked: { | ||
295 | close(); | ||
296 | rejected(); | ||
297 | } | ||
298 | } | ||
299 | |||
300 | Button { | ||
301 | id: positiveButton | ||
302 | |||
303 | visible: hasActions | ||
304 | text: positiveButtonText | ||
305 | textColor: Theme.accentColor | ||
306 | context: "dialog" | ||
307 | |||
308 | anchors { | ||
309 | verticalCenter: parent.verticalCenter | ||
310 | rightMargin: 8 * Units.dp | ||
311 | right: parent.right | ||
312 | } | ||
313 | |||
314 | onClicked: { | ||
315 | close() | ||
316 | accepted(); | ||
317 | } | ||
318 | } | ||
319 | } | ||
320 | } | ||
321 | } | ||
322 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/Dropdown.qml b/prototype_2016/third_party/qml-material/src/popups/Dropdown.qml deleted file mode 100644 index 320967f..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/Dropdown.qml +++ /dev/null | |||
@@ -1,193 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Window 2.2 | ||
13 | import Material 0.3 | ||
14 | import Material.Extras 0.1 | ||
15 | |||
16 | /*! | ||
17 | \qmltype Dropdown | ||
18 | \inqmlmodule Material | ||
19 | |||
20 | \brief Represents a dropdown menu that can display a variety of content. | ||
21 | */ | ||
22 | PopupBase { | ||
23 | id: dropdown | ||
24 | |||
25 | default property alias data: view.data | ||
26 | property int anchor: Item.TopRight | ||
27 | property alias internalView: view | ||
28 | |||
29 | visible: view.opacity > 0 | ||
30 | closeOnResize: true | ||
31 | |||
32 | function open(caller, offsetX, offsetY) { | ||
33 | __lastFocusedItem = Window.activeFocusItem | ||
34 | parent = Utils.findRootChild(dropdown, overlayLayer) | ||
35 | |||
36 | if (!parent.enabled) | ||
37 | return | ||
38 | |||
39 | if (parent.currentOverlay) | ||
40 | parent.currentOverlay.close() | ||
41 | |||
42 | if(typeof offsetX === "undefined") | ||
43 | offsetX = 0 | ||
44 | |||
45 | if(typeof offsetY === "undefined") | ||
46 | offsetY = 0 | ||
47 | |||
48 | var position = caller.mapToItem(dropdown.parent, 0, 0) | ||
49 | |||
50 | // Check to make sure we are within the window bounds, move if we need to | ||
51 | var globalPos = caller.mapToItem(null, 0, 0) | ||
52 | var root = Utils.findRoot(dropdown) | ||
53 | |||
54 | if (__internal.left) { | ||
55 | dropdown.x = position.x | ||
56 | } else if (__internal.center) { | ||
57 | dropdown.x = caller.width / 2 - dropdown.width / 2 | ||
58 | } else { | ||
59 | dropdown.x = position.x + caller.width - dropdown.width | ||
60 | } | ||
61 | |||
62 | if (__internal.top) { | ||
63 | dropdown.y = position.y | ||
64 | } else if (__internal.center) { | ||
65 | dropdown.y = caller.height / 2 - dropdown.height / 2 | ||
66 | } else { | ||
67 | dropdown.y = position.y + caller.height - dropdown.height | ||
68 | } | ||
69 | |||
70 | dropdown.x += offsetX | ||
71 | dropdown.y += offsetY | ||
72 | |||
73 | if(dropdown.y + height > root.height) | ||
74 | dropdown.y += -((dropdown.y + height + 16 * Units.dp) - root.height) | ||
75 | if(dropdown.x + width > root.width) | ||
76 | dropdown.x += -((dropdown.x + width + 16 * Units.dp) - root.width) | ||
77 | |||
78 | showing = true | ||
79 | parent.currentOverlay = dropdown | ||
80 | |||
81 | opened() | ||
82 | } | ||
83 | |||
84 | QtObject { | ||
85 | id: __internal | ||
86 | |||
87 | property bool left: dropdown.anchor == Item.Left || dropdown.anchor == Item.TopLeft || | ||
88 | dropdown.anchor == Item.BottomLeft | ||
89 | property bool right: dropdown.anchor == Item.Right || dropdown.anchor == Item.TopRight || | ||
90 | dropdown.anchor == Item.BottomRight | ||
91 | property bool top: dropdown.anchor == Item.Top || dropdown.anchor == Item.TopLeft || | ||
92 | dropdown.anchor == Item.TopRight | ||
93 | property bool bottom: dropdown.anchor == Item.Bottom || | ||
94 | dropdown.anchor == Item.BottomLeft || | ||
95 | dropdown.anchor == Item.BottomRight | ||
96 | property bool center: dropdown.anchor == Item.Center | ||
97 | } | ||
98 | |||
99 | View { | ||
100 | id: view | ||
101 | elevation: 2 | ||
102 | radius: 2 * Units.dp | ||
103 | anchors.left: __internal.left ? parent.left : undefined | ||
104 | anchors.right: __internal.right ? parent.right : undefined | ||
105 | anchors.top: __internal.top ? parent.top : undefined | ||
106 | anchors.bottom: __internal.bottom ? parent.bottom : undefined | ||
107 | anchors.horizontalCenter: __internal.center ? parent.horizontalCenter : undefined | ||
108 | anchors.verticalCenter: __internal.center ? parent.verticalCenter : undefined | ||
109 | } | ||
110 | |||
111 | state: showing ? "open" : "closed" | ||
112 | |||
113 | states: [ | ||
114 | State { | ||
115 | name: "closed" | ||
116 | PropertyChanges { | ||
117 | target: view | ||
118 | opacity: 0 | ||
119 | } | ||
120 | }, | ||
121 | |||
122 | State { | ||
123 | name: "open" | ||
124 | PropertyChanges { | ||
125 | target: view | ||
126 | opacity: 1 | ||
127 | width: dropdown.width | ||
128 | height: dropdown.height | ||
129 | } | ||
130 | } | ||
131 | ] | ||
132 | |||
133 | transitions: [ | ||
134 | Transition { | ||
135 | from: "open" | ||
136 | to: "closed" | ||
137 | |||
138 | NumberAnimation { | ||
139 | target: internalView | ||
140 | property: "opacity" | ||
141 | duration: 400 | ||
142 | easing.type: Easing.InOutQuad | ||
143 | } | ||
144 | |||
145 | SequentialAnimation { | ||
146 | |||
147 | PauseAnimation { | ||
148 | duration: 200 | ||
149 | } | ||
150 | |||
151 | NumberAnimation { | ||
152 | target: internalView | ||
153 | property: "width" | ||
154 | duration: 200 | ||
155 | easing.type: Easing.InOutQuad | ||
156 | } | ||
157 | } | ||
158 | |||
159 | NumberAnimation { | ||
160 | target: internalView | ||
161 | property: "height" | ||
162 | duration: 400 | ||
163 | easing.type: Easing.InOutQuad | ||
164 | } | ||
165 | }, | ||
166 | |||
167 | Transition { | ||
168 | from: "closed" | ||
169 | to: "open" | ||
170 | |||
171 | NumberAnimation { | ||
172 | target: internalView | ||
173 | property: "opacity" | ||
174 | duration: 400 | ||
175 | easing.type: Easing.InOutQuad | ||
176 | } | ||
177 | |||
178 | NumberAnimation { | ||
179 | target: internalView | ||
180 | property: "width" | ||
181 | duration: 200 | ||
182 | easing.type: Easing.InOutQuad | ||
183 | } | ||
184 | |||
185 | NumberAnimation { | ||
186 | target: internalView | ||
187 | property: "height" | ||
188 | duration: 400 | ||
189 | easing.type: Easing.InOutQuad | ||
190 | } | ||
191 | } | ||
192 | ] | ||
193 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/InputDialog.qml b/prototype_2016/third_party/qml-material/src/popups/InputDialog.qml deleted file mode 100644 index 8bcf81e..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/InputDialog.qml +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype InputDialog | ||
16 | \inqmlmodule Material | ||
17 | |||
18 | \brief A dialog with a single text field input. | ||
19 | */ | ||
20 | Dialog { | ||
21 | id: inputDialog | ||
22 | |||
23 | hasActions: true | ||
24 | |||
25 | positiveButtonEnabled: textField.acceptableInput | ||
26 | |||
27 | property alias textField: textField | ||
28 | |||
29 | property alias validator: textField.validator | ||
30 | property alias inputMask: textField.inputMask | ||
31 | property alias inputMethodHints: textField.inputMethodHints | ||
32 | |||
33 | property alias placeholderText: textField.placeholderText | ||
34 | property alias value: textField.text | ||
35 | |||
36 | TextField { | ||
37 | id: textField | ||
38 | |||
39 | anchors { | ||
40 | left: parent.left | ||
41 | right: parent.right | ||
42 | } | ||
43 | } | ||
44 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/MenuField.qml b/prototype_2016/third_party/qml-material/src/popups/MenuField.qml deleted file mode 100644 index f396ed1..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/MenuField.qml +++ /dev/null | |||
@@ -1,209 +0,0 @@ | |||
1 | /***** THIS FILE CANNOT BE RELICENSED UNDER THE MPL YET *****/ | ||
2 | |||
3 | /* | ||
4 | * QML Material - An application framework implementing Material Design. | ||
5 | * Copyright (C) 2015 Michael Spencer <sonrisesoftware@gmail.com> | ||
6 | * | ||
7 | * This program is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU Lesser General Public License as | ||
9 | * published by the Free Software Foundation, either version 2.1 of the | ||
10 | * License, or (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU Lesser General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU Lesser General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | import QtQuick 2.4 | ||
21 | import QtQuick.Layouts 1.1 | ||
22 | |||
23 | import Material 0.3 | ||
24 | import Material.ListItems 0.1 | ||
25 | |||
26 | /*! | ||
27 | \qmltype MenuField | ||
28 | \inqmlmodule Material | ||
29 | |||
30 | \brief A input field similar to a text field but that opens a dropdown menu. | ||
31 | */ | ||
32 | Item { | ||
33 | id: field | ||
34 | |||
35 | implicitHeight: hasHelperText ? helperTextLabel.y + helperTextLabel.height + 4 * Units.dp | ||
36 | : underline.y + 8 * Units.dp | ||
37 | implicitWidth: spinBoxContents.implicitWidth | ||
38 | |||
39 | activeFocusOnTab: true | ||
40 | |||
41 | property color accentColor: Theme.accentColor | ||
42 | property color errorColor: "#F44336" | ||
43 | |||
44 | property alias model: listView.model | ||
45 | |||
46 | property string textRole | ||
47 | |||
48 | readonly property string selectedText: (listView.currentItem) ? listView.currentItem.text : "" | ||
49 | |||
50 | property alias selectedIndex: listView.currentIndex | ||
51 | property int maxVisibleItems: 4 | ||
52 | |||
53 | property alias placeholderText: fieldPlaceholder.text | ||
54 | property alias helperText: helperTextLabel.text | ||
55 | |||
56 | property bool floatingLabel: false | ||
57 | property bool hasError: false | ||
58 | property bool hasHelperText: helperText.length > 0 | ||
59 | |||
60 | readonly property rect inputRect: Qt.rect(spinBox.x, spinBox.y, spinBox.width, spinBox.height) | ||
61 | |||
62 | signal itemSelected(int index) | ||
63 | |||
64 | Ink { | ||
65 | anchors.fill: parent | ||
66 | onClicked: { | ||
67 | listView.positionViewAtIndex(listView.currentIndex, ListView.Center) | ||
68 | var offset = listView.currentItem.itemLabel.mapToItem(menu, 0, 0) | ||
69 | menu.open(label, 0, -offset.y) | ||
70 | } | ||
71 | } | ||
72 | |||
73 | Item { | ||
74 | id: spinBox | ||
75 | |||
76 | height: 24 * Units.dp | ||
77 | width: parent.width | ||
78 | |||
79 | y: { | ||
80 | if(!floatingLabel) | ||
81 | return 16 * Units.dp | ||
82 | if(floatingLabel && !hasHelperText) | ||
83 | return 40 * Units.dp | ||
84 | return 28 * Units.dp | ||
85 | } | ||
86 | |||
87 | RowLayout { | ||
88 | id: spinBoxContents | ||
89 | |||
90 | height: parent.height | ||
91 | width: parent.width + 5 * Units.dp | ||
92 | |||
93 | Label { | ||
94 | id: label | ||
95 | |||
96 | Layout.fillWidth: true | ||
97 | Layout.alignment: Qt.AlignVCenter | ||
98 | |||
99 | text: (listView.currentItem) ? listView.currentItem.text : "" | ||
100 | style: "subheading" | ||
101 | elide: Text.ElideRight | ||
102 | } | ||
103 | |||
104 | Icon { | ||
105 | id: dropDownIcon | ||
106 | |||
107 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
108 | Layout.preferredWidth: 24 * Units.dp | ||
109 | Layout.preferredHeight: 24 * Units.dp | ||
110 | |||
111 | name: "navigation/arrow_drop_down" | ||
112 | size: 24 * Units.dp | ||
113 | } | ||
114 | } | ||
115 | |||
116 | Dropdown { | ||
117 | id: menu | ||
118 | |||
119 | anchor: Item.TopLeft | ||
120 | |||
121 | width: spinBox.width | ||
122 | |||
123 | //If there are more than max items, show an extra half item so | ||
124 | // it's clear the user can scroll | ||
125 | height: Math.min(maxVisibleItems*48 * Units.dp + 24 * Units.dp, listView.contentHeight) | ||
126 | |||
127 | ListView { | ||
128 | id: listView | ||
129 | |||
130 | width: menu.width | ||
131 | height: count > 0 ? menu.height : 0 | ||
132 | |||
133 | interactive: true | ||
134 | |||
135 | delegate: Standard { | ||
136 | id: delegateItem | ||
137 | |||
138 | text: textRole ? model[textRole] : modelData | ||
139 | |||
140 | onClicked: { | ||
141 | itemSelected(index) | ||
142 | listView.currentIndex = index | ||
143 | menu.close() | ||
144 | } | ||
145 | } | ||
146 | } | ||
147 | |||
148 | Scrollbar { | ||
149 | flickableItem: listView | ||
150 | } | ||
151 | } | ||
152 | } | ||
153 | |||
154 | Label { | ||
155 | id: fieldPlaceholder | ||
156 | |||
157 | text: field.placeholderText | ||
158 | visible: floatingLabel | ||
159 | |||
160 | font.pixelSize: 12 * Units.dp | ||
161 | |||
162 | anchors.bottom: spinBox.top | ||
163 | anchors.bottomMargin: 8 * Units.dp | ||
164 | |||
165 | color: Theme.light.hintColor | ||
166 | } | ||
167 | |||
168 | Rectangle { | ||
169 | id: underline | ||
170 | |||
171 | color: field.hasError ? field.errorColor : field.activeFocus ? field.accentColor : Theme.light.hintColor | ||
172 | |||
173 | height: field.activeFocus ? 2 * Units.dp : 1 * Units.dp | ||
174 | |||
175 | anchors { | ||
176 | left: parent.left | ||
177 | right: parent.right | ||
178 | top: spinBox.bottom | ||
179 | topMargin: 8 * Units.dp | ||
180 | } | ||
181 | |||
182 | Behavior on height { | ||
183 | NumberAnimation { duration: 200 } | ||
184 | } | ||
185 | |||
186 | Behavior on color { | ||
187 | ColorAnimation { duration: 200 } | ||
188 | } | ||
189 | } | ||
190 | |||
191 | Label { | ||
192 | id: helperTextLabel | ||
193 | |||
194 | anchors { | ||
195 | left: parent.left | ||
196 | right: parent.right | ||
197 | top: underline.top | ||
198 | topMargin: 4 * Units.dp | ||
199 | } | ||
200 | |||
201 | visible: hasHelperText | ||
202 | font.pixelSize: 12 * Units.dp | ||
203 | color: field.hasError ? field.errorColor : Qt.darker(Theme.light.hintColor) | ||
204 | |||
205 | Behavior on color { | ||
206 | ColorAnimation { duration: 200 } | ||
207 | } | ||
208 | } | ||
209 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/Popover.qml b/prototype_2016/third_party/qml-material/src/popups/Popover.qml deleted file mode 100644 index 68c7a05..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/Popover.qml +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import Material.Extras 0.1 | ||
14 | |||
15 | /*! | ||
16 | \qmltype Tooltip | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A tooltip is a label that appears on hover and explains a non-text UI element. | ||
20 | |||
21 | To display a tooltip for your view, simply create an instance of Tooltip, | ||
22 | set the text property to your tooltip text, and then set the mouseArea property | ||
23 | to your MouseArea or Ink that will trigger the tooltip. If you use a MouseArea, | ||
24 | make sure hoverEnabled is set to true. | ||
25 | |||
26 | See the Material Design guidelines for more details: | ||
27 | http://www.google.com/design/spec/components/tooltips.html | ||
28 | */ | ||
29 | PopupBase { | ||
30 | id: popover | ||
31 | |||
32 | visible: view.opacity > 0 | ||
33 | closeOnResize: true | ||
34 | |||
35 | property bool isBelow | ||
36 | |||
37 | property alias backgroundColor: view.backgroundColor | ||
38 | |||
39 | property int padding: 16 * Units.dp | ||
40 | |||
41 | default property alias data: view.data | ||
42 | |||
43 | function open(caller, offsetX, offsetY) { | ||
44 | parent = Utils.findRootChild(popover, overlayLayer) | ||
45 | |||
46 | if (!parent.enabled) | ||
47 | return | ||
48 | |||
49 | if (parent.currentOverlay) | ||
50 | parent.currentOverlay.close() | ||
51 | |||
52 | if(typeof offsetX === "undefined") | ||
53 | offsetX = 0 | ||
54 | |||
55 | if(typeof offsetY === "undefined") | ||
56 | offsetY = 0 | ||
57 | |||
58 | var position = caller.mapToItem(popover.parent, 0, 0) | ||
59 | var globalPos = caller.mapToItem(null, 0, 0) | ||
60 | var root = Utils.findRoot(popover) | ||
61 | |||
62 | popover.x = Qt.binding(function() { | ||
63 | var x = position.x + (caller.width / 2 - popover.width / 2) + offsetX | ||
64 | |||
65 | if(x + width > root.width - padding) | ||
66 | x = root.width - width - padding | ||
67 | |||
68 | if (x < padding) | ||
69 | x = padding | ||
70 | |||
71 | return x | ||
72 | }) | ||
73 | |||
74 | popover.y = Qt.binding(function() { | ||
75 | var y = y = position.y + caller.height + offsetY | ||
76 | |||
77 | if (y + popover.height > root.height - padding) { | ||
78 | isBelow = false | ||
79 | y = position.y - popover.height - offsetY | ||
80 | } else { | ||
81 | isBelow = true | ||
82 | } | ||
83 | |||
84 | return y | ||
85 | }) | ||
86 | |||
87 | showing = true | ||
88 | parent.currentOverlay = popover | ||
89 | |||
90 | opened() | ||
91 | } | ||
92 | |||
93 | function close() { | ||
94 | showing = false | ||
95 | parent.currentOverlay = null | ||
96 | } | ||
97 | |||
98 | View { | ||
99 | id: view | ||
100 | |||
101 | elevation: 2 | ||
102 | radius: 2 * Units.dp | ||
103 | |||
104 | anchors { | ||
105 | left: parent.left | ||
106 | right: parent.right | ||
107 | top: isBelow ? parent.top : undefined | ||
108 | topMargin: popover.showing ? 0 : -popover.height/4 | ||
109 | bottom: !isBelow ? parent.bottom : undefined | ||
110 | bottomMargin: popover.showing ? 0 : -popover.height/4 | ||
111 | |||
112 | Behavior on topMargin { | ||
113 | NumberAnimation { duration: 200 } | ||
114 | } | ||
115 | |||
116 | Behavior on bottomMargin { | ||
117 | NumberAnimation { duration: 200 } | ||
118 | } | ||
119 | } | ||
120 | |||
121 | height: popover.height | ||
122 | |||
123 | opacity: popover.showing ? 1 : 0 | ||
124 | |||
125 | Behavior on opacity { | ||
126 | NumberAnimation { duration: 200 } | ||
127 | } | ||
128 | } | ||
129 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/PopupBase.qml b/prototype_2016/third_party/qml-material/src/popups/PopupBase.qml deleted file mode 100644 index b0bb43f..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/PopupBase.qml +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Window 2.2 | ||
13 | import Material 0.3 | ||
14 | import Material.Extras 0.1 | ||
15 | |||
16 | /*! | ||
17 | \qmltype PopupBase | ||
18 | \inqmlmodule Material | ||
19 | |||
20 | \brief A base class for popups such as dialogs or dropdowns. | ||
21 | */ | ||
22 | FocusScope { | ||
23 | id: popup | ||
24 | |||
25 | property color overlayColor: "transparent" | ||
26 | property string overlayLayer: "overlayLayer" | ||
27 | property bool globalMouseAreaEnabled: true | ||
28 | property bool dismissOnTap: true | ||
29 | property bool showing: false | ||
30 | property bool closeOnResize: false | ||
31 | property Item __lastFocusedItem | ||
32 | |||
33 | signal opened | ||
34 | signal closed | ||
35 | |||
36 | function toggle(widget) { | ||
37 | if (showing) { | ||
38 | close() | ||
39 | } else { | ||
40 | open(widget) | ||
41 | } | ||
42 | } | ||
43 | |||
44 | function open() { | ||
45 | __lastFocusedItem = Window.activeFocusItem | ||
46 | parent = Utils.findRootChild(popup, overlayLayer) | ||
47 | |||
48 | if (!parent.enabled) | ||
49 | return | ||
50 | |||
51 | showing = true | ||
52 | forceActiveFocus() | ||
53 | parent.currentOverlay = popup | ||
54 | |||
55 | opened() | ||
56 | } | ||
57 | |||
58 | function close() { | ||
59 | showing = false | ||
60 | |||
61 | if (parent.hasOwnProperty("currentOverlay")) { | ||
62 | parent.currentOverlay = null | ||
63 | } | ||
64 | |||
65 | if (__lastFocusedItem !== null) { | ||
66 | __lastFocusedItem.forceActiveFocus() | ||
67 | } | ||
68 | |||
69 | closed() | ||
70 | } | ||
71 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/TimePickerDialog.qml b/prototype_2016/third_party/qml-material/src/popups/TimePickerDialog.qml deleted file mode 100644 index e5058ad..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/TimePickerDialog.qml +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | Dialog { | ||
15 | contentMargins: 0 | ||
16 | hasActions: true | ||
17 | floatingActions: true | ||
18 | |||
19 | property alias isHours: timePicker.isHours | ||
20 | property alias prefer24Hour: timePicker.prefer24Hour | ||
21 | signal timePicked(date timePicked) | ||
22 | |||
23 | TimePicker { | ||
24 | id: timePicker | ||
25 | isHours: true | ||
26 | bottomMargin: 48 * Units.dp | ||
27 | } | ||
28 | |||
29 | onAccepted: { | ||
30 | timePicked(timePicker.getCurrentTime()) | ||
31 | timePicker.reset() | ||
32 | } | ||
33 | |||
34 | onRejected: { | ||
35 | timePicker.reset() | ||
36 | } | ||
37 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/popups/popups.qrc b/prototype_2016/third_party/qml-material/src/popups/popups.qrc deleted file mode 100644 index 8eeeca5..0000000 --- a/prototype_2016/third_party/qml-material/src/popups/popups.qrc +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/Material"> | ||
5 | <file>BottomActionSheet.qml</file> | ||
6 | <file>BottomSheet.qml</file> | ||
7 | <file>Dialog.qml</file> | ||
8 | <file>Dropdown.qml</file> | ||
9 | <file>InputDialog.qml</file> | ||
10 | <file>MenuField.qml</file> | ||
11 | <file>Popover.qml</file> | ||
12 | <file>PopupBase.qml</file> | ||
13 | <file>TimePickerDialog.qml</file> | ||
14 | </qresource> | ||
15 | |||
16 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/qmldir b/prototype_2016/third_party/qml-material/src/qmldir deleted file mode 100644 index 99e723e..0000000 --- a/prototype_2016/third_party/qml-material/src/qmldir +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | module Material | ||
2 | |||
3 | # This will be automatically uncommented when installing globally | ||
4 | # plugin material | ||
5 | |||
6 | # Components | ||
7 | ActionButton 0.1 ActionButton.qml | ||
8 | Card 0.1 Card.qml | ||
9 | DatePicker 0.2 DatePicker.qml | ||
10 | IconButton 0.1 IconButton.qml | ||
11 | ProgressCircle 0.1 ProgressCircle.qml | ||
12 | Scrollbar 0.1 Scrollbar.qml | ||
13 | Snackbar 0.1 Snackbar.qml | ||
14 | ThinDivider 0.1 ThinDivider.qml | ||
15 | TimePicker 0.2 TimePicker.qml | ||
16 | Tooltip 0.1 Tooltip.qml | ||
17 | Wave 0.1 Wave.qml | ||
18 | |||
19 | # Controls | ||
20 | Action 0.1 Action.qml | ||
21 | Button 0.1 Button.qml | ||
22 | CheckBox 0.1 CheckBox.qml | ||
23 | Label 0.1 Label.qml | ||
24 | ProgressBar 0.1 ProgressBar.qml | ||
25 | RadioButton 0.1 RadioButton.qml | ||
26 | Slider 0.1 Slider.qml | ||
27 | Switch 0.1 Switch.qml | ||
28 | Tab 0.1 Tab.qml | ||
29 | TextField 0.1 TextField.qml | ||
30 | |||
31 | # Core | ||
32 | AwesomeIcon 0.1 AwesomeIcon.qml | ||
33 | Icon 0.1 Icon.qml | ||
34 | Ink 0.1 Ink.qml | ||
35 | Object 0.1 Object.qml | ||
36 | PlatformExtensions 0.2 PlatformExtensions.qml | ||
37 | UnitsHelper 0.3 UnitsHelper.qml | ||
38 | View 0.1 View.qml | ||
39 | Utils 0.3 utils.js | ||
40 | singleton MaterialAnimation 0.1 MaterialAnimation.qml | ||
41 | singleton Palette 0.1 Palette.qml | ||
42 | singleton Theme 0.1 Theme.qml | ||
43 | |||
44 | # Popups | ||
45 | BottomActionSheet 0.1 BottomActionSheet.qml | ||
46 | BottomSheet 0.1 BottomSheet.qml | ||
47 | Dialog 0.1 Dialog.qml | ||
48 | Dropdown 0.1 Dropdown.qml | ||
49 | InputDialog 0.1 InputDialog.qml | ||
50 | MenuField 0.1 MenuField.qml | ||
51 | Popover 0.2 Popover.qml | ||
52 | PopupBase 0.1 PopupBase.qml | ||
53 | TimePickerDialog 0.2 TimePickerDialog.qml | ||
54 | |||
55 | # Window | ||
56 | ActionBar 0.1 ActionBar.qml | ||
57 | AppTheme 0.1 AppTheme.qml | ||
58 | ApplicationWindow 0.1 ApplicationWindow.qml | ||
59 | MainView 0.1 MainView.qml | ||
60 | NavigationDrawer 0.1 NavigationDrawer.qml | ||
61 | NavigationDrawerPage 0.2 NavigationDrawerPage.qml | ||
62 | OverlayLayer 0.1 OverlayLayer.qml | ||
63 | OverlayView 0.1 OverlayView.qml | ||
64 | Page 0.1 Page.qml | ||
65 | PageSidebar 0.1 PageSidebar.qml | ||
66 | PageStack 0.1 PageStack.qml | ||
67 | Window 0.1 Window.qml | ||
68 | Sidebar 0.1 Sidebar.qml | ||
69 | TabBar 0.1 TabBar.qml | ||
70 | TabbedPage 0.2 TabbedPage.qml | ||
71 | Toolbar 0.1 Toolbar.qml | ||
diff --git a/prototype_2016/third_party/qml-material/src/src.pro b/prototype_2016/third_party/qml-material/src/src.pro deleted file mode 100644 index 53d1118..0000000 --- a/prototype_2016/third_party/qml-material/src/src.pro +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | TEMPLATE = lib | ||
2 | TARGET = material | ||
3 | |||
4 | CONFIG += c++11 | ||
5 | QT += qml quick | ||
6 | |||
7 | |||
8 | android { | ||
9 | QT += androidextras svg xml | ||
10 | } | ||
11 | |||
12 | HEADERS += plugin.h \ | ||
13 | core/device.h \ | ||
14 | core/units.h | ||
15 | |||
16 | SOURCES += plugin.cpp \ | ||
17 | core/device.cpp \ | ||
18 | core/units.cpp | ||
19 | |||
20 | RESOURCES += ../icons/core_icons.qrc | ||
21 | |||
22 | isEmpty(MODULE_INSTALL_PATH) { | ||
23 | MODULE_INSTALL_PATH = $$[QT_INSTALL_QML] | ||
24 | } | ||
25 | |||
26 | target.path = $$MODULE_INSTALL_PATH/Material | ||
27 | |||
28 | material.files += \ | ||
29 | components/* \ | ||
30 | controls/* \ | ||
31 | core/* \ | ||
32 | popups/* \ | ||
33 | window/* | ||
34 | material.path = $$MODULE_INSTALL_PATH/Material | ||
35 | |||
36 | extras.files += extras/* | ||
37 | extras.path = $$MODULE_INSTALL_PATH/Material/Extras | ||
38 | |||
39 | listitems.files += listitems/* | ||
40 | listitems.path = $$MODULE_INSTALL_PATH/Material/ListItems | ||
41 | |||
42 | styles.files += styles/* | ||
43 | styles.path = $$MODULE_INSTALL_PATH/QtQuick/Controls/Styles/Material | ||
44 | |||
45 | qmldir.target = $$OUT_PWD/out/qmldir | ||
46 | qmldir.commands = mkdir -p $$OUT_PWD/out; | ||
47 | qmldir.commands += sed \"s/$$LITERAL_HASH plugin material/plugin material/\" $$PWD/qmldir > $$qmldir.target | ||
48 | qmldir.depends = $$PWD/qmldir | ||
49 | qmldir.path = $$MODULE_INSTALL_PATH/Material | ||
50 | qmldir.files = $$qmldir.target | ||
51 | qmldir.CONFIG += no_check_exist | ||
52 | |||
53 | INSTALLS += target material extras listitems styles qmldir | ||
54 | |||
55 | OTHER_FILES += $$material.files $$extras.files $$listitems.files $$styles.files | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/ApplicationWindowStyle.qml b/prototype_2016/third_party/qml-material/src/styles/ApplicationWindowStyle.qml deleted file mode 100644 index 99fb0fa..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/ApplicationWindowStyle.qml +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | |||
15 | ApplicationWindowStyle { | ||
16 | background: Rectangle { | ||
17 | color: Theme.backgroundColor | ||
18 | } | ||
19 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/ButtonStyle.qml b/prototype_2016/third_party/qml-material/src/styles/ButtonStyle.qml deleted file mode 100644 index 4478a9c..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/ButtonStyle.qml +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | |||
15 | ButtonStyle { | ||
16 | id: style | ||
17 | |||
18 | padding { | ||
19 | left: 0 | ||
20 | right: 0 | ||
21 | top: 0 | ||
22 | bottom: 0 | ||
23 | } | ||
24 | |||
25 | property bool darkBackground: control.hasOwnProperty("darkBackground") | ||
26 | ? control.darkBackground : Theme.isDarkColor(controlBackground) | ||
27 | |||
28 | property int controlElevation: control.hasOwnProperty("elevation") ? control.elevation : 1 | ||
29 | |||
30 | property color controlBackground: control.hasOwnProperty("backgroundColor") | ||
31 | ? control.backgroundColor : controlElevation == 0 ? "transparent" : "white" | ||
32 | |||
33 | property string context: control.hasOwnProperty("context") ? control.context : "default" | ||
34 | |||
35 | background: View { | ||
36 | id: background | ||
37 | |||
38 | implicitHeight: 36 * Units.dp | ||
39 | |||
40 | radius: 2 * Units.dp | ||
41 | |||
42 | backgroundColor: control.enabled || controlElevation === 0 | ||
43 | ? controlBackground | ||
44 | : darkBackground ? Qt.rgba(1, 1, 1, 0.12) | ||
45 | : Qt.rgba(0, 0, 0, 0.12) | ||
46 | |||
47 | elevation: { | ||
48 | var elevation = controlElevation | ||
49 | |||
50 | if (elevation > 0 && (control.focus || mouseArea.currentCircle)) | ||
51 | elevation++; | ||
52 | |||
53 | if(!control.enabled) | ||
54 | elevation = 0; | ||
55 | |||
56 | return elevation; | ||
57 | } | ||
58 | |||
59 | tintColor: mouseArea.currentCircle || control.focus || control.hovered | ||
60 | ? Qt.rgba(0,0,0, mouseArea.currentCircle ? 0.1 | ||
61 | : elevation > 0 ? 0.03 | ||
62 | : 0.05) | ||
63 | : "transparent" | ||
64 | |||
65 | Ink { | ||
66 | id: mouseArea | ||
67 | |||
68 | anchors.fill: parent | ||
69 | focused: control.focus && background.context !== "dialog" | ||
70 | && background.context !== "snackbar" | ||
71 | focusWidth: parent.width - 30 * Units.dp | ||
72 | focusColor: Qt.darker(background.backgroundColor, 1.05) | ||
73 | |||
74 | Connections { | ||
75 | target: control.__behavior | ||
76 | onPressed: mouseArea.onPressed(mouse) | ||
77 | onCanceled: mouseArea.onCanceled() | ||
78 | onReleased: mouseArea.onReleased(mouse) | ||
79 | } | ||
80 | } | ||
81 | } | ||
82 | label: Item { | ||
83 | implicitHeight: Math.max(36 * Units.dp, label.height + 16 * Units.dp) | ||
84 | implicitWidth: context == "dialog" | ||
85 | ? Math.max(64 * Units.dp, label.width + 16 * Units.dp) | ||
86 | : context == "snackbar" ? label.width + 16 * Units.dp | ||
87 | : Math.max(88 * Units.dp, label.width + 32 * Units.dp) | ||
88 | |||
89 | Label { | ||
90 | id: label | ||
91 | anchors.centerIn: parent | ||
92 | text: control.text | ||
93 | style: "button" | ||
94 | color: control.enabled ? control.hasOwnProperty("textColor") | ||
95 | ? control.textColor : darkBackground ? Theme.dark.textColor | ||
96 | : Theme.light.textColor | ||
97 | : control.darkBackground ? Qt.rgba(1, 1, 1, 0.30) | ||
98 | : Qt.rgba(0, 0, 0, 0.26) | ||
99 | } | ||
100 | } | ||
101 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/CMakeLists.txt b/prototype_2016/third_party/qml-material/src/styles/CMakeLists.txt deleted file mode 100644 index 3d1f1f6..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/CMakeLists.txt +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | file(GLOB QML_FILES *.qml) | ||
2 | |||
3 | install(FILES ${QML_FILES} qmldir | ||
4 | DESTINATION ${QML_INSTALL_DIR}/QtQuick/Controls/Styles/Material) | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/CheckBoxStyle.qml b/prototype_2016/third_party/qml-material/src/styles/CheckBoxStyle.qml deleted file mode 100644 index be90649..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/CheckBoxStyle.qml +++ /dev/null | |||
@@ -1,175 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | |||
15 | CheckBoxStyle { | ||
16 | id: style | ||
17 | |||
18 | property color color: control.hasOwnProperty("color") | ||
19 | ? control.color : Theme.light.accentColor | ||
20 | |||
21 | property bool darkBackground: control.hasOwnProperty("darkBackground") | ||
22 | ? control.darkBackground : false | ||
23 | |||
24 | spacing: 0 | ||
25 | |||
26 | label: Item { | ||
27 | implicitWidth: control.text !== "" ? text.implicitWidth + 2 : 0 | ||
28 | implicitHeight: text.implicitHeight | ||
29 | |||
30 | baselineOffset: text.baselineOffset | ||
31 | |||
32 | Label { | ||
33 | id: text | ||
34 | |||
35 | anchors.centerIn: parent | ||
36 | |||
37 | property bool darkBackground: control.hasOwnProperty("darkBackground") | ||
38 | ? control.darkBackground : false | ||
39 | |||
40 | style: "button" | ||
41 | color: control.enabled ? darkBackground ? Theme.dark.textColor | ||
42 | : Theme.light.textColor | ||
43 | : darkBackground ? Theme.alpha("#fff", 0.30) | ||
44 | : Theme.alpha("#000", 0.26) | ||
45 | text: control.text | ||
46 | } | ||
47 | } | ||
48 | |||
49 | indicator: Item { | ||
50 | id: parentRect | ||
51 | |||
52 | implicitWidth: 48 * Units.dp | ||
53 | implicitHeight: implicitWidth | ||
54 | |||
55 | Rectangle { | ||
56 | id: indicatorRect | ||
57 | |||
58 | anchors.centerIn: parent | ||
59 | |||
60 | property color __internalColor: control.enabled | ||
61 | ? style.color | ||
62 | : style.darkBackground ? Theme.alpha("#fff", 0.30) | ||
63 | : Theme.alpha("#000", 0.26) | ||
64 | |||
65 | width: 18 * Units.dp | ||
66 | height: width | ||
67 | radius: 2 * Units.dp | ||
68 | |||
69 | border.width: 2 * Units.dp | ||
70 | |||
71 | border.color: control.enabled | ||
72 | ? control.checked ? style.color | ||
73 | : style.darkBackground ? Theme.alpha("#fff", 0.70) | ||
74 | : Theme.alpha("#000", 0.54) | ||
75 | : style.darkBackground ? Theme.alpha("#fff", 0.30) | ||
76 | : Theme.alpha("#000", 0.26) | ||
77 | |||
78 | color: control.checked ? __internalColor : "transparent" | ||
79 | |||
80 | Behavior on color { | ||
81 | ColorAnimation { | ||
82 | easing.type: Easing.InOutQuad | ||
83 | duration: 200 | ||
84 | } | ||
85 | } | ||
86 | |||
87 | Behavior on border.color { | ||
88 | ColorAnimation { | ||
89 | easing.type: Easing.InOutQuad | ||
90 | duration: 200 | ||
91 | } | ||
92 | } | ||
93 | |||
94 | Item { | ||
95 | id: container | ||
96 | |||
97 | anchors.centerIn: indicatorRect | ||
98 | |||
99 | height: parent.height | ||
100 | width: parent.width | ||
101 | |||
102 | opacity: control.checked ? 1 : 0 | ||
103 | |||
104 | property int thickness: 3 * Units.dp | ||
105 | |||
106 | Behavior on opacity { | ||
107 | NumberAnimation { | ||
108 | easing.type: Easing.InOutQuad | ||
109 | duration: 200 | ||
110 | } | ||
111 | } | ||
112 | |||
113 | Rectangle { | ||
114 | id: vert | ||
115 | |||
116 | anchors { | ||
117 | top: parent.top | ||
118 | right: parent.right | ||
119 | bottom: parent.bottom | ||
120 | } | ||
121 | |||
122 | radius: 1 * Units.dp | ||
123 | color: style.darkBackground ? Theme.light.textColor : Theme.dark.textColor | ||
124 | width: container.thickness * 2 | ||
125 | |||
126 | } | ||
127 | Rectangle { | ||
128 | anchors { | ||
129 | left: parent.left | ||
130 | right: parent.right | ||
131 | bottom: parent.bottom | ||
132 | } | ||
133 | |||
134 | radius: 1 * Units.dp | ||
135 | color: style.darkBackground ? Theme.light.textColor : Theme.dark.textColor | ||
136 | height: container.thickness | ||
137 | } | ||
138 | |||
139 | transform: [ | ||
140 | Scale { | ||
141 | origin { x: container.width / 2; y: container.height / 2 } | ||
142 | xScale: 0.5 | ||
143 | yScale: 1 | ||
144 | }, | ||
145 | Rotation { | ||
146 | origin { x: container.width / 2; y: container.height / 2 } | ||
147 | angle: 45; | ||
148 | }, | ||
149 | Scale { | ||
150 | id: widthScale | ||
151 | |||
152 | origin { x: container.width / 2; y: container.height / 2 } | ||
153 | xScale: control.checked ? 0.6 : 0.2 | ||
154 | yScale: control.checked ? 0.6 : 0.2 | ||
155 | |||
156 | Behavior on xScale { | ||
157 | NumberAnimation { | ||
158 | easing.type: Easing.InOutQuad | ||
159 | duration: 200 | ||
160 | } | ||
161 | } | ||
162 | |||
163 | Behavior on yScale { | ||
164 | NumberAnimation { | ||
165 | easing.type: Easing.InOutQuad | ||
166 | duration: 200 | ||
167 | } | ||
168 | } | ||
169 | }, | ||
170 | Translate { y: -(container.height - (container.height * 0.9)) } | ||
171 | ] | ||
172 | } | ||
173 | } | ||
174 | } | ||
175 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/ProgressBarStyle.qml b/prototype_2016/third_party/qml-material/src/styles/ProgressBarStyle.qml deleted file mode 100644 index 57f4157..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/ProgressBarStyle.qml +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Controls.Styles 1.3 | ||
14 | import Material 0.3 | ||
15 | |||
16 | ProgressBarStyle { | ||
17 | id: progressBarStyle | ||
18 | |||
19 | progress: Rectangle { | ||
20 | color: control.indeterminate ? "transparent" : control.color | ||
21 | |||
22 | // Indeterminate animation | ||
23 | Item { | ||
24 | id: independentRect | ||
25 | anchors.fill: parent | ||
26 | visible: control.indeterminate | ||
27 | Rectangle { | ||
28 | id: rect | ||
29 | property int end: 0 | ||
30 | width: end - x | ||
31 | height: control.height | ||
32 | color: control.color | ||
33 | ParallelAnimation { | ||
34 | running: control.indeterminate | ||
35 | SequentialAnimation { | ||
36 | loops: Animation.Infinite | ||
37 | PauseAnimation { | ||
38 | duration: 500 | ||
39 | } | ||
40 | |||
41 | NumberAnimation{ | ||
42 | target: rect; property: "x" | ||
43 | from: 0; to: control.width | ||
44 | duration: 1500 | ||
45 | easing.type: Easing.InCubic | ||
46 | } | ||
47 | } | ||
48 | SequentialAnimation { | ||
49 | loops: Animation.Infinite | ||
50 | NumberAnimation { | ||
51 | target: rect; property: "end" | ||
52 | from: 0; to: control.width | ||
53 | duration: 1500 | ||
54 | } | ||
55 | PauseAnimation { | ||
56 | duration: 500 | ||
57 | } | ||
58 | ScriptAction { | ||
59 | script: rect.x = 0 | ||
60 | } | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | } | ||
65 | } | ||
66 | |||
67 | panel: Item { | ||
68 | property bool horizontal: control.orientation == Qt.Horizontal | ||
69 | implicitWidth: horizontal ? backgroundLoader.implicitWidth : backgroundLoader.implicitHeight | ||
70 | implicitHeight: horizontal ? backgroundLoader.implicitHeight : backgroundLoader.implicitWidth | ||
71 | |||
72 | Item { | ||
73 | width: horizontal ? parent.width : parent.height | ||
74 | height: !horizontal ? parent.width : parent.height | ||
75 | y: horizontal ? 0 : width | ||
76 | rotation: horizontal ? 0 : -90 | ||
77 | transformOrigin: Item.TopLeft | ||
78 | |||
79 | Rectangle { | ||
80 | id: backgroundLoader | ||
81 | implicitWidth: control.width | ||
82 | implicitHeight: control.height | ||
83 | color: control.color | ||
84 | opacity: 0.2 | ||
85 | } | ||
86 | |||
87 | Loader { | ||
88 | sourceComponent: progressBarStyle.progress | ||
89 | anchors.topMargin: padding.top | ||
90 | anchors.leftMargin: padding.left | ||
91 | anchors.rightMargin: padding.right | ||
92 | anchors.bottomMargin: padding.bottom | ||
93 | |||
94 | anchors.top: parent.top | ||
95 | anchors.left: parent.left | ||
96 | anchors.bottom: parent.bottom | ||
97 | width: currentProgress * (parent.width - padding.left - padding.right) | ||
98 | } | ||
99 | } | ||
100 | } | ||
101 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/RadioButtonStyle.qml b/prototype_2016/third_party/qml-material/src/styles/RadioButtonStyle.qml deleted file mode 100644 index fe027cc..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/RadioButtonStyle.qml +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | |||
15 | RadioButtonStyle { | ||
16 | id: style | ||
17 | |||
18 | spacing: 0 | ||
19 | |||
20 | property color color: control.hasOwnProperty("color") | ||
21 | ? control.color : Theme.light.accentColor | ||
22 | |||
23 | property bool darkBackground: control.hasOwnProperty("darkBackground") | ||
24 | ? control.darkBackground : false | ||
25 | |||
26 | label: Label { | ||
27 | text: control.text | ||
28 | style: "button" | ||
29 | color: control.enabled ? style.darkBackground ? Theme.dark.textColor | ||
30 | : Theme.light.textColor | ||
31 | : style.darkBackground ? Theme.alpha("#fff", 0.30) | ||
32 | : Theme.alpha("#000", 0.26) | ||
33 | } | ||
34 | |||
35 | background: Rectangle { | ||
36 | color: "transparent" | ||
37 | } | ||
38 | |||
39 | indicator: Rectangle { | ||
40 | implicitWidth: 48 * Units.dp | ||
41 | implicitHeight: 48 * Units.dp | ||
42 | radius: implicitHeight / 2 | ||
43 | color: control.activeFocus ? Theme.alpha(control.color, 0.20) : "transparent" | ||
44 | |||
45 | Rectangle { | ||
46 | anchors.centerIn: parent | ||
47 | |||
48 | implicitWidth: 20 * Units.dp | ||
49 | implicitHeight: 20 * Units.dp | ||
50 | radius: implicitHeight / 2 | ||
51 | color: "transparent" | ||
52 | |||
53 | border.color: control.enabled | ||
54 | ? control.checked ? style.color | ||
55 | : style.darkBackground ? Theme.alpha("#fff", 0.70) | ||
56 | : Theme.alpha("#000", 0.54) | ||
57 | : style.darkBackground ? Theme.alpha("#fff", 0.30) | ||
58 | : Theme.alpha("#000", 0.26) | ||
59 | |||
60 | border.width: 2 * Units.dp | ||
61 | antialiasing: true | ||
62 | |||
63 | Behavior on border.color { | ||
64 | ColorAnimation { duration: 200} | ||
65 | } | ||
66 | |||
67 | Rectangle { | ||
68 | anchors { | ||
69 | centerIn: parent | ||
70 | alignWhenCentered: false | ||
71 | } | ||
72 | implicitWidth: control.checked ? 10 * Units.dp : 0 | ||
73 | implicitHeight: control.checked ? 10 * Units.dp : 0 | ||
74 | color: control.enabled ? style.color | ||
75 | : style.darkBackground ? Theme.alpha("#fff", 0.30) | ||
76 | : Theme.alpha("#000", 0.26) | ||
77 | radius: implicitHeight / 2 | ||
78 | antialiasing: true | ||
79 | |||
80 | Behavior on implicitWidth { | ||
81 | NumberAnimation { duration: 200 } | ||
82 | } | ||
83 | |||
84 | Behavior on implicitHeight { | ||
85 | NumberAnimation { duration: 200 } | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/SliderStyle.qml b/prototype_2016/third_party/qml-material/src/styles/SliderStyle.qml deleted file mode 100644 index e5ccf01..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/SliderStyle.qml +++ /dev/null | |||
@@ -1,243 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | |||
15 | SliderStyle { | ||
16 | id: style | ||
17 | |||
18 | property color color: control.hasOwnProperty("color") | ||
19 | ? control.color : Theme.light.accentColor | ||
20 | |||
21 | property bool darkBackground: control.hasOwnProperty("darkBackground") | ||
22 | ? control.darkBackground : false | ||
23 | |||
24 | property bool numericValueLabel: control.hasOwnProperty("numericValueLabel") | ||
25 | ? control.numericValueLabel : false | ||
26 | |||
27 | property bool alwaysShowValueLabel: control.hasOwnProperty("alwaysShowValueLabel") | ||
28 | ? control.alwaysShowValueLabel : false | ||
29 | |||
30 | property string knobLabel: control.hasOwnProperty("knobLabel") | ||
31 | ? control.knobLabel : control.value | ||
32 | |||
33 | property int knobDiameter: control.hasOwnProperty("knobDiameter") | ||
34 | ? control.knobDiameter : 32 * Units.dp | ||
35 | |||
36 | property Component knob : Item { | ||
37 | implicitHeight: control.pressed || control.focus || control.alwaysShowValueLabel | ||
38 | ? knobDiameter : 0 | ||
39 | implicitWidth: control.pressed || control.focus || control.alwaysShowValueLabel | ||
40 | ? knobDiameter : 0 | ||
41 | |||
42 | Label { | ||
43 | anchors { | ||
44 | fill: parent | ||
45 | topMargin: 4 * Units.dp | ||
46 | bottomMargin: 2 * Units.dp | ||
47 | leftMargin: 4 * Units.dp | ||
48 | rightMargin: 4 * Units.dp | ||
49 | } | ||
50 | |||
51 | horizontalAlignment: Qt.AlignHCenter | ||
52 | verticalAlignment: Qt.AlignVCenter | ||
53 | text: knobLabel | ||
54 | fontSizeMode: Text.Fit | ||
55 | font.pixelSize: knobDiameter - 19 * Units.dp | ||
56 | minimumPixelSize: 6 * Units.dp | ||
57 | wrapMode: Text.WordWrap | ||
58 | color: Theme.lightDark(styleColor, | ||
59 | Theme.light.textColor, | ||
60 | Theme.dark.textColor) | ||
61 | opacity: control.pressed || control.focus || control.alwaysShowValueLabel ? 1 : 0 | ||
62 | z: 1 | ||
63 | |||
64 | property color styleColor: control.hasOwnProperty("color") | ||
65 | ? control.color : Theme.light.accentColor | ||
66 | |||
67 | Behavior on opacity { | ||
68 | NumberAnimation { duration: 200} | ||
69 | } | ||
70 | } | ||
71 | |||
72 | Rectangle { | ||
73 | id: roundKnob | ||
74 | implicitHeight: parent.height | ||
75 | implicitWidth: parent.width | ||
76 | radius: implicitWidth / 2 | ||
77 | color: style.color | ||
78 | antialiasing: true | ||
79 | clip: true | ||
80 | |||
81 | Rectangle { | ||
82 | implicitHeight: parent.height / 2 | ||
83 | implicitWidth: parent.width / 2 | ||
84 | color: style.color | ||
85 | anchors.right: parent.right | ||
86 | anchors.bottom: parent.bottom | ||
87 | antialiasing: true | ||
88 | } | ||
89 | |||
90 | transform: [ | ||
91 | Rotation { | ||
92 | origin { x: parent.width / 2; y: parent.height / 2 } | ||
93 | angle: 45; | ||
94 | } | ||
95 | ] | ||
96 | } | ||
97 | |||
98 | Behavior on implicitHeight { | ||
99 | NumberAnimation { duration: 200} | ||
100 | } | ||
101 | |||
102 | Behavior on implicitWidth { | ||
103 | NumberAnimation { duration: 200} | ||
104 | } | ||
105 | } | ||
106 | |||
107 | groove: Rectangle { | ||
108 | implicitWidth: 200 | ||
109 | implicitHeight: 2 * Units.dp | ||
110 | |||
111 | anchors.verticalCenter: parent.verticalCenter | ||
112 | |||
113 | color: style.darkBackground ? Theme.alpha("#FFFFFF", 0.3) | ||
114 | : Theme.alpha("#000000", 0.26) | ||
115 | |||
116 | Rectangle { | ||
117 | height: parent.height | ||
118 | width: styleData.handlePosition | ||
119 | implicitHeight: 2 * Units.dp | ||
120 | implicitWidth: 200 | ||
121 | color: style.color | ||
122 | } | ||
123 | } | ||
124 | |||
125 | handle: Item { | ||
126 | anchors.centerIn: parent | ||
127 | implicitHeight: 8 * Units.dp | ||
128 | implicitWidth: 8 * Units.dp | ||
129 | |||
130 | Loader { | ||
131 | anchors.horizontalCenter: parent.horizontalCenter | ||
132 | anchors.bottom: parent.top | ||
133 | anchors.bottomMargin: 16 * Units.dp | ||
134 | sourceComponent: style.numericValueLabel ? knob : null | ||
135 | } | ||
136 | |||
137 | Rectangle { | ||
138 | anchors.centerIn: parent | ||
139 | implicitHeight: 32 * Units.dp | ||
140 | implicitWidth: 32 * Units.dp | ||
141 | color: control.focus ? | ||
142 | Theme.alpha(style.color, 0.20) : | ||
143 | "transparent" | ||
144 | radius: implicitHeight / 2 | ||
145 | Rectangle { | ||
146 | property var diameter: control.enabled ? 16 * Units.dp : 12 * Units.dp | ||
147 | anchors.centerIn: parent | ||
148 | color: control.value === control.minimumValue ? | ||
149 | Theme.backgroundColor : style.color | ||
150 | |||
151 | border.color: control.value === control.minimumValue | ||
152 | ? style.darkBackground ? Theme.alpha("#FFFFFF", 0.3) | ||
153 | : Theme.alpha("#000000", 0.26) | ||
154 | : style.color | ||
155 | |||
156 | border.width: 2 * Units.dp | ||
157 | |||
158 | implicitHeight: control.pressed && !control.focus && !style.numericValueLabel ? | ||
159 | diameter + 8 * Units.dp : | ||
160 | diameter | ||
161 | |||
162 | implicitWidth: control.pressed && !control.focus && !style.numericValueLabel ? | ||
163 | diameter + 8 * Units.dp : | ||
164 | diameter | ||
165 | |||
166 | radius: implicitWidth / 2 | ||
167 | |||
168 | Behavior on implicitHeight { | ||
169 | NumberAnimation { duration: 200} | ||
170 | } | ||
171 | |||
172 | Behavior on implicitWidth { | ||
173 | NumberAnimation { duration: 200} | ||
174 | } | ||
175 | } | ||
176 | } | ||
177 | } | ||
178 | |||
179 | tickmarks: Repeater { | ||
180 | id: repeater | ||
181 | model: control.stepSize > 0 ? 1 + (control.maximumValue - control.minimumValue) / control.stepSize : 0 | ||
182 | |||
183 | Rectangle { | ||
184 | color: style.darkBackground ? "#FFFFFF" : "#000000" | ||
185 | width: Math.round(2 * Units.dp); height: 2 * Units.dp | ||
186 | y: repeater.height / 2 | ||
187 | x: styleData.handleWidth / 2 + index * ((repeater.width - styleData.handleWidth) / (repeater.count-1)) | ||
188 | } | ||
189 | } | ||
190 | |||
191 | panel: Item { | ||
192 | id: root | ||
193 | property int handleWidth: handleLoader.width | ||
194 | property int handleHeight: handleLoader.height | ||
195 | |||
196 | property bool horizontal : control.orientation === Qt.Horizontal | ||
197 | property int horizontalSize: grooveLoader.implicitWidth + padding.left + padding.right | ||
198 | property int verticalSize: Math.max(handleLoader.implicitHeight, grooveLoader.implicitHeight) + padding.top + padding.bottom | ||
199 | |||
200 | implicitWidth: horizontal ? horizontalSize : verticalSize | ||
201 | implicitHeight: horizontal ? verticalSize : horizontalSize | ||
202 | |||
203 | y: horizontal ? 0 : height | ||
204 | rotation: horizontal ? 0 : -90 | ||
205 | transformOrigin: Item.TopLeft | ||
206 | |||
207 | Item { | ||
208 | anchors.fill: parent | ||
209 | |||
210 | Loader { | ||
211 | id: grooveLoader | ||
212 | property QtObject styleData: QtObject { | ||
213 | readonly property int handlePosition: handleLoader.x + handleLoader.width/2 | ||
214 | } | ||
215 | x: padding.left + control.__panel.handleWidth / 2 | ||
216 | sourceComponent: groove | ||
217 | width: (horizontal ? parent.width : parent.height) - padding.left - padding.right - (control.__panel.handleWidth) | ||
218 | y: Math.round(padding.top + (Math.round(horizontal ? parent.height : parent.width - padding.top - padding.bottom) - grooveLoader.item.height - control.__panel.handleHeight) / (style.numericValueLabel ? 1 : 2)) | ||
219 | } | ||
220 | |||
221 | Loader { | ||
222 | id: tickMarkLoader | ||
223 | x: padding.left | ||
224 | width: (horizontal ? parent.width : parent.height) - padding.left - padding.right | ||
225 | y: grooveLoader.y | ||
226 | sourceComponent: control.tickmarksEnabled ? tickmarks : null | ||
227 | property QtObject styleData: QtObject { readonly property int handleWidth: control.__panel.handleWidth } | ||
228 | } | ||
229 | |||
230 | Loader { | ||
231 | id: handleLoader | ||
232 | sourceComponent: handle | ||
233 | anchors.verticalCenter: grooveLoader.verticalCenter | ||
234 | x: Math.round((control.__handlePos - control.minimumValue) / (control.maximumValue - control.minimumValue) * ((horizontal ? root.width : root.height) - item.width)) | ||
235 | |||
236 | Behavior on x { | ||
237 | NumberAnimation { duration: 100 } | ||
238 | enabled: control.tickmarksEnabled | ||
239 | } | ||
240 | } | ||
241 | } | ||
242 | } | ||
243 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/SwitchStyle.qml b/prototype_2016/third_party/qml-material/src/styles/SwitchStyle.qml deleted file mode 100644 index bb3a90c..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/SwitchStyle.qml +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | |||
15 | SwitchStyle { | ||
16 | id: style | ||
17 | |||
18 | property color color: control.hasOwnProperty("color") | ||
19 | ? control.color : Theme.light.accentColor | ||
20 | |||
21 | property bool darkBackground: control.hasOwnProperty("darkBackground") | ||
22 | ? control.darkBackground : false | ||
23 | |||
24 | handle: View { | ||
25 | width: 22 * Units.dp | ||
26 | height: 22 * Units.dp | ||
27 | |||
28 | radius: height/2 | ||
29 | |||
30 | elevation: 2 | ||
31 | backgroundColor: control.enabled ? control.checked ? color : darkBackground ? "#BDBDBD" | ||
32 | : "#FAFAFA" | ||
33 | : darkBackground ? "#424242" : "#BDBDBD" | ||
34 | } | ||
35 | |||
36 | groove: Item { | ||
37 | width: 40 * Units.dp | ||
38 | height: 22 * Units.dp | ||
39 | |||
40 | Rectangle { | ||
41 | |||
42 | anchors.centerIn: parent | ||
43 | |||
44 | width: parent.width - 2 * Units.dp | ||
45 | height: 16 * Units.dp | ||
46 | |||
47 | radius: height/2 | ||
48 | |||
49 | color: control.enabled ? control.checked ? Theme.alpha(style.color, 0.5) | ||
50 | : darkBackground ? Qt.rgba(1, 1, 1, 0.26) | ||
51 | : Qt.rgba(0, 0, 0, 0.30) | ||
52 | : darkBackground ? Qt.rgba(1, 1, 1, 0.12) | ||
53 | : Qt.rgba(0, 0, 0, 0.12) | ||
54 | |||
55 | Behavior on color { | ||
56 | |||
57 | ColorAnimation { | ||
58 | duration: 200 | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | } | ||
63 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/TextFieldStyle.qml b/prototype_2016/third_party/qml-material/src/styles/TextFieldStyle.qml deleted file mode 100644 index b9c5fa1..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/TextFieldStyle.qml +++ /dev/null | |||
@@ -1,167 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Controls.Styles 1.3 | ||
14 | import QtQuick.Layouts 1.1 | ||
15 | import Material 0.3 | ||
16 | |||
17 | TextFieldStyle { | ||
18 | id: style | ||
19 | |||
20 | padding { | ||
21 | left: 0 | ||
22 | right: 0 | ||
23 | top: 0 | ||
24 | bottom: 0 | ||
25 | } | ||
26 | |||
27 | font { | ||
28 | family: echoMode == TextInput.Password ? "Default" : "Roboto" | ||
29 | pixelSize: 16 * Units.dp | ||
30 | } | ||
31 | |||
32 | renderType: Text.QtRendering | ||
33 | placeholderTextColor: "transparent" | ||
34 | selectedTextColor: "white" | ||
35 | selectionColor: control.hasOwnProperty("color") ? control.color : Theme.accentColor | ||
36 | textColor: Theme.light.textColor | ||
37 | |||
38 | background : Item { | ||
39 | id: background | ||
40 | |||
41 | property color color: control.hasOwnProperty("color") ? control.color : Theme.accentColor | ||
42 | property color errorColor: control.hasOwnProperty("errorColor") | ||
43 | ? control.errorColor : Palette.colors["red"]["500"] | ||
44 | property string helperText: control.hasOwnProperty("helperText") ? control.helperText : "" | ||
45 | property bool floatingLabel: control.hasOwnProperty("floatingLabel") ? control.floatingLabel : "" | ||
46 | property bool hasError: control.hasOwnProperty("hasError") | ||
47 | ? control.hasError : characterLimit && control.length > characterLimit | ||
48 | property int characterLimit: control.hasOwnProperty("characterLimit") ? control.characterLimit : 0 | ||
49 | property bool showBorder: control.hasOwnProperty("showBorder") ? control.showBorder : true | ||
50 | |||
51 | Rectangle { | ||
52 | id: underline | ||
53 | color: background.hasError ? background.errorColor | ||
54 | : control.activeFocus ? background.color | ||
55 | : Theme.light.hintColor | ||
56 | |||
57 | height: control.activeFocus ? 2 * Units.dp : 1 * Units.dp | ||
58 | visible: background.showBorder | ||
59 | |||
60 | anchors { | ||
61 | left: parent.left | ||
62 | right: parent.right | ||
63 | bottom: parent.bottom | ||
64 | } | ||
65 | |||
66 | Behavior on height { | ||
67 | NumberAnimation { duration: 200 } | ||
68 | } | ||
69 | |||
70 | Behavior on color { | ||
71 | ColorAnimation { duration: 200 } | ||
72 | } | ||
73 | } | ||
74 | |||
75 | |||
76 | Label { | ||
77 | id: fieldPlaceholder | ||
78 | |||
79 | anchors.verticalCenter: parent.verticalCenter | ||
80 | text: control.placeholderText | ||
81 | font.pixelSize: 16 * Units.dp | ||
82 | anchors.margins: -12 * Units.dp | ||
83 | color: background.hasError ? background.errorColor | ||
84 | : control.activeFocus && control.text !== "" | ||
85 | ? background.color : Theme.light.hintColor | ||
86 | |||
87 | states: [ | ||
88 | State { | ||
89 | name: "floating" | ||
90 | when: control.displayText.length > 0 && background.floatingLabel | ||
91 | AnchorChanges { | ||
92 | target: fieldPlaceholder | ||
93 | anchors.verticalCenter: undefined | ||
94 | anchors.top: parent.top | ||
95 | } | ||
96 | PropertyChanges { | ||
97 | target: fieldPlaceholder | ||
98 | font.pixelSize: 12 * Units.dp | ||
99 | } | ||
100 | }, | ||
101 | State { | ||
102 | name: "hidden" | ||
103 | when: control.displayText.length > 0 && !background.floatingLabel | ||
104 | PropertyChanges { | ||
105 | target: fieldPlaceholder | ||
106 | visible: false | ||
107 | } | ||
108 | } | ||
109 | ] | ||
110 | |||
111 | transitions: [ | ||
112 | Transition { | ||
113 | id: floatingTransition | ||
114 | enabled: false | ||
115 | AnchorAnimation { | ||
116 | duration: 200 | ||
117 | } | ||
118 | NumberAnimation { | ||
119 | duration: 200 | ||
120 | property: "font.pixelSize" | ||
121 | } | ||
122 | } | ||
123 | ] | ||
124 | |||
125 | Component.onCompleted: floatingTransition.enabled = true | ||
126 | } | ||
127 | |||
128 | RowLayout { | ||
129 | anchors { | ||
130 | left: parent.left | ||
131 | right: parent.right | ||
132 | top: underline.top | ||
133 | topMargin: 4 * Units.dp | ||
134 | } | ||
135 | |||
136 | Label { | ||
137 | id: helperTextLabel | ||
138 | visible: background.helperText && background.showBorder | ||
139 | text: background.helperText | ||
140 | font.pixelSize: 12 * Units.dp | ||
141 | color: background.hasError ? background.errorColor | ||
142 | : Qt.darker(Theme.light.hintColor) | ||
143 | |||
144 | Behavior on color { | ||
145 | ColorAnimation { duration: 200 } | ||
146 | } | ||
147 | |||
148 | property string helperText: control.hasOwnProperty("helperText") | ||
149 | ? control.helperText : "" | ||
150 | } | ||
151 | |||
152 | Label { | ||
153 | id: charLimitLabel | ||
154 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
155 | visible: background.characterLimit && background.showBorder | ||
156 | text: control.length + " / " + background.characterLimit | ||
157 | font.pixelSize: 12 * Units.dp | ||
158 | color: background.hasError ? background.errorColor : Theme.light.hintColor | ||
159 | horizontalAlignment: Text.AlignLeft | ||
160 | |||
161 | Behavior on color { | ||
162 | ColorAnimation { duration: 200 } | ||
163 | } | ||
164 | } | ||
165 | } | ||
166 | } | ||
167 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/ToolBarStyle.qml b/prototype_2016/third_party/qml-material/src/styles/ToolBarStyle.qml deleted file mode 100644 index 2917702..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/ToolBarStyle.qml +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | |||
15 | ToolBarStyle { | ||
16 | padding { | ||
17 | left: 16 * Units.dp | ||
18 | right: 16 * Units.dp | ||
19 | top: 0 * Units.dp | ||
20 | bottom: 0 * Units.dp | ||
21 | } | ||
22 | background: View { | ||
23 | implicitHeight: Device.type == Device.phone || Device.type === Device.phablet | ||
24 | ? 48 * Units.dp : Device.type == Device.tablet ? 56 * Units.dp : 64 * Units.dp | ||
25 | fullWidth: true | ||
26 | elevation: 2 | ||
27 | |||
28 | backgroundColor: Theme.primaryColor | ||
29 | } | ||
30 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/ToolButtonStyle.qml b/prototype_2016/third_party/qml-material/src/styles/ToolButtonStyle.qml deleted file mode 100644 index 0547e75..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/ToolButtonStyle.qml +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls.Styles 1.3 | ||
13 | import Material 0.3 | ||
14 | import "../Base/" | ||
15 | |||
16 | ToolButtonStyle { | ||
17 | panel: View { | ||
18 | radius: 2 * Units.dp | ||
19 | |||
20 | implicitHeight: label.text == "" | ||
21 | ? 44 * Units.dp : Math.max(36 * Units.dp, label.height + 16 * Units.dp) | ||
22 | implicitWidth: label.text == "" | ||
23 | ? 44 * Units.dp : Math.max(64 * Units.dp, label.width + 16 * Units.dp) | ||
24 | |||
25 | Ink { | ||
26 | id: mouseArea | ||
27 | |||
28 | anchors.fill: parent | ||
29 | |||
30 | centered: true | ||
31 | circular: label.text == "" | ||
32 | |||
33 | width: parent.width + 8 * Units.dp | ||
34 | height: parent.height + 8 * Units.dp | ||
35 | |||
36 | Connections { | ||
37 | target: control.__behavior | ||
38 | onPressed: mouseArea.onPressed(mouse) | ||
39 | onCanceled: mouseArea.onCanceled() | ||
40 | onReleased: mouseArea.onReleased(mouse) | ||
41 | } | ||
42 | } | ||
43 | |||
44 | Row { | ||
45 | anchors.centerIn: parent | ||
46 | |||
47 | spacing: 8 * Units.dp | ||
48 | |||
49 | Image { | ||
50 | id: image | ||
51 | anchors.verticalCenter: parent.verticalCenter | ||
52 | source: control.iconSource | ||
53 | width: 24 * Units.dp | ||
54 | height: width | ||
55 | } | ||
56 | |||
57 | Label { | ||
58 | id: label | ||
59 | anchors.verticalCenter: parent.verticalCenter | ||
60 | text: control.iconSource !== "" ? "" : control.text | ||
61 | style: "button" | ||
62 | color: Theme.lightDark(Theme.primaryColor, Theme.light.textColor, | ||
63 | Theme.dark.textColor) | ||
64 | visible: text == "" | ||
65 | } | ||
66 | } | ||
67 | } | ||
68 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/qmldir b/prototype_2016/third_party/qml-material/src/styles/qmldir deleted file mode 100644 index 06d164b..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/qmldir +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | module QtQuick.Controls.Styles.Material | ||
2 | |||
3 | ApplicationWindowStyle 0.1 ApplicationWindowStyle.qml | ||
4 | ButtonStyle 0.1 ButtonStyle.qml | ||
5 | CheckBoxStyle 0.1 CheckBoxStyle.qml | ||
6 | ProgressBarStyle 0.1 ProgressBarStyle.qml | ||
7 | SwitchStyle 0.1 SwitchStyle.qml | ||
8 | ToolBarStyle.qml 0.1 ToolBarStyle.qml | ||
9 | ToolButtonStyle.qml 0.1 ToolButtonStyle.qml | ||
10 | RadioButtonStyle 0.1 RadioButtonStyle.qml | ||
11 | SliderStyle 0.1 SliderStyle.qml | ||
12 | TextFieldStyle 0.1 TextFieldStyle.qml | ||
diff --git a/prototype_2016/third_party/qml-material/src/styles/styles.qrc b/prototype_2016/third_party/qml-material/src/styles/styles.qrc deleted file mode 100644 index fdf547a..0000000 --- a/prototype_2016/third_party/qml-material/src/styles/styles.qrc +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/QtQuick/Controls/Styles/Material"> | ||
5 | <file>ApplicationWindowStyle.qml</file> | ||
6 | <file>ButtonStyle.qml</file> | ||
7 | <file>CheckBoxStyle.qml</file> | ||
8 | <file>ProgressBarStyle.qml</file> | ||
9 | <file>RadioButtonStyle.qml</file> | ||
10 | <file>SliderStyle.qml</file> | ||
11 | <file>SwitchStyle.qml</file> | ||
12 | <file>TextFieldStyle.qml</file> | ||
13 | <file>ToolBarStyle.qml</file> | ||
14 | <file>ToolButtonStyle.qml</file> | ||
15 | <file>qmldir</file> | ||
16 | </qresource> | ||
17 | |||
18 | </RCC> | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/ActionBar.qml b/prototype_2016/third_party/qml-material/src/window/ActionBar.qml deleted file mode 100644 index e659d76..0000000 --- a/prototype_2016/third_party/qml-material/src/window/ActionBar.qml +++ /dev/null | |||
@@ -1,394 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import QtQuick.Layouts 1.1 | ||
14 | import Material 0.3 | ||
15 | import Material.ListItems 0.1 as ListItem | ||
16 | |||
17 | /*! | ||
18 | \qmltype ActionBar | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief An action bar holds the title and actions displayed in the application toolbar. | ||
22 | |||
23 | The reason this exists separately from \l Toolbar is for animation purposes. | ||
24 | Each page contains its own \c ActionBar, and when the application transitions | ||
25 | between pages, the toolbar animates the transition between action bars. | ||
26 | |||
27 | Normally, you don't need to manually create an instance of this class, and just | ||
28 | use the instance provided by the page. See the example in the \l Page documentation | ||
29 | for more details. | ||
30 | */ | ||
31 | Item { | ||
32 | id: actionBar | ||
33 | |||
34 | implicitHeight: 1 * Device.gridUnit * Units.dp | ||
35 | |||
36 | anchors { | ||
37 | left: parent.left | ||
38 | right: parent.right | ||
39 | } | ||
40 | |||
41 | /*! | ||
42 | A list of actions to show in the action bar. These actions will be shown | ||
43 | anchored to the right, and will overflow if there are more than the | ||
44 | maximum number of actions as defined in \l maxActionCount. | ||
45 | |||
46 | When used with a page, the actions will be set to the page's \l Page::actions | ||
47 | property, so set that instead of changing this directly. | ||
48 | */ | ||
49 | property list<Action> actions | ||
50 | |||
51 | /*! | ||
52 | The back action to display to the left of the title in the action bar. | ||
53 | When used with a page, this will pick up the page's back action, which | ||
54 | by default is a back arrow when there is a page behind the current page | ||
55 | on the page stack. However, you can customize this, for example, to show | ||
56 | a navigation drawer at the root of your app. | ||
57 | |||
58 | When using an action bar in a page, set the \l Page::backAction instead of | ||
59 | directly setting this property. | ||
60 | */ | ||
61 | property Action backAction | ||
62 | |||
63 | /*! | ||
64 | The background color of the window decoration when the action bar's page is active, | ||
65 | usually a darker version of the \l backgroundColor. | ||
66 | By default this is the primary dark color defined in \l Theme::primaryDarkColor | ||
67 | */ | ||
68 | property color decorationColor: Theme.primaryDarkColor | ||
69 | |||
70 | /*! | ||
71 | The background color for the toolbar when the action bar's page is active. | ||
72 | By default this is the primary color defined in \l Theme::primaryColor | ||
73 | */ | ||
74 | property color backgroundColor: Theme.primaryColor | ||
75 | |||
76 | /*! | ||
77 | \qmlproperty Item customContent | ||
78 | |||
79 | A custom view to show instead of the title in the action bar. | ||
80 | */ | ||
81 | property alias customContent: customContentView.data | ||
82 | |||
83 | /*! | ||
84 | \qmlproperty Item extendedContent | ||
85 | |||
86 | A custom view to show under the row containing the title and actions. | ||
87 | Causes the action bar to be extend in height to contain this view. | ||
88 | */ | ||
89 | property alias extendedContent: extendedContentView.data | ||
90 | |||
91 | /*! | ||
92 | The elevation of the action bar. Set to 0 if you want have a header or some | ||
93 | other view below the action bar that you want to appear as part of the action bar. | ||
94 | */ | ||
95 | property int elevation: 2 | ||
96 | |||
97 | /*! | ||
98 | \internal | ||
99 | The height of the extended content view. | ||
100 | */ | ||
101 | readonly property int extendedHeight: extendedContentView.height + | ||
102 | (tabBar.visible && !integratedTabBar ? tabBar.height : 0) | ||
103 | |||
104 | /*! | ||
105 | Set to true to hide the action bar. This is used when displaying an | ||
106 | action bar in a toolbar through the use of a page and the page stack. | ||
107 | If you are using an action bar for custom purposes, set the opacity or visibility | ||
108 | instead. | ||
109 | */ | ||
110 | property bool hidden: false | ||
111 | |||
112 | /*! | ||
113 | * \internal | ||
114 | * The size of the left icon and the action icons. | ||
115 | * | ||
116 | * \since 0.3 | ||
117 | */ | ||
118 | property int iconSize: Units.gridUnit == 48 * Units.dp ? 20 * Units.dp : 24 * Units.dp | ||
119 | |||
120 | /*! | ||
121 | * Set to true to integrate the tab bar into a single row with the actions. | ||
122 | * | ||
123 | * \since 0.3 | ||
124 | */ | ||
125 | property bool integratedTabBar: false | ||
126 | |||
127 | /*! | ||
128 | The maximum number of actions that can be displayed before they spill over | ||
129 | into a drop-down menu. When using an action bar with a page, this inherits | ||
130 | from the global \l Toolbar::maxActionCount. If you are using an action bar | ||
131 | for custom purposes outside of a toolbar, this defaults to \c 3. | ||
132 | */ | ||
133 | property int maxActionCount: toolbar ? toolbar.maxActionCount : 3 | ||
134 | |||
135 | /*! | ||
136 | The index of the selected tab. This will be an index from the \l tabs | ||
137 | property. | ||
138 | */ | ||
139 | property alias selectedTabIndex: tabBar.selectedIndex | ||
140 | |||
141 | /*! | ||
142 | The tab bar displayed below the actions in the action bar. Exposed for | ||
143 | additional customization. | ||
144 | */ | ||
145 | property alias tabBar: tabBar | ||
146 | |||
147 | /*! | ||
148 | The model to use as the tab items in the action bar. This can either be a Javascript | ||
149 | array wih an object for each tab, or it can be a TabView object to display tabs for. | ||
150 | |||
151 | If it is a Javascript array, each object represents one tab, and can either be a simple | ||
152 | string (used as the tab title), or an object with title, iconName, and/or iconSource | ||
153 | properties. | ||
154 | |||
155 | If it is a TabView component, the title of each Tab object will be used, as well as | ||
156 | iconName and iconSource properties if present (as provided by the Material subclass of Tab). | ||
157 | |||
158 | When used in a page, this will be set to the tabs of the page, so set the \l Page::tabs | ||
159 | property instead of changing this directly. | ||
160 | */ | ||
161 | property alias tabs: tabBar.tabs | ||
162 | |||
163 | /*! | ||
164 | The title displayed in the action bar. When used in a page, the title will | ||
165 | be set to the title of the page, so set the \l Page::title property instead | ||
166 | of changing this directly. | ||
167 | */ | ||
168 | property string title | ||
169 | |||
170 | /*! | ||
171 | \internal | ||
172 | The toolbar containing this action bar. | ||
173 | */ | ||
174 | property Item toolbar | ||
175 | |||
176 | property int leftKeyline: label.x | ||
177 | |||
178 | /*! | ||
179 | \internal | ||
180 | \qmlproperty bool overflowMenuShowing | ||
181 | |||
182 | Returns \c true if the overflow menu is open. | ||
183 | */ | ||
184 | readonly property alias overflowMenuShowing: overflowMenu.showing | ||
185 | |||
186 | /*! | ||
187 | \internal | ||
188 | |||
189 | Returns true if the overflow menu is available. | ||
190 | */ | ||
191 | readonly property bool overflowMenuAvailable: __internal.visibleActions.length > maxActionCount | ||
192 | |||
193 | /*! | ||
194 | \internal | ||
195 | |||
196 | Opens the overflow menu, if it is present and not already open open. | ||
197 | */ | ||
198 | function openOverflowMenu() { | ||
199 | if (overflowMenuAvailable && !overflowMenuShowing) | ||
200 | overflowMenu.open(overflowButton, 4 * Units.dp, -4 * Units.dp); | ||
201 | } | ||
202 | |||
203 | /*! | ||
204 | \internal | ||
205 | |||
206 | Closes the overflow menu, if it is present and already open open. | ||
207 | */ | ||
208 | function closeOverflowMenu() { | ||
209 | if (overflowMenuAvailable && overflowMenuShowing) | ||
210 | overflowMenu.close(); | ||
211 | } | ||
212 | |||
213 | QtObject { | ||
214 | id: __internal | ||
215 | |||
216 | property var visibleActions: Utils.filter(actions, function(action) { | ||
217 | return action.visible | ||
218 | }) | ||
219 | } | ||
220 | |||
221 | IconButton { | ||
222 | id: leftItem | ||
223 | |||
224 | anchors { | ||
225 | verticalCenter: actionsRow.verticalCenter | ||
226 | left: parent.left | ||
227 | leftMargin: leftItem.show ? 16 * Units.dp : -leftItem.width | ||
228 | |||
229 | Behavior on leftMargin { | ||
230 | NumberAnimation { duration: 200 } | ||
231 | } | ||
232 | } | ||
233 | |||
234 | color: Theme.lightDark(actionBar.backgroundColor, Theme.light.iconColor, | ||
235 | Theme.dark.iconColor) | ||
236 | size: iconSize | ||
237 | action: backAction | ||
238 | |||
239 | opacity: show ? enabled ? 1 : 0.6 : 0 | ||
240 | visible: opacity > 0 | ||
241 | |||
242 | Behavior on opacity { | ||
243 | NumberAnimation { duration: 200 } | ||
244 | } | ||
245 | |||
246 | property bool show: backAction && backAction.visible | ||
247 | } | ||
248 | |||
249 | Label { | ||
250 | id: label | ||
251 | |||
252 | anchors { | ||
253 | verticalCenter: actionsRow.verticalCenter | ||
254 | left: parent.left | ||
255 | right: actionsRow.left | ||
256 | leftMargin:16 * Units.dp + (leftItem.show ? 1 * Device.gridUnit * Units.dp : 0) | ||
257 | rightMargin: 16 * Units.dp | ||
258 | |||
259 | Behavior on leftMargin { | ||
260 | NumberAnimation { duration: 200 } | ||
261 | } | ||
262 | } | ||
263 | |||
264 | visible: customContentView.children.length === 0 && | ||
265 | (!integratedTabBar || !tabBar.visible) | ||
266 | |||
267 | textFormat: Text.PlainText | ||
268 | text: actionBar.title | ||
269 | style: "title" | ||
270 | color: Theme.lightDark(actionBar.backgroundColor, Theme.light.textColor, | ||
271 | Theme.dark.textColor) | ||
272 | elide: Text.ElideRight | ||
273 | } | ||
274 | |||
275 | Row { | ||
276 | id: actionsRow | ||
277 | |||
278 | anchors { | ||
279 | right: parent.right | ||
280 | rightMargin: 16 * Units.dp | ||
281 | } | ||
282 | |||
283 | height: parent.implicitHeight | ||
284 | |||
285 | spacing: 24 * Units.dp | ||
286 | |||
287 | Repeater { | ||
288 | model: __internal.visibleActions.length > maxActionCount | ||
289 | ? maxActionCount - 1 | ||
290 | : __internal.visibleActions.length | ||
291 | |||
292 | delegate: IconButton { | ||
293 | id: iconAction | ||
294 | |||
295 | objectName: "action/" + action.objectName | ||
296 | |||
297 | action: __internal.visibleActions[index] | ||
298 | |||
299 | color: Theme.lightDark(actionBar.backgroundColor, Theme.light.iconColor, | ||
300 | Theme.dark.iconColor) | ||
301 | size: iconSize | ||
302 | |||
303 | anchors.verticalCenter: parent ? parent.verticalCenter : undefined | ||
304 | } | ||
305 | } | ||
306 | |||
307 | IconButton { | ||
308 | id: overflowButton | ||
309 | |||
310 | iconName: "navigation/more_vert" | ||
311 | objectName: "action/overflow" | ||
312 | size: 27 * Units.dp | ||
313 | color: Theme.lightDark(actionBar.backgroundColor, Theme.light.iconColor, | ||
314 | Theme.dark.iconColor) | ||
315 | visible: actionBar.overflowMenuAvailable | ||
316 | anchors.verticalCenter: parent.verticalCenter | ||
317 | |||
318 | onClicked: openOverflowMenu() | ||
319 | } | ||
320 | } | ||
321 | |||
322 | Item { | ||
323 | id: customContentView | ||
324 | |||
325 | height: parent.height | ||
326 | |||
327 | anchors { | ||
328 | left: label.left | ||
329 | right: label.right | ||
330 | } | ||
331 | } | ||
332 | |||
333 | Item { | ||
334 | id: extendedContentView | ||
335 | anchors { | ||
336 | top: actionsRow.bottom | ||
337 | left: label.left | ||
338 | right: parent.right | ||
339 | rightMargin: 16 * Units.dp | ||
340 | } | ||
341 | |||
342 | height: childrenRect.height | ||
343 | } | ||
344 | |||
345 | TabBar { | ||
346 | id: tabBar | ||
347 | |||
348 | darkBackground: Theme.isDarkColor(actionBar.backgroundColor) | ||
349 | leftKeyline: actionBar.leftKeyline | ||
350 | height: integratedTabBar ? parent.implicitHeight : implicitHeight | ||
351 | |||
352 | anchors { | ||
353 | top: integratedTabBar ? undefined : extendedContentView.bottom | ||
354 | bottom: integratedTabBar ? actionsRow.bottom : undefined | ||
355 | left: parent.left | ||
356 | right: integratedTabBar ? actionsRow.left : parent.right | ||
357 | } | ||
358 | } | ||
359 | |||
360 | Dropdown { | ||
361 | id: overflowMenu | ||
362 | objectName: "overflowMenu" | ||
363 | |||
364 | width: 250 * Units.dp | ||
365 | height: columnView.height + 16 * Units.dp | ||
366 | |||
367 | ColumnLayout { | ||
368 | id: columnView | ||
369 | width: parent.width | ||
370 | anchors.centerIn: parent | ||
371 | |||
372 | Repeater { | ||
373 | model: __internal.visibleActions.length - (maxActionCount - 1) | ||
374 | |||
375 | ListItem.Standard { | ||
376 | id: listItem | ||
377 | |||
378 | objectName: "action/" + action.objectName | ||
379 | |||
380 | property Action action: __internal.visibleActions[index + maxActionCount - 1] | ||
381 | |||
382 | text: action.name | ||
383 | iconSource: action.iconSource | ||
384 | enabled: action.enabled | ||
385 | |||
386 | onClicked: { | ||
387 | action.triggered(listItem) | ||
388 | overflowMenu.close() | ||
389 | } | ||
390 | } | ||
391 | } | ||
392 | } | ||
393 | } | ||
394 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/AppTheme.qml b/prototype_2016/third_party/qml-material/src/window/AppTheme.qml deleted file mode 100644 index bef7e30..0000000 --- a/prototype_2016/third_party/qml-material/src/window/AppTheme.qml +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | |||
14 | /*! | ||
15 | \qmltype AppTheme | ||
16 | \inqmlmodule Material | ||
17 | |||
18 | \brief A helper class used in \l ApplicationWindow to set your app's theme colors. | ||
19 | */ | ||
20 | QtObject { | ||
21 | id: appTheme | ||
22 | |||
23 | /*! | ||
24 | The accent theme color used in your app for a highlight color in many UI components. | ||
25 | This is a helper property to set \l Theme::accentColor. | ||
26 | */ | ||
27 | property string accentColor | ||
28 | |||
29 | /*! | ||
30 | The default background color used throughout the app. This is a helper property | ||
31 | to set \l Theme::backgroundColor. | ||
32 | */ | ||
33 | property string backgroundColor | ||
34 | property string tabHighlightColor | ||
35 | |||
36 | |||
37 | /*! | ||
38 | The primary theme color used in your app for the toolbar and other primary UI elements. | ||
39 | This is a helper property to set \l Theme::primaryColor. | ||
40 | */ | ||
41 | property string primaryColor | ||
42 | |||
43 | /*! | ||
44 | A darker version of the primary theme color used by the system status bar and | ||
45 | window decorations. This is a helper property to set \l Theme::primaryDarkColor. | ||
46 | */ | ||
47 | property string primaryDarkColor: primaryColor | ||
48 | |||
49 | onPrimaryColorChanged: Theme.primaryColor = getColor(primaryColor, "500") | ||
50 | onPrimaryDarkColorChanged: Theme.primaryDarkColor = getColor(primaryDarkColor, "700") | ||
51 | onAccentColorChanged: Theme.accentColor = getColor(accentColor, "A200") | ||
52 | onBackgroundColorChanged: Theme.backgroundColor = getColor(backgroundColor, "500") | ||
53 | onTabHighlightColorChanged: Theme.tabHighlightColor = getColor(tabHighlightColor, "500") | ||
54 | |||
55 | function getColor(color, shade) { | ||
56 | if (Palette.colors.hasOwnProperty(color)) { | ||
57 | return Palette.colors[color][shade] | ||
58 | } else { | ||
59 | return color | ||
60 | } | ||
61 | } | ||
62 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/ApplicationWindow.qml b/prototype_2016/third_party/qml-material/src/window/ApplicationWindow.qml deleted file mode 100644 index e4a2171..0000000 --- a/prototype_2016/third_party/qml-material/src/window/ApplicationWindow.qml +++ /dev/null | |||
@@ -1,186 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import QtQuick.Window 2.2 | ||
14 | import Material 0.3 | ||
15 | import Material.Extras 0.1 | ||
16 | |||
17 | /*! | ||
18 | \qmltype ApplicationWindow | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief A window that provides features commonly used for Material Design apps. | ||
22 | |||
23 | This is normally what you should use as your root component. It provides a \l Toolbar and | ||
24 | \l PageStack to provide access to standard features used by Material Design applications. | ||
25 | |||
26 | Here is a short working example of an application: | ||
27 | |||
28 | \qml | ||
29 | import QtQuick 2.4 | ||
30 | import Material 0.3 | ||
31 | |||
32 | ApplicationWindow { | ||
33 | title: "Application Name" | ||
34 | |||
35 | initialPage: page | ||
36 | |||
37 | Page { | ||
38 | id: page | ||
39 | title: "Page Title" | ||
40 | |||
41 | Label { | ||
42 | anchors.centerIn: parent | ||
43 | text: "Hello World!" | ||
44 | } | ||
45 | } | ||
46 | } | ||
47 | \endqml | ||
48 | */ | ||
49 | Controls.ApplicationWindow { | ||
50 | id: app | ||
51 | |||
52 | /*! | ||
53 | Set to \c true to include window decorations in your app's toolbar and hide | ||
54 | the regular window decorations header. | ||
55 | */ | ||
56 | property bool clientSideDecorations: false | ||
57 | |||
58 | /*! | ||
59 | \qmlproperty Page initialPage | ||
60 | |||
61 | The initial page shown when the application starts. | ||
62 | */ | ||
63 | property alias initialPage: __pageStack.initialItem | ||
64 | |||
65 | /*! | ||
66 | \qmlproperty PageStack pageStack | ||
67 | |||
68 | The \l PageStack used for controlling pages and transitions between pages. | ||
69 | */ | ||
70 | property alias pageStack: __pageStack | ||
71 | |||
72 | /*! | ||
73 | \qmlproperty AppTheme theme | ||
74 | |||
75 | A grouped property that allows the application to customize the the primary color, the | ||
76 | primary dark color, and the accent color. See \l Theme for more details. | ||
77 | */ | ||
78 | property alias theme: __theme | ||
79 | |||
80 | AppTheme { | ||
81 | id: __theme | ||
82 | } | ||
83 | |||
84 | PlatformExtensions { | ||
85 | id: platformExtensions | ||
86 | decorationColor: __toolbar.decorationColor | ||
87 | window: app | ||
88 | } | ||
89 | |||
90 | PageStack { | ||
91 | id: __pageStack | ||
92 | anchors { | ||
93 | left: parent.left | ||
94 | right: parent.right | ||
95 | top: __toolbar.bottom | ||
96 | bottom: parent.bottom | ||
97 | } | ||
98 | |||
99 | onPushed: __toolbar.push(page) | ||
100 | onPopped: __toolbar.pop(page) | ||
101 | onReplaced: __toolbar.replace(page) | ||
102 | } | ||
103 | |||
104 | Toolbar { | ||
105 | id: __toolbar | ||
106 | clientSideDecorations: app.clientSideDecorations | ||
107 | } | ||
108 | |||
109 | OverlayLayer { | ||
110 | id: dialogOverlayLayer | ||
111 | objectName: "dialogOverlayLayer" | ||
112 | } | ||
113 | |||
114 | OverlayLayer { | ||
115 | id: tooltipOverlayLayer | ||
116 | objectName: "tooltipOverlayLayer" | ||
117 | } | ||
118 | |||
119 | OverlayLayer { | ||
120 | id: overlayLayer | ||
121 | } | ||
122 | |||
123 | width: dp(800) | ||
124 | height: dp(600) | ||
125 | |||
126 | Dialog { | ||
127 | id: errorDialog | ||
128 | |||
129 | property var promise | ||
130 | |||
131 | positiveButtonText: "Retry" | ||
132 | |||
133 | onAccepted: { | ||
134 | promise.resolve() | ||
135 | promise = null | ||
136 | } | ||
137 | |||
138 | onRejected: { | ||
139 | promise.reject() | ||
140 | promise = null | ||
141 | } | ||
142 | } | ||
143 | |||
144 | /*! | ||
145 | Show an error in a dialog, with the specified secondary button text (defaulting to "Close") | ||
146 | and an optional retry button. | ||
147 | |||
148 | Returns a promise which will be resolved if the user taps retry and rejected if the user | ||
149 | cancels the dialog. | ||
150 | */ | ||
151 | function showError(title, text, secondaryButtonText, retry) { | ||
152 | if (errorDialog.promise) { | ||
153 | errorDialog.promise.reject() | ||
154 | errorDialog.promise = null | ||
155 | } | ||
156 | |||
157 | errorDialog.negativeButtonText = secondaryButtonText ? secondaryButtonText : "Close" | ||
158 | errorDialog.positiveButton.visible = retry || false | ||
159 | |||
160 | errorDialog.promise = new Promises.Promise() | ||
161 | errorDialog.title = title | ||
162 | errorDialog.text = text | ||
163 | errorDialog.open() | ||
164 | |||
165 | return errorDialog.promise | ||
166 | } | ||
167 | |||
168 | // Units | ||
169 | |||
170 | function dp(dp) { | ||
171 | return dp * Units.dp | ||
172 | } | ||
173 | |||
174 | function gu(gu) { | ||
175 | return units.gu(gu) | ||
176 | } | ||
177 | |||
178 | UnitsHelper { | ||
179 | id: units | ||
180 | } | ||
181 | |||
182 | Component.onCompleted: { | ||
183 | if (clientSideDecorations) | ||
184 | flags |= Qt.FramelessWindowHint | ||
185 | } | ||
186 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/MainView.qml b/prototype_2016/third_party/qml-material/src/window/MainView.qml deleted file mode 100644 index f33c45b..0000000 --- a/prototype_2016/third_party/qml-material/src/window/MainView.qml +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Window 2.2 | ||
13 | import Material 0.3 | ||
14 | |||
15 | /*! | ||
16 | \qmltype MainView | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A root component with support for overlays and configuring the app theme. | ||
20 | */ | ||
21 | Item { | ||
22 | id: mainView | ||
23 | |||
24 | /*! | ||
25 | \qmlproperty AppTheme theme | ||
26 | |||
27 | A grouped property that allows the application to customize the the primary color, the | ||
28 | primary dark color, and the accent color. See \l Theme for more details. | ||
29 | */ | ||
30 | property alias theme: __theme | ||
31 | |||
32 | AppTheme { | ||
33 | id: __theme | ||
34 | } | ||
35 | |||
36 | PlatformExtensions { | ||
37 | id: platformExtensions | ||
38 | } | ||
39 | |||
40 | OverlayLayer { | ||
41 | id: dialogOverlayLayer | ||
42 | objectName: "dialogOverlayLayer" | ||
43 | z: 100 | ||
44 | } | ||
45 | |||
46 | OverlayLayer { | ||
47 | id: tooltipOverlayLayer | ||
48 | objectName: "tooltipOverlayLayer" | ||
49 | z: 100 | ||
50 | } | ||
51 | |||
52 | OverlayLayer { | ||
53 | id: overlayLayer | ||
54 | z: 100 | ||
55 | } | ||
56 | |||
57 | width: dp(800) | ||
58 | height: dp(600) | ||
59 | |||
60 | // Units | ||
61 | |||
62 | function dp(dp) { | ||
63 | return dp * Units.dp | ||
64 | } | ||
65 | |||
66 | function gu(gu) { | ||
67 | return units.gu(gu) | ||
68 | } | ||
69 | |||
70 | UnitsHelper { | ||
71 | id: units | ||
72 | } | ||
73 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/NavigationDrawer.qml b/prototype_2016/third_party/qml-material/src/window/NavigationDrawer.qml deleted file mode 100644 index 39a9545..0000000 --- a/prototype_2016/third_party/qml-material/src/window/NavigationDrawer.qml +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * 2015 Pierre Jacquier <pierrejacquier39@gmail.com> | ||
6 | * | ||
7 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
8 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
9 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
10 | */ | ||
11 | |||
12 | import QtQuick 2.4 | ||
13 | import Material 0.3 | ||
14 | |||
15 | /*! | ||
16 | \qmltype NavigationDrawer | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief The navigation drawer slides in from the left and is a common pattern in apps. | ||
20 | */ | ||
21 | PopupBase { | ||
22 | id: navDrawer | ||
23 | objectName: "navDrawer" | ||
24 | |||
25 | overlayLayer: "dialogOverlayLayer" | ||
26 | overlayColor: Qt.rgba(0, 0, 0, 0.3) | ||
27 | |||
28 | width: Math.min(parent.width - 1 * Device.gridUnit * Units.dp, 5 * Device.gridUnit * Units.dp) | ||
29 | |||
30 | anchors { | ||
31 | left: mode === "left" ? parent.left : undefined | ||
32 | right: mode === "right" ? parent.right : undefined | ||
33 | top: parent.top | ||
34 | bottom: parent.bottom | ||
35 | |||
36 | leftMargin: showing ? 0 : -width - 10 * Units.dp | ||
37 | rightMargin: showing ? 0 : -width - 10 * Units.dp | ||
38 | |||
39 | Behavior on leftMargin { | ||
40 | NumberAnimation { duration: 200 } | ||
41 | } | ||
42 | Behavior on rightMargin { | ||
43 | NumberAnimation { duration: 200 } | ||
44 | } | ||
45 | } | ||
46 | |||
47 | property string mode: "left" // or "right" | ||
48 | |||
49 | property alias enabled: action.visible | ||
50 | |||
51 | readonly property Action action: action | ||
52 | |||
53 | onEnabledChanged: { | ||
54 | if (!enabled) | ||
55 | close() | ||
56 | } | ||
57 | |||
58 | Action { | ||
59 | id: action | ||
60 | iconName: "navigation/menu" | ||
61 | name: "Navigation Drawer" | ||
62 | onTriggered: navDrawer.toggle() | ||
63 | } | ||
64 | |||
65 | View { | ||
66 | anchors.fill: parent | ||
67 | fullHeight: true | ||
68 | elevation: 3 | ||
69 | backgroundColor: "white" | ||
70 | } | ||
71 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/NavigationDrawerPage.qml b/prototype_2016/third_party/qml-material/src/window/NavigationDrawerPage.qml deleted file mode 100644 index 5344a90..0000000 --- a/prototype_2016/third_party/qml-material/src/window/NavigationDrawerPage.qml +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | |||
14 | Page { | ||
15 | id: navPage | ||
16 | |||
17 | backAction: navDrawer.action | ||
18 | title: page.title | ||
19 | actions: page.actions | ||
20 | actionBar.backgroundColor: page.actionBar.backgroundColor | ||
21 | actionBar.decorationColor: page.actionBar.decorationColor | ||
22 | |||
23 | property var navDrawer | ||
24 | |||
25 | property var page | ||
26 | |||
27 | function navigate(page) { | ||
28 | navPage.page = page | ||
29 | navDrawer.close() | ||
30 | } | ||
31 | |||
32 | onNavDrawerChanged: navDrawer.parent = navPage | ||
33 | |||
34 | onPageChanged: stackView.push({ item: page, replace: true }) | ||
35 | |||
36 | Controls.StackView { | ||
37 | id: stackView | ||
38 | anchors.fill: parent | ||
39 | } | ||
40 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/Page.qml b/prototype_2016/third_party/qml-material/src/window/Page.qml deleted file mode 100644 index 51007dd..0000000 --- a/prototype_2016/third_party/qml-material/src/window/Page.qml +++ /dev/null | |||
@@ -1,262 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import Material 0.3 | ||
14 | |||
15 | /*! | ||
16 | \qmltype Page | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Represents a page on the navigation page stack. | ||
20 | |||
21 | Example: | ||
22 | |||
23 | \qml | ||
24 | import QtQuick 2.4 | ||
25 | import Material 0.3 | ||
26 | |||
27 | Page { | ||
28 | title: "Application Name" | ||
29 | |||
30 | actions: [ | ||
31 | Action { | ||
32 | name: "Print" | ||
33 | |||
34 | // Icon name from the Google Material Design icon pack | ||
35 | iconName: "action/print" | ||
36 | } | ||
37 | ] | ||
38 | |||
39 | actionBar { | ||
40 | // Set a custom background color, if you don't want to use | ||
41 | // the theme's primary color | ||
42 | backgroundColor: Palette.colors.red["500"] | ||
43 | |||
44 | // You can also set a custom content view instead of the title | ||
45 | customContent: TextField { | ||
46 | placeholderText: "Search..." | ||
47 | anchors { | ||
48 | left: parent.left | ||
49 | right: parent.right | ||
50 | verticalCenter: parent.verticalCenter | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | \endqml | ||
56 | */ | ||
57 | FocusScope { | ||
58 | id: page | ||
59 | |||
60 | /* | ||
61 | \qmlproperty ActionBar actionBar | ||
62 | |||
63 | The action bar for this page. Use it as a group property to customize | ||
64 | this page's action bar. See the \l Page example for details on how to use | ||
65 | this property. | ||
66 | */ | ||
67 | property alias actionBar: __actionBar | ||
68 | |||
69 | /*! | ||
70 | The page's actions shown in the action bar. | ||
71 | */ | ||
72 | property list<Action> actions | ||
73 | |||
74 | /*! | ||
75 | The action shown to the left of the title in the action bar. By default, | ||
76 | this is a back button which shows when there is a page behind the current | ||
77 | page in the page stack. However, you can replace it with your own action, | ||
78 | for example, an icon to open a navigation drawer when on your root page. | ||
79 | */ | ||
80 | property Action backAction: Action { | ||
81 | name: "Back" | ||
82 | iconName: "navigation/arrow_back" | ||
83 | onTriggered: page.pop() | ||
84 | visible: canGoBack | ||
85 | } | ||
86 | |||
87 | /*! | ||
88 | The background color of the page. Defaults to the global background color | ||
89 | defined in \l Theme::backgroundColor | ||
90 | */ | ||
91 | property color backgroundColor: Theme.backgroundColor | ||
92 | |||
93 | /*! | ||
94 | \internal | ||
95 | Set by the page stack to true if there is a page behind this page on the | ||
96 | page stack. | ||
97 | */ | ||
98 | property bool canGoBack: false | ||
99 | |||
100 | /*! | ||
101 | \internal | ||
102 | The default property is set to the content view so the page's content | ||
103 | properly fits in with left or right sidebars. | ||
104 | */ | ||
105 | default property alias data: content.data | ||
106 | |||
107 | /*! | ||
108 | \qmlproperty PageSidebar rightSidebar | ||
109 | A sidebar to show on the right of the page. This will have its own | ||
110 | action bar and title, which will split the toolbar into two action bars. | ||
111 | */ | ||
112 | property Item rightSidebar | ||
113 | |||
114 | /*! | ||
115 | The index of the selected tab. This will be an index from the \l tabs | ||
116 | property. | ||
117 | */ | ||
118 | property alias selectedTabIndex: __actionBar.selectedTabIndex | ||
119 | |||
120 | /*! | ||
121 | The tab bar displayed below the actions in the action bar. Exposed for | ||
122 | additional customization. | ||
123 | */ | ||
124 | property alias tabBar: __actionBar.tabBar | ||
125 | |||
126 | /*! | ||
127 | The model to use as the tab items in the action bar. This can either be a Javascript | ||
128 | array wih an object for each tab, or it can be a TabView object to display tabs for. | ||
129 | |||
130 | If it is a Javascript array, each object represents one tab, and can either be a simple | ||
131 | string (used as the tab title), or an object with title, iconName, and/or iconSource | ||
132 | properties. | ||
133 | |||
134 | If it is a TabView component, the title of each Tab object will be used, as well as | ||
135 | iconName and iconSource properties if present (as provided by the Material subclass of Tab). | ||
136 | */ | ||
137 | property alias tabs: __actionBar.tabs | ||
138 | |||
139 | /*! | ||
140 | The title of the page shown in the action bar. | ||
141 | */ | ||
142 | property string title | ||
143 | |||
144 | /*! | ||
145 | This signal is emitted when the back action is triggered or back key is released. | ||
146 | |||
147 | By default, the page will be popped from the page stack. To change the default | ||
148 | behavior, for example to show a confirmation dialog, listen for this signal using | ||
149 | \c onGoBack and set \c event.accepted to \c true. To dismiss the page from your | ||
150 | dialog without triggering this signal and re-showing the dialog, call | ||
151 | \c page.forcePop(). | ||
152 | */ | ||
153 | signal goBack(var event) | ||
154 | |||
155 | /*! | ||
156 | Pop this page from the page stack. This does nothing if this page is not | ||
157 | the current page on the page stack. | ||
158 | |||
159 | Use \c force to avoid calling the \l goBack signal. This is useful if you | ||
160 | use the \l goBack signal to show a confirmation dialog, and want to close | ||
161 | the page from your dialog without showing the dialog again. You can also | ||
162 | use \c forcePop() as a shortcut to this behavior. | ||
163 | */ | ||
164 | function pop(event, force) { | ||
165 | if (Controls.Stack.view.currentItem !== page) | ||
166 | return false | ||
167 | |||
168 | if (!event) | ||
169 | event = {accepted: false} | ||
170 | |||
171 | if (!force) | ||
172 | goBack(event) | ||
173 | |||
174 | if (event.accepted) { | ||
175 | return true | ||
176 | } else { | ||
177 | return Controls.Stack.view.pop() | ||
178 | } | ||
179 | } | ||
180 | |||
181 | function forcePop() { | ||
182 | pop(null, true) | ||
183 | } | ||
184 | |||
185 | /*! | ||
186 | Push the specified component onto the page stack. | ||
187 | */ | ||
188 | function push(component, properties) { | ||
189 | return Controls.Stack.view.push({item: component, properties: properties}); | ||
190 | } | ||
191 | |||
192 | onRightSidebarChanged: { | ||
193 | if (rightSidebar) | ||
194 | rightSidebar.mode = "right" | ||
195 | } | ||
196 | |||
197 | Keys.onReleased: { | ||
198 | if (event.key === Qt.Key_Back) { | ||
199 | // When the Android back button is tapped | ||
200 | if (__actionBar.overflowMenuShowing) { | ||
201 | // Close the action bar overflow menu if it's open | ||
202 | __actionBar.closeOverflowMenu(); | ||
203 | event.accepted = true; | ||
204 | } else { | ||
205 | // Or pop the page from the page stack | ||
206 | if (pop()) { | ||
207 | event.accepted = true; | ||
208 | } | ||
209 | } | ||
210 | } else if (event.key === Qt.Key_Menu) { | ||
211 | // Display or hide the action bar overflow menu when the Android menu button is tapped | ||
212 | if (__actionBar.overflowMenuAvailable) { | ||
213 | if (__actionBar.overflowMenuShowing) { | ||
214 | __actionBar.closeOverflowMenu(); | ||
215 | } else { | ||
216 | __actionBar.openOverflowMenu(); | ||
217 | } | ||
218 | event.accepted = true; | ||
219 | } | ||
220 | } | ||
221 | } | ||
222 | |||
223 | ActionBar { | ||
224 | id: __actionBar | ||
225 | |||
226 | title: page.title | ||
227 | backAction: page.backAction | ||
228 | actions: page.actions | ||
229 | } | ||
230 | |||
231 | Rectangle { | ||
232 | anchors.fill: parent | ||
233 | color: backgroundColor | ||
234 | } | ||
235 | |||
236 | Item { | ||
237 | id: content | ||
238 | |||
239 | anchors { | ||
240 | top: parent.top | ||
241 | bottom: parent.bottom | ||
242 | left: parent.left | ||
243 | right: rightSidebarContent.left | ||
244 | } | ||
245 | } | ||
246 | |||
247 | Item { | ||
248 | id: rightSidebarContent | ||
249 | |||
250 | anchors { | ||
251 | top: parent.top | ||
252 | bottom: parent.bottom | ||
253 | right: parent.right | ||
254 | } | ||
255 | |||
256 | children: [rightSidebar] | ||
257 | |||
258 | width: rightSidebar | ||
259 | ? rightSidebar.width + rightSidebar.anchors.rightMargin | ||
260 | : 0 | ||
261 | } | ||
262 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/PageSidebar.qml b/prototype_2016/third_party/qml-material/src/window/PageSidebar.qml deleted file mode 100644 index 91f9e7d..0000000 --- a/prototype_2016/third_party/qml-material/src/window/PageSidebar.qml +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import Material 0.3 | ||
14 | |||
15 | /*! | ||
16 | \qmltype PageSidebar | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Represents a split sidebar in a page, with its own title, actions, and color | ||
20 | in the action bar. | ||
21 | */ | ||
22 | Page { | ||
23 | id: pageSidebar | ||
24 | |||
25 | default property alias sidebar: sidebar.data | ||
26 | property alias mode: sidebar.mode | ||
27 | property bool showing: true | ||
28 | |||
29 | anchors { | ||
30 | rightMargin: showing ? 0 : -width | ||
31 | |||
32 | Behavior on rightMargin { | ||
33 | id: behavior | ||
34 | enabled: false | ||
35 | |||
36 | NumberAnimation { duration: 200 } | ||
37 | } | ||
38 | } | ||
39 | |||
40 | height: parent.height | ||
41 | |||
42 | Sidebar { | ||
43 | id: sidebar | ||
44 | |||
45 | anchors.fill: parent | ||
46 | } | ||
47 | |||
48 | Component.onCompleted: behavior.enabled = true | ||
49 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/PageStack.qml b/prototype_2016/third_party/qml-material/src/window/PageStack.qml deleted file mode 100644 index 11fc2b9..0000000 --- a/prototype_2016/third_party/qml-material/src/window/PageStack.qml +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import Material 0.3 | ||
14 | |||
15 | /*! | ||
16 | \qmltype PageStack | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief Manages the page stack used for navigation. | ||
20 | */ | ||
21 | Controls.StackView { | ||
22 | id: stackView | ||
23 | |||
24 | signal pushed(Item page) | ||
25 | signal popped(Item page) | ||
26 | signal replaced(Item page) | ||
27 | |||
28 | property int __lastDepth: 0 | ||
29 | property Item __oldItem: null | ||
30 | |||
31 | onCurrentItemChanged: { | ||
32 | if (stackView.currentItem) { | ||
33 | stackView.currentItem.canGoBack = stackView.depth > 1; | ||
34 | stackView.currentItem.forceActiveFocus() | ||
35 | |||
36 | if (__lastDepth > stackView.depth) { | ||
37 | popped(stackView.currentItem); | ||
38 | } else if (__lastDepth < stackView.depth) { | ||
39 | pushed(stackView.currentItem); | ||
40 | } else { | ||
41 | replaced(stackView.currentItem); | ||
42 | } | ||
43 | } | ||
44 | |||
45 | __lastDepth = stackView.depth; | ||
46 | } | ||
47 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/Sidebar.qml b/prototype_2016/third_party/qml-material/src/window/Sidebar.qml deleted file mode 100644 index 7954294..0000000 --- a/prototype_2016/third_party/qml-material/src/window/Sidebar.qml +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import "ListItems" as ListItem | ||
14 | |||
15 | /*! | ||
16 | \qmltype Sidebar | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A sidebar component for use in adaptive layouts | ||
20 | |||
21 | To use, simply add an instance to your code, and anchor other components to it. | ||
22 | |||
23 | To show or hide, set the expanded property. | ||
24 | |||
25 | By default, the sidebar has a flickable built in, and whatever contents are added | ||
26 | will be placed in the flickable. When you want this disabled, or want to fill the | ||
27 | entire sidebar, set the autoFill property to false. | ||
28 | |||
29 | Examples: | ||
30 | \qml | ||
31 | Item{ | ||
32 | property bool wideAspect: width > gu(80) | ||
33 | |||
34 | Sidebar { | ||
35 | expanded: wideAspect | ||
36 | |||
37 | // Anchoring is automatic | ||
38 | } | ||
39 | } | ||
40 | \endqml | ||
41 | */ | ||
42 | View { | ||
43 | id: root | ||
44 | |||
45 | backgroundColor: style === "default" ? "white" : "#333" | ||
46 | |||
47 | anchors { | ||
48 | left: mode === "left" ? parent.left : undefined | ||
49 | right: mode === "right" ? parent.right : undefined | ||
50 | top: parent.top | ||
51 | bottom: parent.bottom | ||
52 | leftMargin: expanded ? 0 : -width | ||
53 | rightMargin: expanded ? 0 : -width | ||
54 | } | ||
55 | |||
56 | width: 250 * Units.dp | ||
57 | |||
58 | property bool expanded: true | ||
59 | |||
60 | property string mode: "left" // or "right" | ||
61 | property alias header: headerItem.text | ||
62 | |||
63 | property color borderColor: style === "dark" ? Qt.rgba(0.5,0.5,0.5,0.5) : Theme.light.dividerColor | ||
64 | |||
65 | property bool autoFlick: true | ||
66 | |||
67 | default property alias contents: contents.data | ||
68 | |||
69 | Behavior on anchors.leftMargin { | ||
70 | NumberAnimation { duration: 200 } | ||
71 | } | ||
72 | |||
73 | Behavior on anchors.rightMargin { | ||
74 | NumberAnimation { duration: 200 } | ||
75 | } | ||
76 | |||
77 | Rectangle { | ||
78 | color: borderColor | ||
79 | width: 1 | ||
80 | |||
81 | anchors { | ||
82 | top: parent.top | ||
83 | bottom: parent.bottom | ||
84 | right: mode === "left" ? parent.right : undefined | ||
85 | left: mode === "right" ? parent.left : undefined | ||
86 | //rightMargin: -1 | ||
87 | } | ||
88 | } | ||
89 | |||
90 | Item { | ||
91 | clip: true | ||
92 | |||
93 | anchors { | ||
94 | fill: parent | ||
95 | rightMargin: mode === "left" ? 1 : 0 | ||
96 | leftMargin: mode === "right" ? 1 : 0 | ||
97 | } | ||
98 | |||
99 | ListItem.Subheader { | ||
100 | id: headerItem | ||
101 | |||
102 | visible: text !== "" | ||
103 | backgroundColor: root.backgroundColor | ||
104 | elevation: flickable.atYBeginning ? 0 : 1 | ||
105 | fullWidth: true | ||
106 | z: 2 | ||
107 | } | ||
108 | |||
109 | Flickable { | ||
110 | id: flickable | ||
111 | |||
112 | clip: true | ||
113 | |||
114 | anchors { | ||
115 | top: headerItem.visible ? headerItem.bottom : parent.top | ||
116 | left: parent.left | ||
117 | right: parent.right | ||
118 | bottom: parent.bottom | ||
119 | } | ||
120 | |||
121 | contentWidth: width | ||
122 | contentHeight: autoFlick ? contents.height : height | ||
123 | interactive: contentHeight > height | ||
124 | |||
125 | Item { | ||
126 | id: contents | ||
127 | |||
128 | width: flickable.width | ||
129 | height: autoFlick ? childrenRect.height : flickable.height | ||
130 | } | ||
131 | |||
132 | function getFlickableChild(item) { | ||
133 | if (item && item.hasOwnProperty("children")) { | ||
134 | for (var i=0; i < item.children.length; i++) { | ||
135 | var child = item.children[i]; | ||
136 | if (internal.isVerticalFlickable(child)) { | ||
137 | if (child.anchors.top === page.top || child.anchors.fill === page) { | ||
138 | return item.children[i]; | ||
139 | } | ||
140 | } | ||
141 | } | ||
142 | } | ||
143 | return null; | ||
144 | } | ||
145 | } | ||
146 | |||
147 | Scrollbar { | ||
148 | flickableItem: flickable | ||
149 | } | ||
150 | } | ||
151 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/TabBar.qml b/prototype_2016/third_party/qml-material/src/window/TabBar.qml deleted file mode 100644 index 263866d..0000000 --- a/prototype_2016/third_party/qml-material/src/window/TabBar.qml +++ /dev/null | |||
@@ -1,248 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Layouts 1.1 | ||
13 | |||
14 | import Material 0.3 | ||
15 | import Material.ListItems 0.1 | ||
16 | |||
17 | Item { | ||
18 | id: tabBar | ||
19 | |||
20 | property bool centered: false | ||
21 | |||
22 | property var tabs: [] | ||
23 | property int leftKeyline | ||
24 | |||
25 | property bool isLargeDevice: Device.type == Device.desktop || Device.type == Device.tablet | ||
26 | |||
27 | property bool fullWidth: isLargeDevice | ||
28 | ? false : width - maxTabsWidth <= 16 * Units.dp && tabsWidth <= width | ||
29 | |||
30 | property int tabsWidth: { | ||
31 | var width = 0 | ||
32 | |||
33 | for (var i = 0; i < tabRow.children.length; i++) { | ||
34 | width += tabRow.children[i].implicitWidth | ||
35 | } | ||
36 | |||
37 | return width | ||
38 | } | ||
39 | |||
40 | property int maxTabsWidth: { | ||
41 | var tabWidth = 0 | ||
42 | |||
43 | for (var i = 0; i < tabRow.children.length; i++) { | ||
44 | tabWidth = Math.max(tabRow.children[i].implicitWidth, tabWidth) | ||
45 | } | ||
46 | |||
47 | return tabWidth * tabRow.children.length | ||
48 | } | ||
49 | |||
50 | property int tabPadding: isLargeDevice ? 24 * Units.dp : 12 * Units.dp | ||
51 | |||
52 | property int tabMinWidth: isLargeDevice ? 160 * Units.dp : 72 * Units.dp | ||
53 | |||
54 | property int selectedIndex: 0 | ||
55 | |||
56 | property bool darkBackground | ||
57 | |||
58 | property color highlightColor: Theme.tabHighlightColor | ||
59 | property color textColor: darkBackground ? Theme.dark.textColor : Theme.light.accentColor | ||
60 | |||
61 | property bool isTabView: String(tabs).indexOf("TabView") != -1 | ||
62 | |||
63 | readonly property int tabCount: isTabView ? tabs.count : tabs.length | ||
64 | |||
65 | visible: tabCount > 0 | ||
66 | implicitHeight: 48 * Units.dp | ||
67 | |||
68 | onTabCountChanged: { | ||
69 | selectedIndex = Math.min(selectedIndex, tabCount) | ||
70 | } | ||
71 | |||
72 | function removeTab(tab, index) { | ||
73 | if (tab.hasOwnProperty("close")) { | ||
74 | tab.close() | ||
75 | } else if (tabs.hasOwnProperty("removeTab")) { | ||
76 | tabs.removeTab(index) | ||
77 | } | ||
78 | } | ||
79 | |||
80 | property Item activeTab: selectedIndex < tabCount && | ||
81 | tabRow.children[selectedIndex] !== undefined | ||
82 | ? tabRow.children[selectedIndex] : null | ||
83 | |||
84 | property int activeTabX: activeTab ? activeTab.x : -1 | ||
85 | property int activeTabWidth: activeTab ? activeTab.width : -1 | ||
86 | |||
87 | property int __animated | ||
88 | |||
89 | onActiveTabChanged: __animated = false | ||
90 | |||
91 | Component.onCompleted: animateStablization.restart() | ||
92 | |||
93 | onActiveTabXChanged: { | ||
94 | if (activeTabX == -1) | ||
95 | return | ||
96 | if (__animated) { | ||
97 | selectionIndicator.x = activeTab.x | ||
98 | } else { | ||
99 | animateStablization.restart() | ||
100 | } | ||
101 | } | ||
102 | onActiveTabWidthChanged: { | ||
103 | if (activeTabWidth == -1) | ||
104 | return | ||
105 | if (__animated) { | ||
106 | selectionIndicator.width = activeTab.width | ||
107 | } else { | ||
108 | animateStablization.restart() | ||
109 | } | ||
110 | } | ||
111 | |||
112 | Timer { | ||
113 | id: animateStablization | ||
114 | interval: 5 | ||
115 | onTriggered: { | ||
116 | __animated = true | ||
117 | seqX.to = activeTabX | ||
118 | seqWidth.to = activeTabWidth | ||
119 | selectionAnimation.restart() | ||
120 | } | ||
121 | } | ||
122 | |||
123 | ParallelAnimation { | ||
124 | id: selectionAnimation | ||
125 | |||
126 | NumberAnimation { | ||
127 | id: seqX | ||
128 | target: selectionIndicator; property: "x"; duration: 200 | ||
129 | } | ||
130 | NumberAnimation { | ||
131 | id: seqWidth | ||
132 | target: selectionIndicator; property: "width"; duration: 200 | ||
133 | } | ||
134 | } | ||
135 | |||
136 | Item { | ||
137 | anchors { | ||
138 | top: parent.top | ||
139 | bottom: parent.bottom | ||
140 | left: centered ? undefined : parent.left | ||
141 | leftMargin: fullWidth ? 0 : Math.max(leftKeyline - tabPadding, 0) | ||
142 | horizontalCenter: centered ? parent.horizontalCenter : undefined | ||
143 | } | ||
144 | |||
145 | width: tabRow.width | ||
146 | |||
147 | Row { | ||
148 | id: tabRow | ||
149 | |||
150 | height: parent.height | ||
151 | |||
152 | Repeater { | ||
153 | id: repeater | ||
154 | model: isTabView ? tabs.count : tabs | ||
155 | delegate: tabDelegate | ||
156 | } | ||
157 | } | ||
158 | |||
159 | Rectangle { | ||
160 | id: selectionIndicator | ||
161 | anchors { | ||
162 | bottom: parent.bottom | ||
163 | } | ||
164 | |||
165 | height: 2 * Units.dp | ||
166 | color: tabBar.highlightColor | ||
167 | } | ||
168 | } | ||
169 | |||
170 | Component { | ||
171 | id: tabDelegate | ||
172 | |||
173 | View { | ||
174 | id: tabItem | ||
175 | |||
176 | width: tabBar.fullWidth ? tabBar.width/repeater.count : implicitWidth | ||
177 | height: tabBar.height | ||
178 | |||
179 | implicitWidth: isLargeDevice | ||
180 | ? Math.min(2 * tabPadding + row.width, 264 * Units.dp) | ||
181 | : Math.min(Math.max(2 * tabPadding + row.width, tabMinWidth), 264 * Units.dp) | ||
182 | |||
183 | |||
184 | property bool selected: index == tabBar.selectedIndex | ||
185 | |||
186 | property var tab: isTabView ? tabs.getTab(index) : modelData | ||
187 | |||
188 | Ink { | ||
189 | anchors.fill: parent | ||
190 | enabled: tab.enabled | ||
191 | onClicked: tabBar.selectedIndex = index | ||
192 | |||
193 | Row { | ||
194 | id: row | ||
195 | |||
196 | anchors.centerIn: parent | ||
197 | spacing: 10 * Units.dp | ||
198 | |||
199 | Icon { | ||
200 | anchors.verticalCenter: parent.verticalCenter | ||
201 | |||
202 | source: tabItem.tab.hasOwnProperty("iconSource") | ||
203 | ? tabItem.tab.iconSource : tabItem.tab.hasOwnProperty("iconName") | ||
204 | ? "icon://" + tabItem.tab.iconName : "" | ||
205 | color: tabItem.selected | ||
206 | ? darkBackground ? Theme.dark.iconColor : Theme.light.accentColor | ||
207 | : darkBackground ? Theme.dark.shade(tab.enabled ? 0.6 : 0.2) : Theme.light.shade(tab.enabled ? 0.6 : 0.2) | ||
208 | |||
209 | visible: source != "" && source != "icon://" | ||
210 | |||
211 | Behavior on color { | ||
212 | ColorAnimation { duration: 200 } | ||
213 | } | ||
214 | } | ||
215 | |||
216 | Label { | ||
217 | id: label | ||
218 | |||
219 | text: typeof(tabItem.tab) == "string" | ||
220 | ? tabItem.tab : tabItem.tab.title | ||
221 | color: tabItem.selected | ||
222 | ? darkBackground ? Theme.dark.textColor : Theme.light.accentColor | ||
223 | : darkBackground ? Theme.dark.shade(tab.enabled ? 0.6 : 0.2) : Theme.light.shade(tab.enabled ? 0.6 : 0.2) | ||
224 | |||
225 | style: "body2" | ||
226 | font.capitalization: Font.AllUppercase | ||
227 | anchors.verticalCenter: parent.verticalCenter | ||
228 | maximumLineCount: 2 | ||
229 | |||
230 | Behavior on color { | ||
231 | ColorAnimation { duration: 200 } | ||
232 | } | ||
233 | } | ||
234 | |||
235 | IconButton { | ||
236 | iconName: "navigation/close" | ||
237 | visible: tab.hasOwnProperty("canRemove") && tab.canRemove && (tabs.hasOwnProperty("removeTab") || tab.hasOwnProperty("close")) | ||
238 | color: tabItem.selected | ||
239 | ? darkBackground ? Theme.dark.iconColor : Theme.light.accentColor | ||
240 | : darkBackground ? Theme.dark.shade(tab.enabled ? 0.6 : 0.2) : Theme.light.shade(tab.enabled ? 0.6 : 0.2) | ||
241 | onClicked: tabBar.removeTab(tab, index) | ||
242 | size: 20 * Units.dp | ||
243 | } | ||
244 | } | ||
245 | } | ||
246 | } | ||
247 | } | ||
248 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/TabbedPage.qml b/prototype_2016/third_party/qml-material/src/window/TabbedPage.qml deleted file mode 100644 index 423abb8..0000000 --- a/prototype_2016/third_party/qml-material/src/window/TabbedPage.qml +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import QtQuick.Controls.Styles 1.3 as Styles | ||
14 | |||
15 | /*! | ||
16 | \qmltype TabbedPage | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A special page for tabs. | ||
20 | |||
21 | This adds a full-size TabView to a page add hooks up the tab bar to the TabView. | ||
22 | */ | ||
23 | Page { | ||
24 | id: page | ||
25 | |||
26 | default property alias content: tabView.data | ||
27 | |||
28 | /*! | ||
29 | * The currently selected tab. | ||
30 | * | ||
31 | * \since 0.3 | ||
32 | */ | ||
33 | readonly property Tab selectedTab: tabView.count > 0 | ||
34 | ? tabView.getTab(selectedTabIndex) : null | ||
35 | |||
36 | tabs: tabView | ||
37 | |||
38 | onSelectedTabIndexChanged: tabView.currentIndex = page.selectedTabIndex | ||
39 | |||
40 | Controls.TabView { | ||
41 | id: tabView | ||
42 | |||
43 | currentIndex: page.selectedTabIndex | ||
44 | anchors.fill: parent | ||
45 | |||
46 | tabsVisible: false | ||
47 | |||
48 | // Override the style to remove the frame | ||
49 | style: Styles.TabViewStyle { | ||
50 | frameOverlap: 0 | ||
51 | frame: Item {} | ||
52 | } | ||
53 | |||
54 | onCurrentIndexChanged: page.selectedTabIndex = currentIndex | ||
55 | |||
56 | onCountChanged: { | ||
57 | for (var i = 0; i < count; i++) { | ||
58 | var tab = getTab(i) | ||
59 | if (tab.hasOwnProperty("index")) | ||
60 | tab.index = i | ||
61 | if (tab.hasOwnProperty("__tabView")) | ||
62 | tab.__tabView = tabView | ||
63 | } | ||
64 | } | ||
65 | } | ||
66 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/Toolbar.qml b/prototype_2016/third_party/qml-material/src/window/Toolbar.qml deleted file mode 100644 index b361adf..0000000 --- a/prototype_2016/third_party/qml-material/src/window/Toolbar.qml +++ /dev/null | |||
@@ -1,239 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import QtQuick.Controls 1.3 as Controls | ||
13 | import QtQuick.Layouts 1.1 | ||
14 | import Material 0.3 | ||
15 | |||
16 | |||
17 | /*! | ||
18 | \qmltype Toolbar | ||
19 | \inqmlmodule Material | ||
20 | |||
21 | \brief Provides the container used to hold the action bar of pages. | ||
22 | */ | ||
23 | View { | ||
24 | id: toolbar | ||
25 | |||
26 | anchors { | ||
27 | top: parent.top | ||
28 | left: parent.left | ||
29 | right: parent.right | ||
30 | } | ||
31 | |||
32 | property int actionBarHeight: { | ||
33 | if (!page || page.actionBar.hidden) | ||
34 | return 0 | ||
35 | |||
36 | var height = implicitHeight + page.actionBar.extendedHeight | ||
37 | |||
38 | if (page.rightSidebar && page.rightSidebar.showing) { | ||
39 | var sidebarHeight = implicitHeight + page.rightSidebar.actionBar.extendedHeight | ||
40 | |||
41 | height = Math.max(height, sidebarHeight) | ||
42 | } | ||
43 | |||
44 | return height | ||
45 | } | ||
46 | property int targetHeight: actionBarHeight | ||
47 | property int maxActionCount: Device.type === Device.desktop | ||
48 | ? 5 : Device.type === Device.tablet ? 4 : 3 | ||
49 | property bool clientSideDecorations: false | ||
50 | property string color: "white" | ||
51 | property var page | ||
52 | property bool showBackButton | ||
53 | |||
54 | property color decorationColor: page && page.actionBar | ||
55 | ? page.actionBar.decorationColor | ||
56 | : Theme.primaryDarkColor | ||
57 | |||
58 | opacity: page && page.actionBar.hidden ? 0 : 1 | ||
59 | |||
60 | backgroundColor: page ? page.actionBar.backgroundColor.a === 0 | ||
61 | ? page.backgroundColor : page.actionBar.backgroundColor | ||
62 | : Theme.primaryColor | ||
63 | |||
64 | implicitHeight: 1 * Device.gridUnit * Units.dp | ||
65 | height: targetHeight | ||
66 | elevation: backgroundColor === page.color ? 0 : page.actionBar.elevation | ||
67 | fullWidth: true | ||
68 | clipContent: true | ||
69 | |||
70 | Behavior on decorationColor { | ||
71 | ColorAnimation { duration: MaterialAnimation.pageTransitionDuration } | ||
72 | } | ||
73 | |||
74 | Behavior on height { | ||
75 | NumberAnimation { duration: MaterialAnimation.pageTransitionDuration } | ||
76 | } | ||
77 | |||
78 | Behavior on opacity { | ||
79 | NumberAnimation { duration: MaterialAnimation.pageTransitionDuration } | ||
80 | } | ||
81 | |||
82 | function pop(page) { | ||
83 | stack.pop(page.actionBar) | ||
84 | |||
85 | if (page.rightSidebar && page.rightSidebar.actionBar) | ||
86 | rightSidebarStack.pop(page.rightSidebar.actionBar) | ||
87 | else | ||
88 | rightSidebarStack.pop(emptyRightSidebar) | ||
89 | |||
90 | toolbar.page = page | ||
91 | } | ||
92 | |||
93 | function push(page) { | ||
94 | stack.push(page.actionBar) | ||
95 | |||
96 | page.actionBar.toolbar = toolbar | ||
97 | toolbar.page = page | ||
98 | |||
99 | if (page.rightSidebar && page.rightSidebar.actionBar) | ||
100 | rightSidebarStack.push(page.rightSidebar.actionBar) | ||
101 | else | ||
102 | rightSidebarStack.push(emptyRightSidebar) | ||
103 | } | ||
104 | |||
105 | function replace(page) { | ||
106 | page.actionBar.maxActionCount = Qt.binding(function() { return toolbar.maxActionCount }) | ||
107 | toolbar.page = page | ||
108 | |||
109 | stack.replace(page.actionBar) | ||
110 | |||
111 | if (page.rightSidebar && page.rightSidebar.actionBar) | ||
112 | rightSidebarStack.replace(page.rightSidebar.actionBar) | ||
113 | else | ||
114 | rightSidebarStack.replace(emptyRightSidebar) | ||
115 | } | ||
116 | |||
117 | Rectangle { | ||
118 | anchors.fill: rightSidebarStack | ||
119 | |||
120 | color: page.rightSidebar && page.rightSidebar.actionBar.backgroundColor | ||
121 | ? Qt.darker(page.rightSidebar.actionBar.backgroundColor,1).a === 0 | ||
122 | ? page.rightSidebar.color | ||
123 | : page.rightSidebar.actionBar.backgroundColor | ||
124 | : Theme.primaryColor | ||
125 | } | ||
126 | |||
127 | Controls.StackView { | ||
128 | id: stack | ||
129 | height: actionBarHeight | ||
130 | |||
131 | Behavior on height { | ||
132 | NumberAnimation { duration: MaterialAnimation.pageTransitionDuration } | ||
133 | } | ||
134 | |||
135 | anchors { | ||
136 | left: parent.left | ||
137 | right: page && page.rightSidebar | ||
138 | ? rightSidebarStack.left | ||
139 | : clientSideDecorations ? windowControls.left : parent.right | ||
140 | rightMargin: 0 | ||
141 | } | ||
142 | |||
143 | delegate: toolbarDelegate | ||
144 | } | ||
145 | |||
146 | Controls.StackView { | ||
147 | id: rightSidebarStack | ||
148 | height: actionBarHeight | ||
149 | width: page && page.rightSidebar | ||
150 | ? page.rightSidebar.width | ||
151 | : 0 | ||
152 | |||
153 | Behavior on height { | ||
154 | NumberAnimation { duration: MaterialAnimation.pageTransitionDuration } | ||
155 | } | ||
156 | |||
157 | anchors { | ||
158 | right: clientSideDecorations ? windowControls.left : parent.right | ||
159 | rightMargin: page.rightSidebar ? page.rightSidebar.anchors.rightMargin : 0 | ||
160 | } | ||
161 | |||
162 | delegate: toolbarDelegate | ||
163 | } | ||
164 | |||
165 | Controls.StackViewDelegate { | ||
166 | id: toolbarDelegate | ||
167 | |||
168 | pushTransition: Controls.StackViewTransition { | ||
169 | SequentialAnimation { | ||
170 | id: actionBarShowAnimation | ||
171 | |||
172 | ParallelAnimation { | ||
173 | NumberAnimation { | ||
174 | duration: MaterialAnimation.pageTransitionDuration | ||
175 | target: enterItem | ||
176 | property: "opacity" | ||
177 | from: 0 | ||
178 | to: 1 | ||
179 | } | ||
180 | |||
181 | NumberAnimation { | ||
182 | duration: MaterialAnimation.pageTransitionDuration | ||
183 | target: enterItem | ||
184 | property: "y" | ||
185 | from: enterItem.height | ||
186 | to: 0 | ||
187 | } | ||
188 | } | ||
189 | } | ||
190 | SequentialAnimation { | ||
191 | id: previousHideAnimation | ||
192 | |||
193 | ParallelAnimation { | ||
194 | |||
195 | NumberAnimation { | ||
196 | duration: MaterialAnimation.pageTransitionDuration | ||
197 | target: exitItem | ||
198 | property: "opacity" | ||
199 | to: 0 | ||
200 | } | ||
201 | |||
202 | NumberAnimation { | ||
203 | duration: MaterialAnimation.pageTransitionDuration | ||
204 | target: exitItem | ||
205 | property: "y" | ||
206 | to: exitItem ? -exitItem.height : 0 | ||
207 | } | ||
208 | } | ||
209 | } | ||
210 | } | ||
211 | } | ||
212 | |||
213 | Row { | ||
214 | id: windowControls | ||
215 | |||
216 | visible: clientSideDecorations | ||
217 | |||
218 | anchors { | ||
219 | verticalCenter: stack.verticalCenter | ||
220 | right: parent.right | ||
221 | rightMargin: 16 * Units.dp | ||
222 | } | ||
223 | |||
224 | spacing: 24 * Units.dp | ||
225 | |||
226 | IconButton { | ||
227 | iconName: "navigation/close" | ||
228 | color: Theme.lightDark(toolbar.backgroundColor, Theme.light.textColor, | ||
229 | Theme.dark.textColor) | ||
230 | onClicked: Qt.quit() | ||
231 | } | ||
232 | } | ||
233 | |||
234 | Component { | ||
235 | id: emptyRightSidebar | ||
236 | |||
237 | Item {} | ||
238 | } | ||
239 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/Window.qml b/prototype_2016/third_party/qml-material/src/window/Window.qml deleted file mode 100644 index ebf3883..0000000 --- a/prototype_2016/third_party/qml-material/src/window/Window.qml +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | import Material 0.3 | ||
13 | import QtQuick.Window 2.2 | ||
14 | |||
15 | /*! | ||
16 | \qmltype Window | ||
17 | \inqmlmodule Material | ||
18 | |||
19 | \brief A subclass of QtQuick.Window that provides some additional features for developing Applications | ||
20 | that conform to Material Design. | ||
21 | |||
22 | Here is a short working example of an application: | ||
23 | |||
24 | \qml | ||
25 | import QtQuick 2.4 | ||
26 | import Material 0.3 | ||
27 | |||
28 | Window { | ||
29 | title: "Application Name" | ||
30 | } | ||
31 | \endqml | ||
32 | */ | ||
33 | Window { | ||
34 | id: window | ||
35 | |||
36 | /*! | ||
37 | \qmlproperty AppTheme theme | ||
38 | |||
39 | A grouped property that allows the application to customize the the primary color, the | ||
40 | primary dark color, and the accent color. See \l Theme for more details. | ||
41 | */ | ||
42 | property alias theme: __theme | ||
43 | |||
44 | PlatformExtensions { | ||
45 | id: platformExtensions | ||
46 | decorationColor: Theme.primaryDarkColor | ||
47 | window: window | ||
48 | } | ||
49 | |||
50 | AppTheme { | ||
51 | id: __theme | ||
52 | } | ||
53 | |||
54 | OverlayLayer { | ||
55 | id: dialogOverlayLayer | ||
56 | objectName: "dialogOverlayLayer" | ||
57 | } | ||
58 | |||
59 | OverlayLayer { | ||
60 | id: tooltipOverlayLayer | ||
61 | objectName: "tooltipOverlayLayer" | ||
62 | } | ||
63 | |||
64 | OverlayLayer { | ||
65 | id: overlayLayer | ||
66 | } | ||
67 | |||
68 | width: dp(800) | ||
69 | height: dp(600) | ||
70 | |||
71 | // Units | ||
72 | |||
73 | function dp(dp) { | ||
74 | return dp * Units.dp | ||
75 | } | ||
76 | |||
77 | function gu(gu) { | ||
78 | return units.gu(gu) | ||
79 | } | ||
80 | |||
81 | UnitsHelper { | ||
82 | id: units | ||
83 | } | ||
84 | } | ||
diff --git a/prototype_2016/third_party/qml-material/src/window/window.qrc b/prototype_2016/third_party/qml-material/src/window/window.qrc deleted file mode 100644 index 3fa81d0..0000000 --- a/prototype_2016/third_party/qml-material/src/window/window.qrc +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | <!DOCTYPE RCC> | ||
2 | <RCC version="1.0"> | ||
3 | |||
4 | <qresource prefix="/Material"> | ||
5 | <file>ActionBar.qml</file> | ||
6 | <file>AppTheme.qml</file> | ||
7 | <file>ApplicationWindow.qml</file> | ||
8 | <file>MainView.qml</file> | ||
9 | <file>NavigationDrawer.qml</file> | ||
10 | <file>NavigationDrawerPage.qml</file> | ||
11 | <file>Page.qml</file> | ||
12 | <file>PageSidebar.qml</file> | ||
13 | <file>PageStack.qml</file> | ||
14 | <file>Sidebar.qml</file> | ||
15 | <file>TabBar.qml</file> | ||
16 | <file>TabbedPage.qml</file> | ||
17 | <file>Toolbar.qml</file> | ||
18 | <file>Window.qml</file> | ||
19 | </qresource> | ||
20 | |||
21 | </RCC> | ||