summaryrefslogtreecommitdiff
path: root/prototype_2016/resources/qml
diff options
context:
space:
mode:
Diffstat (limited to 'prototype_2016/resources/qml')
-rw-r--r--prototype_2016/resources/qml/+material/StyledRectangle.qml22
-rw-r--r--prototype_2016/resources/qml/+universal/StyledRectangle.qml22
-rw-r--r--prototype_2016/resources/qml/BasicComponents.qml80
-rw-r--r--prototype_2016/resources/qml/CMakeLists.txt10
-rw-r--r--prototype_2016/resources/qml/CompoundComponents.qml76
-rw-r--r--prototype_2016/resources/qml/MaterialComponents.qml74
-rw-r--r--prototype_2016/resources/qml/NavigationComponents.qml74
-rw-r--r--prototype_2016/resources/qml/Pages/Basic/BusyIndicatorPage.qml44
-rw-r--r--prototype_2016/resources/qml/Pages/Basic/ButtonPage.qml115
-rw-r--r--prototype_2016/resources/qml/Pages/Basic/CheckBoxPage.qml101
-rw-r--r--prototype_2016/resources/qml/Pages/Basic/ProgressBarPage.qml127
-rw-r--r--prototype_2016/resources/qml/Pages/Basic/RadioButtonPage.qml100
-rw-r--r--prototype_2016/resources/qml/Pages/Basic/SliderPage.qml152
-rw-r--r--prototype_2016/resources/qml/Pages/Basic/SwitchPage.qml100
-rw-r--r--prototype_2016/resources/qml/Pages/Compound/CardPage.qml76
-rw-r--r--prototype_2016/resources/qml/Pages/Compound/InfoBarPage.qml30
-rw-r--r--prototype_2016/resources/qml/Pages/Compound/ListItemPage.qml40
-rw-r--r--prototype_2016/resources/qml/Pages/Compound/SubPage.qml31
-rw-r--r--prototype_2016/resources/qml/Pages/Material/ActionButtonPage.qml68
-rw-r--r--prototype_2016/resources/qml/Pages/Material/WavePage.qml41
-rw-r--r--prototype_2016/resources/qml/Pages/Navigation/NavDrawerPage.qml26
-rw-r--r--prototype_2016/resources/qml/Pages/Style/PalettePage.qml135
-rw-r--r--prototype_2016/resources/qml/Pages/Style/PaletteSwatch.qml173
-rw-r--r--prototype_2016/resources/qml/Pages/Style/TypographyPage.qml87
-rw-r--r--prototype_2016/resources/qml/Style.qml75
-rw-r--r--prototype_2016/resources/qml/StyledRectangle.qml21
-rw-r--r--prototype_2016/resources/qml/main.qml104
-rw-r--r--prototype_2016/resources/qml/qml.qrc31
-rw-r--r--prototype_2016/resources/qml/qtquickcontrols2.conf2
29 files changed, 2037 insertions, 0 deletions
diff --git a/prototype_2016/resources/qml/+material/StyledRectangle.qml b/prototype_2016/resources/qml/+material/StyledRectangle.qml
new file mode 100644
index 0000000..7da64ab
--- /dev/null
+++ b/prototype_2016/resources/qml/+material/StyledRectangle.qml
@@ -0,0 +1,22 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls.Material 2.0
17
18Rectangle {
19 color: Material.background
20
21 Material.theme: index == 0 ? Material.Light : Material.Dark
22}
diff --git a/prototype_2016/resources/qml/+universal/StyledRectangle.qml b/prototype_2016/resources/qml/+universal/StyledRectangle.qml
new file mode 100644
index 0000000..ca1999b
--- /dev/null
+++ b/prototype_2016/resources/qml/+universal/StyledRectangle.qml
@@ -0,0 +1,22 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls.Universal 2.0
17
18Rectangle {
19 color: Universal.background
20
21 Universal.theme: index == 0 ? Universal.Light : Universal.Dark
22}
diff --git a/prototype_2016/resources/qml/BasicComponents.qml b/prototype_2016/resources/qml/BasicComponents.qml
new file mode 100644
index 0000000..a46f083
--- /dev/null
+++ b/prototype_2016/resources/qml/BasicComponents.qml
@@ -0,0 +1,80 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import QtQuick.Controls.Universal 2.0
19import Fluid.Controls 1.0
20import "Pages/Basic"
21
22Tab {
23 title: qsTr("Basic")
24
25 Pane {
26 id: listPane
27 anchors {
28 left: parent.left
29 top: parent.top
30 bottom: parent.bottom
31 }
32 width: 200
33 padding: 0
34 z: 2
35
36 Material.background: "white"
37 Material.elevation: 1
38
39 Universal.background: Universal.accent
40
41 ListView {
42 id: listView
43 anchors.fill: parent
44 currentIndex: 0
45 model: ListModel {
46 ListElement { title: qsTr("Button"); source: "qrc:/Pages/Basic/ButtonPage.qml" }
47 ListElement { title: qsTr("CheckBox"); source: "qrc:/Pages/Basic/CheckBoxPage.qml" }
48 ListElement { title: qsTr("RadioButton"); source: "qrc:/Pages/Basic/RadioButtonPage.qml" }
49 ListElement { title: qsTr("Switch"); source: "qrc:/Pages/Basic/SwitchPage.qml" }
50 ListElement { title: qsTr("ProgressBar"); source: "qrc:/Pages/Basic/ProgressBarPage.qml" }
51 ListElement { title: qsTr("BusyIndicator"); source: "qrc:/Pages/Basic/BusyIndicatorPage.qml" }
52 ListElement { title: qsTr("Slider"); source: "qrc:/Pages/Basic/SliderPage.qml" }
53 }
54 header: Subheader {
55 text: qsTr("Demos")
56 }
57 delegate: ListItem {
58 text: model.title
59 highlighted: ListView.isCurrentItem
60 onClicked: {
61 listView.currentIndex = index
62 stackView.push(model.source)
63 }
64 }
65
66 ScrollBar.vertical: ScrollBar {}
67 }
68 }
69
70 StackView {
71 id: stackView
72 anchors {
73 left: listPane.right
74 top: parent.top
75 right: parent.right
76 bottom: parent.bottom
77 }
78 initialItem: ButtonPage {}
79 }
80}
diff --git a/prototype_2016/resources/qml/CMakeLists.txt b/prototype_2016/resources/qml/CMakeLists.txt
new file mode 100644
index 0000000..a4f9ab6
--- /dev/null
+++ b/prototype_2016/resources/qml/CMakeLists.txt
@@ -0,0 +1,10 @@
1set(SOURCES main.cpp demo.qrc)
2file(GLOB_RECURSE QML_SOURCES
3 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.qml")
4
5add_executable(fluid-demo ${SOURCES} ${QML_SOURCES})
6target_link_libraries(fluid-demo Qt5::Gui Qt5::Qml Qt5::QuickControls2)
7
8install(TARGETS fluid-demo
9 BUNDLE DESTINATION .
10 RUNTIME DESTINATION ${BIN_INSTALL_DIR})
diff --git a/prototype_2016/resources/qml/CompoundComponents.qml b/prototype_2016/resources/qml/CompoundComponents.qml
new file mode 100644
index 0000000..2de7bd2
--- /dev/null
+++ b/prototype_2016/resources/qml/CompoundComponents.qml
@@ -0,0 +1,76 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import QtQuick.Controls.Universal 2.0
19import Fluid.Controls 1.0
20import "Pages/Compound"
21
22Tab {
23 title: qsTr("Compound")
24
25 Pane {
26 id: listPane
27 anchors {
28 left: parent.left
29 top: parent.top
30 bottom: parent.bottom
31 }
32 width: 200
33 padding: 0
34 z: 2
35
36 Material.background: "white"
37 Material.elevation: 1
38
39 Universal.background: Universal.accent
40
41 ListView {
42 id: listView
43 anchors.fill: parent
44 currentIndex: 0
45 model: ListModel {
46 ListElement { title: qsTr("ListItem"); source: "qrc:/Pages/Compound/ListItemPage.qml" }
47 ListElement { title: qsTr("Card"); source: "qrc:/Pages/Compound/CardPage.qml" }
48 ListElement { title: qsTr("InfoBar"); source: "qrc:/Pages/Compound/InfoBarPage.qml" }
49 }
50 header: Subheader {
51 text: qsTr("Demos")
52 }
53 delegate: ListItem {
54 text: model.title
55 highlighted: ListView.isCurrentItem
56 onClicked: {
57 listView.currentIndex = index
58 stackView.push(model.source)
59 }
60 }
61
62 ScrollBar.vertical: ScrollBar {}
63 }
64 }
65
66 StackView {
67 id: stackView
68 anchors {
69 left: listPane.right
70 top: parent.top
71 right: parent.right
72 bottom: parent.bottom
73 }
74 initialItem: ListItemPage {}
75 }
76}
diff --git a/prototype_2016/resources/qml/MaterialComponents.qml b/prototype_2016/resources/qml/MaterialComponents.qml
new file mode 100644
index 0000000..444b049
--- /dev/null
+++ b/prototype_2016/resources/qml/MaterialComponents.qml
@@ -0,0 +1,74 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import QtQuick.Controls.Universal 2.0
19import Fluid.Controls 1.0
20import "Pages/Material"
21
22Tab {
23 title: qsTr("Material")
24
25 Pane {
26 id: listPane
27 anchors {
28 left: parent.left
29 top: parent.top
30 bottom: parent.bottom
31 }
32 width: 200
33 padding: 0
34 z: 2
35
36 Material.background: "white"
37 Material.elevation: 1
38
39 Universal.background: Universal.accent
40
41 ListView {
42 id: listView
43 anchors.fill: parent
44 currentIndex: 0
45 model: ListModel {
46 ListElement { title: qsTr("ActionButton"); source: "qrc:/Pages/Material/ActionButtonPage.qml" }
47 }
48 header: Subheader {
49 text: qsTr("Demos")
50 }
51 delegate: ListItem {
52 text: model.title
53 highlighted: ListView.isCurrentItem
54 onClicked: {
55 listView.currentIndex = index
56 stackView.push(model.source)
57 }
58 }
59
60 ScrollBar.vertical: ScrollBar {}
61 }
62 }
63
64 StackView {
65 id: stackView
66 anchors {
67 left: listPane.right
68 top: parent.top
69 right: parent.right
70 bottom: parent.bottom
71 }
72 initialItem: ActionButtonPage {}
73 }
74}
diff --git a/prototype_2016/resources/qml/NavigationComponents.qml b/prototype_2016/resources/qml/NavigationComponents.qml
new file mode 100644
index 0000000..ce0a2fd
--- /dev/null
+++ b/prototype_2016/resources/qml/NavigationComponents.qml
@@ -0,0 +1,74 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import QtQuick.Controls.Universal 2.0
19import Fluid.Controls 1.0
20import "Pages/Navigation"
21
22Tab {
23 title: qsTr("Navigation")
24
25 Pane {
26 id: listPane
27 anchors {
28 left: parent.left
29 top: parent.top
30 bottom: parent.bottom
31 }
32 width: 200
33 padding: 0
34 z: 2
35
36 Material.background: "white"
37 Material.elevation: 1
38
39 Universal.background: Universal.accent
40
41 ListView {
42 id: listView
43 anchors.fill: parent
44 currentIndex: 0
45 model: ListModel {
46 ListElement { title: qsTr("NavigationDrawer"); source: "qrc:/Pages/Navigation/NavDrawerPage.qml" }
47 }
48 header: Subheader {
49 text: qsTr("Demos")
50 }
51 delegate: ListItem {
52 text: model.title
53 highlighted: ListView.isCurrentItem
54 onClicked: {
55 listView.currentIndex = index
56 stackView.push(model.source)
57 }
58 }
59
60 ScrollBar.vertical: ScrollBar {}
61 }
62 }
63
64 StackView {
65 id: stackView
66 anchors {
67 left: listPane.right
68 top: parent.top
69 right: parent.right
70 bottom: parent.bottom
71 }
72 initialItem: NavDrawerPage {}
73 }
74}
diff --git a/prototype_2016/resources/qml/Pages/Basic/BusyIndicatorPage.qml b/prototype_2016/resources/qml/Pages/Basic/BusyIndicatorPage.qml
new file mode 100644
index 0000000..1a6341e
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Basic/BusyIndicatorPage.qml
@@ -0,0 +1,44 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Layouts 1.0
18import "../.."
19
20Flickable {
21 clip: true
22 contentHeight: Math.max(layout.implicitHeight, height)
23
24 ScrollBar.vertical: ScrollBar {}
25
26 ColumnLayout {
27 id: layout
28 anchors.fill: parent
29
30 Repeater {
31 model: 2
32
33 StyledRectangle {
34 Layout.fillWidth: true
35 Layout.fillHeight: true
36
37 BusyIndicator {
38 anchors.centerIn: parent
39 running: true
40 }
41 }
42 }
43 }
44}
diff --git a/prototype_2016/resources/qml/Pages/Basic/ButtonPage.qml b/prototype_2016/resources/qml/Pages/Basic/ButtonPage.qml
new file mode 100644
index 0000000..6cf94fe
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Basic/ButtonPage.qml
@@ -0,0 +1,115 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Layouts 1.0
18import Fluid.Controls 1.0
19import "../.."
20
21Flickable {
22 clip: true
23 contentHeight: Math.max(layout.implicitHeight, height)
24
25 ScrollBar.vertical: ScrollBar {}
26
27 ColumnLayout {
28 id: layout
29 anchors.fill: parent
30
31 Repeater {
32 model: 2
33
34 StyledRectangle {
35 Layout.fillWidth: true
36 Layout.fillHeight: true
37 Layout.minimumWidth: grid.width + 80
38 Layout.minimumHeight: grid.height + 80
39
40 GridLayout {
41 id: grid
42 anchors.centerIn: parent
43 columns: 2
44 rows: 4
45
46 // Row 1
47
48 TitleLabel {
49 text: qsTr("Enabled")
50
51 Layout.alignment: Qt.AlignHCenter
52 }
53
54 TitleLabel {
55 text: qsTr("Disabled")
56
57 Layout.alignment: Qt.AlignHCenter
58 }
59
60 // Row 2
61
62 Button {
63 text: qsTr("Button")
64 }
65
66 Button {
67 text: qsTr("Button")
68 enabled: false
69 }
70
71 // Row 3
72
73 Button {
74 text: qsTr("Checked")
75 checkable: false
76 checked: true
77 }
78
79 Button {
80 text: qsTr("Checked")
81 checkable: false
82 checked: true
83 enabled: false
84 }
85
86 // Row 4
87
88 Button {
89 text: qsTr("Flat")
90 flat: true
91 }
92
93 Button {
94 text: qsTr("Flat")
95 flat: true
96 enabled: false
97 }
98
99 // Row 5
100
101 Button {
102 text: qsTr("Highlighted")
103 highlighted: true
104 }
105
106 Button {
107 text: qsTr("Highlighted")
108 highlighted: true
109 enabled: false
110 }
111 }
112 }
113 }
114 }
115}
diff --git a/prototype_2016/resources/qml/Pages/Basic/CheckBoxPage.qml b/prototype_2016/resources/qml/Pages/Basic/CheckBoxPage.qml
new file mode 100644
index 0000000..6e53e73
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Basic/CheckBoxPage.qml
@@ -0,0 +1,101 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
6 *
7 * $BEGIN_LICENSE:MPL2$
8 *
9 * This Source Code Form is subject to the terms of the Mozilla Public
10 * License, v. 2.0. If a copy of the MPL was not distributed with this
11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
14 */
15
16import QtQuick 2.0
17import QtQuick.Controls 2.0
18import QtQuick.Layouts 1.0
19import Fluid.Controls 1.0
20import "../.."
21
22Flickable {
23 clip: true
24 contentHeight: Math.max(layout.implicitHeight, height)
25
26 ScrollBar.vertical: ScrollBar {}
27
28 ColumnLayout {
29 id: layout
30 anchors.fill: parent
31
32 Repeater {
33 model: 2
34
35 StyledRectangle {
36 Layout.fillWidth: true
37 Layout.fillHeight: true
38 Layout.minimumWidth: grid.width + 80
39 Layout.minimumHeight: grid.height + 80
40
41 GridLayout {
42 id: grid
43 anchors.centerIn: parent
44 columns: 3
45 rows: 3
46
47 // Row 1
48
49 Item {
50 width: 1
51 height: 1
52 }
53
54 TitleLabel {
55 text: qsTr("Enabled")
56
57 Layout.alignment: Qt.AlignHCenter
58 }
59
60 TitleLabel {
61 text: qsTr("Disabled")
62
63 Layout.alignment: Qt.AlignHCenter
64 }
65
66 // Row 2
67
68 Label {
69 text: qsTr("On")
70 }
71
72 CheckBox {
73 checked: true
74 text: qsTr("CheckBox")
75 }
76
77 CheckBox {
78 checked: true
79 enabled: false
80 text: qsTr("CheckBox")
81 }
82
83 // Row 3
84
85 Label {
86 text: qsTr("Off")
87 }
88
89 CheckBox {
90 text: qsTr("CheckBox")
91 }
92
93 CheckBox {
94 text: qsTr("CheckBox")
95 enabled: false
96 }
97 }
98 }
99 }
100 }
101}
diff --git a/prototype_2016/resources/qml/Pages/Basic/ProgressBarPage.qml b/prototype_2016/resources/qml/Pages/Basic/ProgressBarPage.qml
new file mode 100644
index 0000000..440db51
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Basic/ProgressBarPage.qml
@@ -0,0 +1,127 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Layouts 1.0
18import Fluid.Controls 1.0
19import "../.."
20
21Flickable {
22 clip: true
23 contentHeight: Math.max(layout.implicitHeight, height)
24
25 ScrollBar.vertical: ScrollBar {}
26
27 ColumnLayout {
28 id: layout
29 anchors.fill: parent
30
31 Repeater {
32 model: 2
33
34 StyledRectangle {
35 Layout.fillWidth: true
36 Layout.fillHeight: true
37 Layout.minimumWidth: grid.width + 80
38 Layout.minimumHeight: grid.height + 80
39
40 GridLayout {
41 id: grid
42 anchors.centerIn: parent
43 columns: 3
44
45 // Row 1
46
47 Item {
48 width: 1
49 height: 1
50 }
51
52 TitleLabel {
53 text: qsTr("Determinate")
54
55 Layout.alignment: Qt.AlignHCenter
56 }
57
58 TitleLabel {
59 text: qsTr("Indeterminate")
60
61 Layout.alignment: Qt.AlignHCenter
62 }
63
64 // Row 2
65
66 Label {
67 text: qsTr("Static")
68 }
69
70 ProgressBar {
71 from: 0.0
72 to: 1.0
73 value: 0.5
74 indeterminate: false
75 }
76
77 ProgressBar {
78 from: 0.0
79 to: 1.0
80 value: 0.5
81 indeterminate: true
82 }
83
84 // Row 3
85
86 Label {
87 text: qsTr("Animated")
88 }
89
90 ProgressBar {
91 from: 0.0
92 to: 1.0
93 indeterminate: false
94
95 SequentialAnimation on value {
96 running: true
97 loops: NumberAnimation.Infinite
98
99 NumberAnimation {
100 from: 0.0
101 to: 1.0
102 duration: 3000
103 }
104 }
105 }
106
107 ProgressBar {
108 from: 0.0
109 to: 1.0
110 indeterminate: true
111
112 SequentialAnimation on value {
113 running: true
114 loops: NumberAnimation.Infinite
115
116 NumberAnimation {
117 from: 0.0
118 to: 1.0
119 duration: 3000
120 }
121 }
122 }
123 }
124 }
125 }
126 }
127}
diff --git a/prototype_2016/resources/qml/Pages/Basic/RadioButtonPage.qml b/prototype_2016/resources/qml/Pages/Basic/RadioButtonPage.qml
new file mode 100644
index 0000000..80c98d5
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Basic/RadioButtonPage.qml
@@ -0,0 +1,100 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Layouts 1.0
18import Fluid.Controls 1.0
19import "../.."
20
21Flickable {
22 clip: true
23 contentHeight: Math.max(layout.implicitHeight, height)
24
25 ScrollBar.vertical: ScrollBar {}
26
27 ColumnLayout {
28 id: layout
29 anchors.fill: parent
30
31 Repeater {
32 model: 2
33
34 StyledRectangle {
35 Layout.fillWidth: true
36 Layout.fillHeight: true
37 Layout.minimumWidth: grid.width + 80
38 Layout.minimumHeight: grid.height + 80
39
40 GridLayout {
41 id: grid
42 anchors.centerIn: parent
43 columns: 3
44 rows: 3
45
46 // Row 1
47
48 Item {
49 width: 1
50 height: 1
51 }
52
53 TitleLabel {
54 text: qsTr("Enabled")
55
56 Layout.alignment: Qt.AlignHCenter
57 }
58
59 TitleLabel {
60 text: qsTr("Disabled")
61
62 Layout.alignment: Qt.AlignHCenter
63 }
64
65 // Row 2
66
67 Label {
68 text: qsTr("On")
69 }
70
71 RadioButton {
72 checked: true
73 text: qsTr("RadioButton")
74 }
75
76 RadioButton {
77 checked: true
78 enabled: false
79 text: qsTr("RadioButton")
80 }
81
82 // Row 3
83
84 Label {
85 text: qsTr("Off")
86 }
87
88 RadioButton {
89 text: qsTr("RadioButton")
90 }
91
92 RadioButton {
93 text: qsTr("RadioButton")
94 enabled: false
95 }
96 }
97 }
98 }
99 }
100}
diff --git a/prototype_2016/resources/qml/Pages/Basic/SliderPage.qml b/prototype_2016/resources/qml/Pages/Basic/SliderPage.qml
new file mode 100644
index 0000000..72d9c11
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Basic/SliderPage.qml
@@ -0,0 +1,152 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Layouts 1.0
18import Fluid.Controls 1.0
19import "../.."
20
21Flickable {
22 clip: true
23 contentHeight: Math.max(layout.implicitHeight, height)
24
25 ScrollBar.vertical: ScrollBar {}
26
27 ColumnLayout {
28 id: layout
29 anchors.fill: parent
30
31 Repeater {
32 model: 2
33
34 StyledRectangle {
35 Layout.fillWidth: true
36 Layout.fillHeight: true
37 Layout.minimumWidth: grid.width + 80
38 Layout.minimumHeight: grid.height + 80
39
40 GridLayout {
41 id: grid
42 anchors.centerIn: parent
43 columns: 3
44 rows: 3
45
46 // Row 1
47
48 Item {
49 width: 1
50 height: 1
51 }
52
53 TitleLabel {
54 text: qsTr("Enabled")
55
56 Layout.alignment: Qt.AlignHCenter
57 }
58
59 TitleLabel {
60 text: qsTr("Disabled")
61
62 Layout.alignment: Qt.AlignHCenter
63 }
64
65 // Row 2
66
67 Label {
68 text: qsTr("Horizontal / Single")
69 }
70
71 Slider {
72 from: 0.0
73 to: 1.0
74 value: 0.5
75 }
76
77 Slider {
78 from: 0.0
79 to: 1.0
80 value: 0.5
81 enabled: false
82 }
83
84 // Row 3
85
86 Label {
87 text: qsTr("Horizontal / Range")
88 }
89
90 RangeSlider {
91 from: 0.0
92 to: 1.0
93 first.value: 0.4
94 second.value: 0.6
95 }
96
97 RangeSlider {
98 from: 0.0
99 to: 1.0
100 first.value: 0.4
101 second.value: 0.6
102 enabled: false
103 }
104
105 // Row 4
106
107 Label {
108 text: qsTr("Vertical / Single")
109 }
110
111 Slider {
112 from: 0.0
113 to: 1.0
114 value: 0.5
115 orientation: Qt.Vertical
116 }
117
118 Slider {
119 from: 0.0
120 to: 1.0
121 value: 0.5
122 enabled: false
123 orientation: Qt.Vertical
124 }
125
126 // Row 5
127
128 Label {
129 text: qsTr("Vertical / Range")
130 }
131
132 RangeSlider {
133 from: 0.0
134 to: 1.0
135 first.value: 0.4
136 second.value: 0.6
137 orientation: Qt.Vertical
138 }
139
140 RangeSlider {
141 from: 0.0
142 to: 1.0
143 first.value: 0.4
144 second.value: 0.6
145 enabled: false
146 orientation: Qt.Vertical
147 }
148 }
149 }
150 }
151 }
152}
diff --git a/prototype_2016/resources/qml/Pages/Basic/SwitchPage.qml b/prototype_2016/resources/qml/Pages/Basic/SwitchPage.qml
new file mode 100644
index 0000000..15c679b
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Basic/SwitchPage.qml
@@ -0,0 +1,100 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Layouts 1.0
18import Fluid.Controls 1.0
19import "../.."
20
21Flickable {
22 clip: true
23 contentHeight: Math.max(layout.implicitHeight, height)
24
25 ScrollBar.vertical: ScrollBar {}
26
27 ColumnLayout {
28 id: layout
29 anchors.fill: parent
30
31 Repeater {
32 model: 2
33
34 StyledRectangle {
35 Layout.fillWidth: true
36 Layout.fillHeight: true
37 Layout.minimumWidth: grid.width + 80
38 Layout.minimumHeight: grid.height + 80
39
40 GridLayout {
41 id: grid
42 anchors.centerIn: parent
43 columns: 3
44 rows: 3
45
46 // Row 1
47
48 Item {
49 width: 1
50 height: 1
51 }
52
53 TitleLabel {
54 text: qsTr("Enabled")
55
56 Layout.alignment: Qt.AlignHCenter
57 }
58
59 TitleLabel {
60 text: qsTr("Disabled")
61
62 Layout.alignment: Qt.AlignHCenter
63 }
64
65 // Row 2
66
67 Label {
68 text: qsTr("On")
69 }
70
71 Switch {
72 checked: true
73 text: qsTr("Switch")
74 }
75
76 Switch {
77 checked: true
78 enabled: false
79 text: qsTr("Switch")
80 }
81
82 // Row 3
83
84 Label {
85 text: qsTr("Off")
86 }
87
88 Switch {
89 text: qsTr("Switch")
90 }
91
92 Switch {
93 text: qsTr("Switch")
94 enabled: false
95 }
96 }
97 }
98 }
99 }
100}
diff --git a/prototype_2016/resources/qml/Pages/Compound/CardPage.qml b/prototype_2016/resources/qml/Pages/Compound/CardPage.qml
new file mode 100644
index 0000000..ec33a3e
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Compound/CardPage.qml
@@ -0,0 +1,76 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import Fluid.Controls 1.0
18
19Item {
20 Card {
21 id: card
22 anchors.centerIn: parent
23 width: 400
24 height: 400
25
26 Image {
27 id: picture
28 anchors {
29 left: parent.left
30 top: parent.top
31 right: parent.right
32 }
33 height: 200
34 source: "https://www.nps.gov/yose/planyourvisit/images/glacier-point-people-960web.jpg"
35 }
36
37 Column {
38 id: column
39 anchors {
40 left: parent.left
41 top: picture.bottom
42 right: parent.right
43 margins: Units.smallSpacing * 2
44 }
45 spacing: Units.smallSpacing * 2
46
47 TitleLabel {
48 text: qsTr("Yosemite National Park")
49 }
50
51 BodyLabel {
52 text: qsTr("First protected in 1864, Yosemite National Park " +
53 "is best known for its waterfalls, but within its " +
54 "nearly 1,200 square miles, you can find deep " +
55 "valleys, grand meadows, ancient giant sequoias, " +
56 "a vast wilderness area, and much more.")
57 wrapMode: Text.WordWrap
58 width: parent.width
59 }
60
61 Row {
62 spacing: Units.smallSpacing
63
64 Button {
65 text: qsTr("Share")
66 flat: true
67 }
68
69 Button {
70 text: qsTr("Explore")
71 flat: true
72 }
73 }
74 }
75 }
76}
diff --git a/prototype_2016/resources/qml/Pages/Compound/InfoBarPage.qml b/prototype_2016/resources/qml/Pages/Compound/InfoBarPage.qml
new file mode 100644
index 0000000..1830e39
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Compound/InfoBarPage.qml
@@ -0,0 +1,30 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import Fluid.Controls 1.0
18
19Item {
20 Button {
21 anchors.centerIn: parent
22 text: qsTr("Open")
23 onClicked: infoBar.open(qsTr("Message sent"))
24 }
25
26 InfoBar {
27 id: infoBar
28 buttonText: qsTr("OK")
29 }
30}
diff --git a/prototype_2016/resources/qml/Pages/Compound/ListItemPage.qml b/prototype_2016/resources/qml/Pages/Compound/ListItemPage.qml
new file mode 100644
index 0000000..f86f81b
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Compound/ListItemPage.qml
@@ -0,0 +1,40 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import Fluid.Controls 1.0
18import "../.."
19
20Page {
21 ListView {
22 anchors.fill: parent
23 model: ListModel {
24 ListElement { title: "List Item 1"; source: "qrc:/Pages/Compound/SubPage.qml" }
25 ListElement { title: "List Item 2"; source: "qrc:/Pages/Compound/SubPage.qml" }
26 ListElement { title: "List Item 3"; source: "qrc:/Pages/Compound/SubPage.qml" }
27 ListElement { title: "List Item 4"; source: "qrc:/Pages/Compound/SubPage.qml" }
28 ListElement { title: "List Item 5"; source: "qrc:/Pages/Compound/SubPage.qml" }
29 }
30 header: Subheader {
31 text: "Header"
32 }
33 delegate: ListItem {
34 text: model.title
35 onClicked: pageStack.push(model.source)
36 }
37
38 ScrollIndicator.vertical: ScrollIndicator {}
39 }
40}
diff --git a/prototype_2016/resources/qml/Pages/Compound/SubPage.qml b/prototype_2016/resources/qml/Pages/Compound/SubPage.qml
new file mode 100644
index 0000000..8a86a28
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Compound/SubPage.qml
@@ -0,0 +1,31 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick.Controls 2.0
16import Fluid.Controls 1.0
17
18Page {
19 title: "Sub page demo"
20
21 actions: [
22 Action {
23 iconName: "action/settings"
24 }
25 ]
26
27 Label {
28 anchors.centerIn: parent
29 text: "Testing"
30 }
31}
diff --git a/prototype_2016/resources/qml/Pages/Material/ActionButtonPage.qml b/prototype_2016/resources/qml/Pages/Material/ActionButtonPage.qml
new file mode 100644
index 0000000..1fcf516
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Material/ActionButtonPage.qml
@@ -0,0 +1,68 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import Fluid.Material 1.0
19import "../.."
20
21Flickable {
22 clip: true
23 contentHeight: Math.max(layout.implicitHeight, height)
24
25 ScrollBar.vertical: ScrollBar {}
26
27 Column {
28 id: layout
29 anchors.fill: parent
30
31 Repeater {
32 model: 2
33
34 StyledRectangle {
35 //y: height * index
36 width: parent.width
37 height: parent.height / 2
38
39 Column {
40 anchors.centerIn: parent
41
42 ActionButton {
43 iconName: "device/airplanemode_active"
44 }
45
46 ActionButton {
47 iconName: "navigation/check"
48
49 Material.elevation: 1
50 }
51
52 ActionButton {
53 iconName: "device/airplanemode_active"
54
55 Material.background: Material.primaryColor
56 }
57
58 ActionButton {
59 iconName: "navigation/check"
60
61 Material.elevation: 1
62 Material.background: Material.primaryColor
63 }
64 }
65 }
66 }
67 }
68}
diff --git a/prototype_2016/resources/qml/Pages/Material/WavePage.qml b/prototype_2016/resources/qml/Pages/Material/WavePage.qml
new file mode 100644
index 0000000..58cae01
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Material/WavePage.qml
@@ -0,0 +1,41 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import Fluid.Controls 1.0
19import Fluid.Material 1.0
20import "../.."
21
22Item {
23 Wave {
24 id: wave
25 initialX: parent.width - size
26 initialY: parent.height - size
27 size: 48
28 color: Material.accentColor
29 }
30
31 Button {
32 anchors.centerIn: parent
33 text: qsTr("Toggle")
34 onClicked: {
35 if (wave.opened)
36 wave.close(parent.width - wave.size, parent.height - wave.size)
37 else
38 wave.open(0, 0)
39 }
40 }
41}
diff --git a/prototype_2016/resources/qml/Pages/Navigation/NavDrawerPage.qml b/prototype_2016/resources/qml/Pages/Navigation/NavDrawerPage.qml
new file mode 100644
index 0000000..4c7dd21
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Navigation/NavDrawerPage.qml
@@ -0,0 +1,26 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import Fluid.Controls 1.0
18import "../.."
19
20Item {
21 Button {
22 anchors.centerIn: parent
23 text: qsTr("Open")
24 onClicked: navDrawer.open()
25 }
26}
diff --git a/prototype_2016/resources/qml/Pages/Style/PalettePage.qml b/prototype_2016/resources/qml/Pages/Style/PalettePage.qml
new file mode 100644
index 0000000..bc34dab
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Style/PalettePage.qml
@@ -0,0 +1,135 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import QtQuick.Layouts 1.0
19import Fluid.Core 1.0
20import Fluid.Controls 1.0
21import "../.."
22
23Flickable {
24 clip: true
25 contentHeight: Math.max(grid.implicitHeight, height)
26
27 ScrollBar.vertical: ScrollBar {}
28
29 property color whiteColor: Qt.rgba(255, 255, 255, 1)
30 property color blackColor: Qt.rgba(0, 0, 0, 1)
31
32 GridLayout {
33 id: grid
34
35 anchors {
36 top: parent.top
37 bottom: parent.bottom
38 horizontalCenter: parent.horizontalCenter
39 topMargin: Units.largeSpacing
40 }
41
42 width: parent.width * 0.8
43
44 columns: width / 300
45 rowSpacing: Units.smallSpacing
46 columnSpacing: Units.smallSpacing
47
48 Repeater {
49 model: ListModel {
50 ListElement {
51 paletteIndex: Material.Red
52 name: "Red"
53 }
54 ListElement {
55 paletteIndex: Material.Pink
56 name: "Pink"
57 }
58 ListElement {
59 paletteIndex: Material.Purple
60 name: "Purple"
61 }
62 ListElement {
63 paletteIndex: Material.DeepPurple
64 name: "DeepPurple"
65 }
66 ListElement {
67 paletteIndex: Material.Indigo
68 name: "Indigo"
69 }
70 ListElement {
71 paletteIndex: Material.Blue
72 name: "Blue"
73 }
74 ListElement {
75 paletteIndex: Material.LightBlue
76 name: "LightBlue"
77 }
78 ListElement {
79 paletteIndex: Material.Cyan
80 name: "Cyan"
81 }
82 ListElement {
83 paletteIndex: Material.Teal
84 name: "Teal"
85 }
86 ListElement {
87 paletteIndex: Material.Green
88 name: "Green"
89 }
90 ListElement {
91 paletteIndex: Material.LightGreen
92 name: "LightGreen"
93 }
94 ListElement {
95 paletteIndex: Material.Lime
96 name: "Lime"
97 }
98 ListElement {
99 paletteIndex: Material.Yellow
100 name: "Yellow"
101 }
102 ListElement {
103 paletteIndex: Material.Amber
104 name: "Amber"
105 }
106 ListElement {
107 paletteIndex: Material.Orange
108 name: "Orange"
109 }
110 ListElement {
111 paletteIndex: Material.DeepOrange
112 name: "DeepOrange"
113 }
114 ListElement {
115 paletteIndex: Material.Grey
116 name: "Grey"
117 }
118 ListElement {
119 paletteIndex: Material.BlueGrey
120 name: "BlueGrey"
121 }
122 ListElement {
123 paletteIndex: Material.Brown
124 name: "Brown"
125 }
126 }
127
128 PaletteSwatch {
129 paletteIndex: model.paletteIndex
130 paletteName: model.name
131 paletteColor: Material.color(model.paletteIndex, Material.Shade500)
132 }
133 }
134 }
135}
diff --git a/prototype_2016/resources/qml/Pages/Style/PaletteSwatch.qml b/prototype_2016/resources/qml/Pages/Style/PaletteSwatch.qml
new file mode 100644
index 0000000..ac5c9b3
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Style/PaletteSwatch.qml
@@ -0,0 +1,173 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import Fluid.Core 1.0
19import Fluid.Controls 1.0
20import "../.."
21
22Column {
23 id: mainLayout
24
25 property int paletteIndex
26 property string paletteName
27 property color paletteColor
28
29 spacing: 0
30
31 Rectangle {
32 width: 300
33 height: 80
34 color: paletteColor
35
36 Label {
37 anchors {
38 top: parent.top
39 left: parent.left
40 margins: Units.smallSpacing * 2
41 }
42 font.bold: true
43 color: Utils.lightDark(parent.color, blackColor, whiteColor)
44 text: paletteName
45 }
46 }
47
48 Column {
49 spacing: 0
50
51 Repeater {
52 model: ListModel {
53 ListElement {
54 shadeIndex: Material.Shade100
55 name: "100"
56 }
57 ListElement {
58 shadeIndex: Material.Shade200
59 name: "200"
60 }
61 ListElement {
62 shadeIndex: Material.Shade300
63 name: "300"
64 }
65 ListElement {
66 shadeIndex: Material.Shade400
67 name: "400"
68 }
69 ListElement {
70 shadeIndex: Material.Shade500
71 name: "500"
72 }
73 ListElement {
74 shadeIndex: Material.Shade600
75 name: "600"
76 }
77 ListElement {
78 shadeIndex: Material.Shade700
79 name: "700"
80 }
81 ListElement {
82 shadeIndex: Material.Shade800
83 name: "800"
84 }
85 ListElement {
86 shadeIndex: Material.Shade900
87 name: "900"
88 }
89 }
90
91 Rectangle {
92 width: 300
93 height: 40
94 color: Material.color(paletteIndex, model.shadeIndex)
95
96 Label {
97 anchors {
98 left: parent.left
99 verticalCenter: parent.verticalCenter
100 margins: Units.smallSpacing * 2
101 }
102 font.bold: true
103 color: Utils.lightDark(parent.color, blackColor, whiteColor)
104 text: model.name
105 }
106
107 Label {
108 anchors {
109 right: parent.right
110 verticalCenter: parent.verticalCenter
111 margins: Units.smallSpacing * 2
112 }
113 font.bold: true
114 color: Utils.lightDark(parent.color, blackColor, whiteColor)
115 text: parent.color
116 }
117 }
118 }
119 }
120
121 Column {
122 spacing: 0
123
124 Repeater {
125 model: ListModel {
126 ListElement {
127 shadeIndex: Material.ShadeA100
128 name: "A100"
129 }
130 ListElement {
131 shadeIndex: Material.ShadeA200
132 name: "A200"
133 }
134 ListElement {
135 shadeIndex: Material.ShadeA400
136 name: "A400"
137 }
138 ListElement {
139 shadeIndex: Material.ShadeA700
140 name: "A700"
141 }
142 }
143
144 Rectangle {
145 width: 300
146 height: 40
147 color: Material.color(paletteIndex, model.shadeIndex)
148
149 Label {
150 anchors {
151 left: parent.left
152 verticalCenter: parent.verticalCenter
153 margins: Units.smallSpacing * 2
154 }
155 font.bold: true
156 color: Utils.lightDark(parent.color, blackColor, whiteColor)
157 text: model.name
158 }
159
160 Label {
161 anchors {
162 right: parent.right
163 verticalCenter: parent.verticalCenter
164 margins: Units.smallSpacing * 2
165 }
166 font.bold: true
167 color: Utils.lightDark(parent.color, blackColor, whiteColor)
168 text: parent.color
169 }
170 }
171 }
172 }
173}
diff --git a/prototype_2016/resources/qml/Pages/Style/TypographyPage.qml b/prototype_2016/resources/qml/Pages/Style/TypographyPage.qml
new file mode 100644
index 0000000..d87d00c
--- /dev/null
+++ b/prototype_2016/resources/qml/Pages/Style/TypographyPage.qml
@@ -0,0 +1,87 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Layouts 1.0
17import QtQuick.Controls 2.0
18import Fluid.Controls 1.0
19import "../.."
20
21Flickable {
22 clip: true
23 contentHeight: Math.max(layout.implicitHeight, height)
24
25 ScrollBar.vertical: ScrollBar {}
26
27 ColumnLayout {
28 id: layout
29 anchors.fill: parent
30 anchors.margins: Units.mediumSpacing
31 spacing: Units.smallSpacing
32
33 DisplayLabel {
34 level: 4
35 text: "Display 4"
36 }
37
38 DisplayLabel {
39 level: 3
40 text: "Display 3"
41 }
42
43 DisplayLabel {
44 level: 2
45 text: "Display 2"
46 }
47
48 DisplayLabel {
49 level: 1
50 text: "Display 1"
51 }
52
53 HeadlineLabel {
54 text: "Headline"
55 }
56
57 TitleLabel {
58 text: "Title"
59 }
60
61 SubheadingLabel {
62 text: "Subheading"
63 }
64
65 BodyLabel {
66 level: 2
67 text: "Body 2"
68 }
69
70 BodyLabel {
71 level: 1
72 text: "Body 1"
73 }
74
75 CaptionLabel {
76 text: "Caption"
77 }
78
79 Label {
80 text: "Label"
81 }
82
83 Item {
84 Layout.fillHeight: true
85 }
86 }
87}
diff --git a/prototype_2016/resources/qml/Style.qml b/prototype_2016/resources/qml/Style.qml
new file mode 100644
index 0000000..9f997bd
--- /dev/null
+++ b/prototype_2016/resources/qml/Style.qml
@@ -0,0 +1,75 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import QtQuick.Controls.Universal 2.0
19import Fluid.Controls 1.0
20import "Pages/Style"
21
22Tab {
23 title: qsTr("Style")
24
25 Pane {
26 id: listPane
27 anchors {
28 left: parent.left
29 top: parent.top
30 bottom: parent.bottom
31 }
32 width: 200
33 padding: 0
34 z: 2
35
36 Material.background: "white"
37 Material.elevation: 1
38
39 Universal.background: Universal.accent
40
41 ListView {
42 id: listView
43 anchors.fill: parent
44 currentIndex: 0
45 model: ListModel {
46 ListElement { title: qsTr("Palette"); source: "qrc:/Pages/Style/PalettePage.qml" }
47 ListElement { title: qsTr("Typography"); source: "qrc:/Pages/Style/TypographyPage.qml" }
48 }
49 header: Subheader {
50 text: qsTr("Demos")
51 }
52 delegate: ListItem {
53 text: model.title
54 highlighted: ListView.isCurrentItem
55 onClicked: {
56 listView.currentIndex = index
57 stackView.push(model.source)
58 }
59 }
60
61 ScrollBar.vertical: ScrollBar {}
62 }
63 }
64
65 StackView {
66 id: stackView
67 anchors {
68 left: listPane.right
69 top: parent.top
70 right: parent.right
71 bottom: parent.bottom
72 }
73 initialItem: PalettePage {}
74 }
75}
diff --git a/prototype_2016/resources/qml/StyledRectangle.qml b/prototype_2016/resources/qml/StyledRectangle.qml
new file mode 100644
index 0000000..3af12dd
--- /dev/null
+++ b/prototype_2016/resources/qml/StyledRectangle.qml
@@ -0,0 +1,21 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
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 * $END_LICENSE$
13 */
14
15import QtQuick 2.0
16
17Rectangle {
18 // Default styled rectangle is red to spot errors
19 // related to how styles are loaded
20 color: "red"
21}
diff --git a/prototype_2016/resources/qml/main.qml b/prototype_2016/resources/qml/main.qml
new file mode 100644
index 0000000..37b0077
--- /dev/null
+++ b/prototype_2016/resources/qml/main.qml
@@ -0,0 +1,104 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
6 *
7 * $BEGIN_LICENSE:MPL2$
8 *
9 * This Source Code Form is subject to the terms of the Mozilla Public
10 * License, v. 2.0. If a copy of the MPL was not distributed with this
11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
14 */
15
16import QtQuick 2.6
17import QtQuick.Controls 2.0
18import QtQuick.Controls.Material 2.0
19import QtQuick.Controls.Universal 2.0
20import QtQuick.Layouts 1.3
21import Fluid.Controls 1.0
22
23FluidWindow {
24 id: window
25
26 visible: true
27
28 width: 1024
29 height: 800
30
31 title: qsTr("Fluid Demo")
32
33 Material.primary: Material.LightBlue
34 Material.accent: Material.Blue
35
36 Universal.accent: Universal.Cobalt
37
38 NavigationDrawer {
39 id: navDrawer
40
41 //width: Math.min(window.width, window.height) / 3 * 2
42 height: window.height
43
44 topContent: [
45 Rectangle {
46 color: Material.primary
47 height: 48
48
49 Label {
50 anchors.centerIn: parent
51 text: qsTr("Top Content")
52 }
53
54 Layout.fillWidth: true
55 }
56 ]
57
58 actions: [
59 Action {
60 text: qsTr("Action 1")
61 iconName: "action/info"
62 onTriggered: console.log("action1 triggered")
63 },
64 Action {
65 text: qsTr("Action 2")
66 iconName: "action/info"
67 onTriggered: console.log("action2 triggered")
68 },
69 Action {
70 text: qsTr("Action 3")
71 iconName: "action/info"
72 onTriggered: console.log("action3 triggered")
73 }
74 ]
75 }
76
77 initialPage: TabbedPage {
78 title: window.title
79
80 actions: [
81 Action {
82 text: qsTr("Dummy error")
83 iconName: "alert/warning"
84 onTriggered: console.log("Dummy error")
85 },
86 Action {
87 text: qsTr("Colors")
88 iconName: "image/color_lens"
89 onTriggered: console.log("Colors")
90 },
91 Action {
92 text: qsTr("Settings")
93 iconName: "action/settings"
94 onTriggered: console.log("Settings clicked")
95 }
96 ]
97
98 BasicComponents {}
99 CompoundComponents {}
100 MaterialComponents {}
101 NavigationComponents {}
102 Style {}
103 }
104}
diff --git a/prototype_2016/resources/qml/qml.qrc b/prototype_2016/resources/qml/qml.qrc
new file mode 100644
index 0000000..2f31ad9
--- /dev/null
+++ b/prototype_2016/resources/qml/qml.qrc
@@ -0,0 +1,31 @@
1<RCC>
2 <qresource prefix="/">
3 <file>qtquickcontrols2.conf</file>
4 <file>main.qml</file>
5 <file>BasicComponents.qml</file>
6 <file>CompoundComponents.qml</file>
7 <file>MaterialComponents.qml</file>
8 <file>NavigationComponents.qml</file>
9 <file>Style.qml</file>
10 <file>StyledRectangle.qml</file>
11 <file>+material/StyledRectangle.qml</file>
12 <file>+universal/StyledRectangle.qml</file>
13 <file>Pages/Basic/BusyIndicatorPage.qml</file>
14 <file>Pages/Basic/ButtonPage.qml</file>
15 <file>Pages/Basic/CheckBoxPage.qml</file>
16 <file>Pages/Basic/ProgressBarPage.qml</file>
17 <file>Pages/Basic/RadioButtonPage.qml</file>
18 <file>Pages/Basic/SliderPage.qml</file>
19 <file>Pages/Basic/SwitchPage.qml</file>
20 <file>Pages/Compound/ListItemPage.qml</file>
21 <file>Pages/Compound/SubPage.qml</file>
22 <file>Pages/Compound/CardPage.qml</file>
23 <file>Pages/Compound/InfoBarPage.qml</file>
24 <file>Pages/Style/PalettePage.qml</file>
25 <file>Pages/Style/PaletteSwatch.qml</file>
26 <file>Pages/Style/TypographyPage.qml</file>
27 <file>Pages/Material/ActionButtonPage.qml</file>
28 <file>Pages/Material/WavePage.qml</file>
29 <file>Pages/Navigation/NavDrawerPage.qml</file>
30 </qresource>
31</RCC>
diff --git a/prototype_2016/resources/qml/qtquickcontrols2.conf b/prototype_2016/resources/qml/qtquickcontrols2.conf
new file mode 100644
index 0000000..b6c7c87
--- /dev/null
+++ b/prototype_2016/resources/qml/qtquickcontrols2.conf
@@ -0,0 +1,2 @@
1[Controls]
2Style=Material