summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-03-16 00:00:19 +0100
committerlurchi <lurchi@strangeplace.net>2017-03-16 00:00:19 +0100
commit4b2221f7063712afd2c11b6d54ee47817db19bb3 (patch)
tree639fb2285f9bc1ebb1cd99e3d49eb74109c2eedc
parent7632e7f4827da8805c079e5dbd87c1ed07facc9c (diff)
parentb3d231ef193aa1712d2ea8891223a3f94ef66594 (diff)
downloadsecushare-4b2221f7063712afd2c11b6d54ee47817db19bb3.tar.gz
secushare-4b2221f7063712afd2c11b6d54ee47817db19bb3.zip
merge fluid_icons_problem
-rw-r--r--prototype_2016/Cargo.toml11
-rw-r--r--prototype_2016/build-fluid.sh11
-rwxr-xr-xprototype_2016/build-qml-material.sh11
-rw-r--r--prototype_2016/build.rs85
-rw-r--r--prototype_2016/icons.yml3
-rw-r--r--prototype_2016/icons/action_search.svg1
-rw-r--r--prototype_2016/icons/action_settings.svg1
-rw-r--r--prototype_2016/icons/icons.qrc9
-rw-r--r--prototype_2016/resources/build-resources-lib.sh15
-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
-rw-r--r--prototype_2016/resources/resources.pro8
-rw-r--r--prototype_2016/src/secushare_qml.rs41
-rw-r--r--prototype_2016/src/view/main.qml86
-rw-r--r--prototype_2016/third_party/fluid/.gitignore4
-rw-r--r--prototype_2016/third_party/fluid/.mailmap2
-rw-r--r--prototype_2016/third_party/fluid/.travis.yml54
-rw-r--r--prototype_2016/third_party/fluid/.travis/PKGBUILD.in47
-rwxr-xr-xprototype_2016/third_party/fluid/.travis/bintray-wrapper.sh42
-rw-r--r--prototype_2016/third_party/fluid/.travis/bintray.json.in29
-rw-r--r--prototype_2016/third_party/fluid/AUTHORS.md25
-rw-r--r--prototype_2016/third_party/fluid/CMakeLists.txt84
-rw-r--r--prototype_2016/third_party/fluid/LICENSE.MPL2373
-rw-r--r--prototype_2016/third_party/fluid/README.md77
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/BaseListItem.qml45
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/BodyLabel.qml30
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/CaptionLabel.qml20
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/DialogLabel.qml23
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/DisplayLabel.qml48
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/HeadlineLabel.qml22
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/SubheadingLabel.qml29
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/ThinDivider.qml22
-rw-r--r--prototype_2016/third_party/fluid/controls/+material/TitleLabel.qml21
-rw-r--r--prototype_2016/third_party/fluid/controls/Action.qml (renamed from prototype_2016/third_party/qml-material/src/controls/Action.qml)55
-rw-r--r--prototype_2016/third_party/fluid/controls/AppBar.qml194
-rw-r--r--prototype_2016/third_party/fluid/controls/AppToolBar.qml62
-rw-r--r--prototype_2016/third_party/fluid/controls/BaseListItem.qml43
-rw-r--r--prototype_2016/third_party/fluid/controls/BodyLabel.qml51
-rw-r--r--prototype_2016/third_party/fluid/controls/CMakeLists.txt67
-rw-r--r--prototype_2016/third_party/fluid/controls/CaptionLabel.qml35
-rw-r--r--prototype_2016/third_party/fluid/controls/Card.qml88
-rw-r--r--prototype_2016/third_party/fluid/controls/CircleImage.qml (renamed from prototype_2016/third_party/qml-material/src/extras/CircleImage.qml)22
-rw-r--r--prototype_2016/third_party/fluid/controls/Dialog.qml169
-rw-r--r--prototype_2016/third_party/fluid/controls/DialogLabel.qml38
-rw-r--r--prototype_2016/third_party/fluid/controls/DisplayLabel.qml59
-rw-r--r--prototype_2016/third_party/fluid/controls/FluidStyle.qml68
-rw-r--r--prototype_2016/third_party/fluid/controls/FluidWindow.qml101
-rw-r--r--prototype_2016/third_party/fluid/controls/HeadlineLabel.qml35
-rw-r--r--prototype_2016/third_party/fluid/controls/Icon.qml173
-rw-r--r--prototype_2016/third_party/fluid/controls/IconButton.qml39
-rw-r--r--prototype_2016/third_party/fluid/controls/InfoBar.qml149
-rw-r--r--prototype_2016/third_party/fluid/controls/ListItem.qml155
-rw-r--r--prototype_2016/third_party/fluid/controls/ListItemDelegate.qml42
-rw-r--r--prototype_2016/third_party/fluid/controls/Loadable.qml70
-rw-r--r--prototype_2016/third_party/fluid/controls/NavigationDrawer.qml195
-rw-r--r--prototype_2016/third_party/fluid/controls/NoiseBackground.qml99
-rw-r--r--prototype_2016/third_party/fluid/controls/Page.qml139
-rw-r--r--prototype_2016/third_party/fluid/controls/PageStack.qml (renamed from prototype_2016/third_party/qml-material/src/window/PageStack.qml)16
-rw-r--r--prototype_2016/third_party/fluid/controls/Placeholder.qml66
-rw-r--r--prototype_2016/third_party/fluid/controls/Showable.qml68
-rw-r--r--prototype_2016/third_party/fluid/controls/Sidebar.qml (renamed from prototype_2016/third_party/qml-material/src/window/Sidebar.qml)115
-rw-r--r--prototype_2016/third_party/fluid/controls/SmoothFadeImage.qml309
-rw-r--r--prototype_2016/third_party/fluid/controls/SmoothFadeLoader.qml137
-rw-r--r--prototype_2016/third_party/fluid/controls/Subheader.qml45
-rw-r--r--prototype_2016/third_party/fluid/controls/SubheadingLabel.qml51
-rw-r--r--prototype_2016/third_party/fluid/controls/Tab.qml47
-rw-r--r--prototype_2016/third_party/fluid/controls/TabbedPage.qml90
-rw-r--r--prototype_2016/third_party/fluid/controls/ThinDivider.qml28
-rw-r--r--prototype_2016/third_party/fluid/controls/TitleLabel.qml36
-rw-r--r--prototype_2016/third_party/fluid/controls/Units.qml125
-rw-r--r--prototype_2016/third_party/fluid/controls/controls.pri4
-rw-r--r--prototype_2016/third_party/fluid/controls/controls.qrc46
-rw-r--r--prototype_2016/third_party/fluid/controls/iconthemeimageprovider.cpp47
-rw-r--r--prototype_2016/third_party/fluid/controls/iconthemeimageprovider.h25
-rw-r--r--prototype_2016/third_party/fluid/controls/plugin.cpp42
-rw-r--r--prototype_2016/third_party/fluid/controls/plugins.qmltypes569
-rw-r--r--prototype_2016/third_party/fluid/controls/qmldir41
-rw-r--r--prototype_2016/third_party/fluid/controls/qmldir_noplugin39
-rw-r--r--prototype_2016/third_party/fluid/core/CMakeLists.txt32
-rw-r--r--prototype_2016/third_party/fluid/core/Object.qml38
-rw-r--r--prototype_2016/third_party/fluid/core/PlatformExtensions.qml (renamed from prototype_2016/third_party/qml-material/src/core/PlatformExtensions.qml)15
-rw-r--r--prototype_2016/third_party/fluid/core/Utils.qml106
-rw-r--r--prototype_2016/third_party/fluid/core/clipboard.cpp54
-rw-r--r--prototype_2016/third_party/fluid/core/clipboard.h41
-rw-r--r--prototype_2016/third_party/fluid/core/core.pri19
-rw-r--r--prototype_2016/third_party/fluid/core/core.qrc8
-rw-r--r--prototype_2016/third_party/fluid/core/device.cpp (renamed from prototype_2016/third_party/qml-material/src/core/device.cpp)96
-rw-r--r--prototype_2016/third_party/fluid/core/device.h (renamed from prototype_2016/third_party/qml-material/src/core/device.h)32
-rw-r--r--prototype_2016/third_party/fluid/core/doc/fluidcore.qdocconf47
-rw-r--r--prototype_2016/third_party/fluid/core/iconsimageprovider.cpp67
-rw-r--r--prototype_2016/third_party/fluid/core/iconsimageprovider.h25
-rw-r--r--prototype_2016/third_party/fluid/core/plugin.cpp90
-rw-r--r--prototype_2016/third_party/fluid/core/plugins.qmltypes268
-rw-r--r--prototype_2016/third_party/fluid/core/qmldateutils.cpp34
-rw-r--r--prototype_2016/third_party/fluid/core/qmldateutils.h42
-rw-r--r--prototype_2016/third_party/fluid/core/qmldir8
-rw-r--r--prototype_2016/third_party/fluid/core/qmldir_noplugin5
-rw-r--r--prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.cpp283
-rw-r--r--prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.h129
-rw-r--r--prototype_2016/third_party/fluid/core/standardpaths.cpp36
-rw-r--r--prototype_2016/third_party/fluid/core/standardpaths.h51
-rw-r--r--prototype_2016/third_party/fluid/demo/+material/StyledRectangle.qml22
-rw-r--r--prototype_2016/third_party/fluid/demo/+universal/StyledRectangle.qml22
-rw-r--r--prototype_2016/third_party/fluid/demo/BasicComponents.qml80
-rw-r--r--prototype_2016/third_party/fluid/demo/CMakeLists.txt10
-rw-r--r--prototype_2016/third_party/fluid/demo/CompoundComponents.qml76
-rw-r--r--prototype_2016/third_party/fluid/demo/MaterialComponents.qml74
-rw-r--r--prototype_2016/third_party/fluid/demo/NavigationComponents.qml74
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Basic/BusyIndicatorPage.qml44
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Basic/ButtonPage.qml115
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Basic/CheckBoxPage.qml101
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Basic/ProgressBarPage.qml127
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Basic/RadioButtonPage.qml100
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Basic/SliderPage.qml152
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Basic/SwitchPage.qml100
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Compound/CardPage.qml76
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Compound/InfoBarPage.qml30
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Compound/ListItemPage.qml40
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Compound/SubPage.qml31
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Material/ActionButtonPage.qml68
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Material/WavePage.qml41
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Navigation/NavDrawerPage.qml26
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Style/PalettePage.qml135
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Style/PaletteSwatch.qml173
-rw-r--r--prototype_2016/third_party/fluid/demo/Pages/Style/TypographyPage.qml87
-rw-r--r--prototype_2016/third_party/fluid/demo/Style.qml75
-rw-r--r--prototype_2016/third_party/fluid/demo/StyledRectangle.qml21
-rw-r--r--prototype_2016/third_party/fluid/demo/demo.pro9
-rw-r--r--prototype_2016/third_party/fluid/demo/demo.qrc30
-rw-r--r--prototype_2016/third_party/fluid/demo/main.cpp37
-rw-r--r--prototype_2016/third_party/fluid/demo/main.qml104
-rw-r--r--prototype_2016/third_party/fluid/doc/defaults.qdocconf23
-rw-r--r--prototype_2016/third_party/fluid/doc/fluid.qdocconf59
-rw-r--r--prototype_2016/third_party/fluid/doc/html-footer-offline.qdocconf18
-rw-r--r--prototype_2016/third_party/fluid/doc/src/fluidcontrols.qdoc25
-rw-r--r--prototype_2016/third_party/fluid/doc/src/fluidcore.qdoc30
-rw-r--r--prototype_2016/third_party/fluid/doc/src/fluideffects.qdoc21
-rw-r--r--prototype_2016/third_party/fluid/doc/src/fluidmaterial.qdoc21
-rw-r--r--prototype_2016/third_party/fluid/doc/src/index.qdoc31
-rw-r--r--prototype_2016/third_party/fluid/effects/BoxShadow.qml53
-rw-r--r--prototype_2016/third_party/fluid/effects/CMakeLists.txt10
-rw-r--r--prototype_2016/third_party/fluid/effects/CircleMask.qml (renamed from prototype_2016/third_party/qml-material/src/extras/CircleMask.qml)24
-rw-r--r--prototype_2016/third_party/fluid/effects/Vignette.qml77
-rw-r--r--prototype_2016/third_party/fluid/effects/effects.pri1
-rw-r--r--prototype_2016/third_party/fluid/effects/effects.qrc9
-rw-r--r--prototype_2016/third_party/fluid/effects/plugins.qmltypes15
-rw-r--r--prototype_2016/third_party/fluid/effects/qmldir6
-rw-r--r--prototype_2016/third_party/fluid/fluid.pri8
-rw-r--r--prototype_2016/third_party/fluid/material/ActionButton.qml106
-rw-r--r--prototype_2016/third_party/fluid/material/CMakeLists.txt11
-rw-r--r--prototype_2016/third_party/fluid/material/ElevationEffect.qml251
-rw-r--r--prototype_2016/third_party/fluid/material/Ripple.qml (renamed from prototype_2016/third_party/qml-material/src/core/Ink.qml)193
-rw-r--r--prototype_2016/third_party/fluid/material/Wave.qml (renamed from prototype_2016/third_party/qml-material/src/components/Wave.qml)35
-rw-r--r--prototype_2016/third_party/fluid/material/material.pri2
-rw-r--r--prototype_2016/third_party/fluid/material/material.qrc10
-rw-r--r--prototype_2016/third_party/fluid/material/plugins.qmltypes569
-rw-r--r--prototype_2016/third_party/fluid/material/qmldir7
-rwxr-xr-xprototype_2016/third_party/fluid/scripts/fetch_icons.sh39
-rw-r--r--prototype_2016/third_party/fluid/src/CMakeLists.txt79
-rw-r--r--prototype_2016/third_party/fluid/src/FluidConfig.cmake.in11
-rw-r--r--prototype_2016/third_party/fluid/src/dateutils.cpp82
-rw-r--r--prototype_2016/third_party/fluid/src/dateutils.h44
-rw-r--r--prototype_2016/third_party/fluid/src/src.pri5
-rw-r--r--prototype_2016/third_party/fluid/tests/CMakeLists.txt1
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/CMakeLists.txt7
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/controls/CMakeLists.txt10
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/controls/controls.cpp16
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/controls/tst_icon.qml83
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/controls/tst_listitem.qml123
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/core/CMakeLists.txt10
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/core/core.cpp16
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/core/tst_clipboard.qml59
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/core/tst_utils.qml38
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/material/CMakeLists.txt12
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/material/material.cpp16
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/material/material.qrc5
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/material/qtquickcontrols2.conf2
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/material/tst_ripple.qml88
-rw-r--r--prototype_2016/third_party/fluid/tests/auto/material/tst_typography.qml166
-rw-r--r--prototype_2016/third_party/qml-material/.builder.yml12
-rw-r--r--prototype_2016/third_party/qml-material/.gitignore13
-rw-r--r--prototype_2016/third_party/qml-material/.travis.yml27
-rw-r--r--prototype_2016/third_party/qml-material/CHANGELOG.md200
-rw-r--r--prototype_2016/third_party/qml-material/CONTRIBUTING.md22
-rw-r--r--prototype_2016/third_party/qml-material/LICENSE502
-rw-r--r--prototype_2016/third_party/qml-material/LICENSE.CC-BY393
-rw-r--r--prototype_2016/third_party/qml-material/LICENSE.MPL0
-rw-r--r--prototype_2016/third_party/qml-material/README.md108
-rw-r--r--prototype_2016/third_party/qml-material/demo/BottomSheetDemo.qml81
-rw-r--r--prototype_2016/third_party/qml-material/demo/ButtonDemo.qml89
-rw-r--r--prototype_2016/third_party/qml-material/demo/CheckBoxDemo.qml74
-rw-r--r--prototype_2016/third_party/qml-material/demo/ColorPaletteDemo.qml159
-rw-r--r--prototype_2016/third_party/qml-material/demo/CustomIconsDemo.qml132
-rw-r--r--prototype_2016/third_party/qml-material/demo/DatePickerDemo.qml67
-rw-r--r--prototype_2016/third_party/qml-material/demo/DialogDemo.qml134
-rw-r--r--prototype_2016/third_party/qml-material/demo/FormsDemo.qml142
-rw-r--r--prototype_2016/third_party/qml-material/demo/ListItemsDemo.qml62
-rw-r--r--prototype_2016/third_party/qml-material/demo/PageStackDemo.qml91
-rw-r--r--prototype_2016/third_party/qml-material/demo/ProgressBarDemo.qml165
-rw-r--r--prototype_2016/third_party/qml-material/demo/RadioButtonDemo.qml70
-rw-r--r--prototype_2016/third_party/qml-material/demo/SidebarPage.qml51
-rw-r--r--prototype_2016/third_party/qml-material/demo/SliderDemo.qml120
-rw-r--r--prototype_2016/third_party/qml-material/demo/SubPage.qml77
-rw-r--r--prototype_2016/third_party/qml-material/demo/SwitchDemo.qml70
-rw-r--r--prototype_2016/third_party/qml-material/demo/TextFieldDemo.qml54
-rw-r--r--prototype_2016/third_party/qml-material/demo/TimePickerDemo.qml58
-rw-r--r--prototype_2016/third_party/qml-material/demo/TypographyDemo.qml121
-rw-r--r--prototype_2016/third_party/qml-material/demo/demo.pro6
-rw-r--r--prototype_2016/third_party/qml-material/demo/demo.qmlproject20
-rw-r--r--prototype_2016/third_party/qml-material/demo/demo.qrc48
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons.yml19
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/action_account_circle.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/action_autorenew.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/action_delete.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/action_language.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/action_settings.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/alert_warning.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/communication_email.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/content_add.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/content_create.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/content_forward.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/device_access_alarm.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/file_file_download.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/icons.qrc51
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/image_color_lens.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/image_edit.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/maps_place.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/navigation_arrow_drop_down.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/icons/social_share.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/images/balloon.jpgbin1805527 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/demo/images/go-last.color.svg157
-rw-r--r--prototype_2016/third_party/qml-material/demo/images/list-add.color.svg180
-rw-r--r--prototype_2016/third_party/qml-material/demo/images/weather-pouring.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/images/weather-sunset.svg1
-rw-r--r--prototype_2016/third_party/qml-material/demo/main.cpp11
-rw-r--r--prototype_2016/third_party/qml-material/demo/main.qml268
-rw-r--r--prototype_2016/third_party/qml-material/deploy_key.encbin1680 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/documentation/.gitignore1
-rw-r--r--prototype_2016/third_party/qml-material/documentation/images/buttons.pngbin34620 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/documentation/material.qdoc5
-rw-r--r--prototype_2016/third_party/qml-material/documentation/material.qdocconf16
-rw-r--r--prototype_2016/third_party/qml-material/fonts/MaterialFontLoader.qml33
-rw-r--r--prototype_2016/third_party/qml-material/fonts/fonts.qrc27
-rw-r--r--prototype_2016/third_party/qml-material/fonts/qmldir3
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Black.ttfbin357772 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BlackItalic.ttfbin382300 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Bold.ttfbin356392 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BoldItalic.ttfbin381396 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Italic.ttfbin379068 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Light.ttfbin357328 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-LightItalic.ttfbin381452 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Medium.ttfbin354768 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-MediumItalic.ttfbin380064 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Regular.ttfbin355072 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Thin.ttfbin362332 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/Roboto-ThinItalic.ttfbin380996 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Bold.ttfbin354160 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-BoldItalic.ttfbin383464 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Italic.ttfbin382752 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Light.ttfbin354612 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-LightItalic.ttfbin385524 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Regular.ttfbin352420 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/icons.yml8
-rw-r--r--prototype_2016/third_party/qml-material/icons/core_icons.qrc13
-rw-r--r--prototype_2016/third_party/qml-material/icons/navigation_arrow_back.svg1
-rw-r--r--prototype_2016/third_party/qml-material/icons/navigation_chevron_left.svg1
-rw-r--r--prototype_2016/third_party/qml-material/icons/navigation_chevron_right.svg1
-rw-r--r--prototype_2016/third_party/qml-material/icons/navigation_close.svg1
-rw-r--r--prototype_2016/third_party/qml-material/icons/navigation_menu.svg1
-rw-r--r--prototype_2016/third_party/qml-material/icons/navigation_more_vert.svg1
-rw-r--r--prototype_2016/third_party/qml-material/material.pri31
-rw-r--r--prototype_2016/third_party/qml-material/qml-material.pro5
-rw-r--r--prototype_2016/third_party/qml-material/qpm.json22
-rwxr-xr-xprototype_2016/third_party/qml-material/scripts/build_docs.sh7
-rwxr-xr-xprototype_2016/third_party/qml-material/scripts/deploy.sh69
-rwxr-xr-xprototype_2016/third_party/qml-material/scripts/icons.py74
-rwxr-xr-xprototype_2016/third_party/qml-material/scripts/lint.sh38
-rwxr-xr-xprototype_2016/third_party/qml-material/scripts/make_awesome.py89
-rwxr-xr-xprototype_2016/third_party/qml-material/scripts/normalize_imports.sh9
-rwxr-xr-xprototype_2016/third_party/qml-material/scripts/qrc.py52
-rw-r--r--prototype_2016/third_party/qml-material/src/components/ActionButton.qml130
-rw-r--r--prototype_2016/third_party/qml-material/src/components/Card.qml31
-rw-r--r--prototype_2016/third_party/qml-material/src/components/DatePicker.qml496
-rw-r--r--prototype_2016/third_party/qml-material/src/components/IconButton.qml78
-rw-r--r--prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml71
-rw-r--r--prototype_2016/third_party/qml-material/src/components/OverlayView.qml91
-rw-r--r--prototype_2016/third_party/qml-material/src/components/ProgressCircle.qml226
-rw-r--r--prototype_2016/third_party/qml-material/src/components/Scrollbar.qml106
-rw-r--r--prototype_2016/third_party/qml-material/src/components/Snackbar.qml124
-rw-r--r--prototype_2016/third_party/qml-material/src/components/ThinDivider.qml30
-rw-r--r--prototype_2016/third_party/qml-material/src/components/TimePicker.qml579
-rw-r--r--prototype_2016/third_party/qml-material/src/components/Tooltip.qml84
-rw-r--r--prototype_2016/third_party/qml-material/src/components/components.qrc20
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/Button.qml87
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/CheckBox.qml60
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/Label.qml124
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/ProgressBar.qml35
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/RadioButton.qml79
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/Slider.qml61
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/Switch.qml73
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/Tab.qml94
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/TextField.qml35
-rw-r--r--prototype_2016/third_party/qml-material/src/controls/controls.qrc17
-rw-r--r--prototype_2016/third_party/qml-material/src/core/AwesomeIcon.qml71
-rw-r--r--prototype_2016/third_party/qml-material/src/core/FontAwesome.otfbin124988 -> 0 bytes
-rw-r--r--prototype_2016/third_party/qml-material/src/core/Icon.qml112
-rw-r--r--prototype_2016/third_party/qml-material/src/core/MaterialAnimation.qml25
-rw-r--r--prototype_2016/third_party/qml-material/src/core/Object.qml23
-rw-r--r--prototype_2016/third_party/qml-material/src/core/Palette.qml322
-rw-r--r--prototype_2016/third_party/qml-material/src/core/Theme.qml127
-rw-r--r--prototype_2016/third_party/qml-material/src/core/ThemePalette.qml53
-rw-r--r--prototype_2016/third_party/qml-material/src/core/UnitsHelper.qml54
-rw-r--r--prototype_2016/third_party/qml-material/src/core/View.qml170
-rw-r--r--prototype_2016/third_party/qml-material/src/core/awesome.js722
-rw-r--r--prototype_2016/third_party/qml-material/src/core/core.qrc21
-rw-r--r--prototype_2016/third_party/qml-material/src/core/units.cpp135
-rw-r--r--prototype_2016/third_party/qml-material/src/core/units.h69
-rw-r--r--prototype_2016/third_party/qml-material/src/core/utils.js99
-rw-r--r--prototype_2016/third_party/qml-material/src/extras/AutomaticGrid.qml50
-rw-r--r--prototype_2016/third_party/qml-material/src/extras/ColumnFlow.qml168
-rw-r--r--prototype_2016/third_party/qml-material/src/extras/Image.qml48
-rw-r--r--prototype_2016/third_party/qml-material/src/extras/extras.qrc13
-rw-r--r--prototype_2016/third_party/qml-material/src/extras/qmldir7
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/BaseListItem.qml66
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/CMakeLists.txt4
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/Divider.qml36
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/SectionHeader.qml98
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/SimpleMenu.qml94
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/Standard.qml152
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/Subheader.qml64
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/Subtitled.qml155
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/listitems.qrc15
-rw-r--r--prototype_2016/third_party/qml-material/src/listitems/qmldir9
-rw-r--r--prototype_2016/third_party/qml-material/src/material.qrc6
-rw-r--r--prototype_2016/third_party/qml-material/src/plugin.cpp38
-rw-r--r--prototype_2016/third_party/qml-material/src/plugin.h25
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/BottomActionSheet.qml106
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/BottomSheet.qml66
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/Dialog.qml322
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/Dropdown.qml193
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/InputDialog.qml44
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/MenuField.qml209
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/Popover.qml129
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/PopupBase.qml71
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/TimePickerDialog.qml37
-rw-r--r--prototype_2016/third_party/qml-material/src/popups/popups.qrc16
-rw-r--r--prototype_2016/third_party/qml-material/src/qmldir71
-rw-r--r--prototype_2016/third_party/qml-material/src/src.pro55
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/ApplicationWindowStyle.qml19
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/ButtonStyle.qml101
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/CMakeLists.txt4
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/CheckBoxStyle.qml175
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/ProgressBarStyle.qml101
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/RadioButtonStyle.qml90
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/SliderStyle.qml243
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/SwitchStyle.qml63
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/TextFieldStyle.qml167
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/ToolBarStyle.qml30
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/ToolButtonStyle.qml68
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/qmldir12
-rw-r--r--prototype_2016/third_party/qml-material/src/styles/styles.qrc18
-rw-r--r--prototype_2016/third_party/qml-material/src/window/ActionBar.qml394
-rw-r--r--prototype_2016/third_party/qml-material/src/window/AppTheme.qml62
-rw-r--r--prototype_2016/third_party/qml-material/src/window/ApplicationWindow.qml186
-rw-r--r--prototype_2016/third_party/qml-material/src/window/MainView.qml73
-rw-r--r--prototype_2016/third_party/qml-material/src/window/NavigationDrawer.qml71
-rw-r--r--prototype_2016/third_party/qml-material/src/window/NavigationDrawerPage.qml40
-rw-r--r--prototype_2016/third_party/qml-material/src/window/Page.qml262
-rw-r--r--prototype_2016/third_party/qml-material/src/window/PageSidebar.qml49
-rw-r--r--prototype_2016/third_party/qml-material/src/window/TabBar.qml248
-rw-r--r--prototype_2016/third_party/qml-material/src/window/TabbedPage.qml66
-rw-r--r--prototype_2016/third_party/qml-material/src/window/Toolbar.qml239
-rw-r--r--prototype_2016/third_party/qml-material/src/window/Window.qml84
-rw-r--r--prototype_2016/third_party/qml-material/src/window/window.qrc21
-rw-r--r--prototype_2016/third_party/qml-material/styles_demo/Makefile2
-rw-r--r--prototype_2016/third_party/qml-material/styles_demo/main.qml111
-rw-r--r--prototype_2016/third_party/qml-material/tests/icons.yml6
-rw-r--r--prototype_2016/third_party/qml-material/tests/icons/action_alarm.svg1
-rw-r--r--prototype_2016/third_party/qml-material/tests/icons/action_search.svg1
-rw-r--r--prototype_2016/third_party/qml-material/tests/icons/action_settings.svg1
-rw-r--r--prototype_2016/third_party/qml-material/tests/icons/content_add.svg1
-rw-r--r--prototype_2016/third_party/qml-material/tests/icons/icons.qrc14
-rwxr-xr-xprototype_2016/third_party/qml-material/tests/tests.cpp20
-rw-r--r--prototype_2016/third_party/qml-material/tests/tests.pro9
-rw-r--r--prototype_2016/third_party/qml-material/tests/tst_actionbar.qml151
-rwxr-xr-xprototype_2016/third_party/qml-material/tests/tst_card.qml37
-rwxr-xr-xprototype_2016/third_party/qml-material/tests/tst_pagestack.qml59
-rw-r--r--prototype_2016/third_party/qml-material/vendor.cmake19
-rw-r--r--prototype_2016/third_party/qml-rust/.gitignore4
-rw-r--r--prototype_2016/third_party/qml-rust/Cargo.toml19
-rw-r--r--prototype_2016/third_party/qml-rust/LICENSE7
-rw-r--r--prototype_2016/third_party/qml-rust/README.md35
-rw-r--r--prototype_2016/third_party/qml-rust/build.rs21
-rw-r--r--prototype_2016/third_party/qml-rust/build_lib.sh8
-rw-r--r--prototype_2016/third_party/qml-rust/examples/listmodel.qml24
-rw-r--r--prototype_2016/third_party/qml-rust/examples/listmodel.rs17
-rw-r--r--prototype_2016/third_party/qml-rust/examples/listmodel_macro.rs25
-rw-r--r--prototype_2016/third_party/qml-rust/examples/properties.qml33
-rw-r--r--prototype_2016/third_party/qml-rust/examples/properties.rs16
-rw-r--r--prototype_2016/third_party/qml-rust/examples/qmlregister.qml17
-rw-r--r--prototype_2016/third_party/qml-rust/examples/qmlregister.rs46
-rw-r--r--prototype_2016/third_party/qml-rust/examples/qobjects.rs31
-rw-r--r--prototype_2016/third_party/qml-rust/examples/qvarlists.qml31
-rw-r--r--prototype_2016/third_party/qml-rust/examples/qvarlists.rs15
-rw-r--r--prototype_2016/third_party/qml-rust/examples/sigslots.qml35
-rw-r--r--prototype_2016/third_party/qml-rust/examples/sigslots.rs39
-rw-r--r--prototype_2016/third_party/qml-rust/examples/threaded.qml31
-rw-r--r--prototype_2016/third_party/qml-rust/examples/threaded.rs36
-rw-r--r--prototype_2016/third_party/qml-rust/src/lib.rs37
-rw-r--r--prototype_2016/third_party/qml-rust/src/macros.rs476
-rw-r--r--prototype_2016/third_party/qml-rust/src/qabstactlistmodel.rs224
-rw-r--r--prototype_2016/third_party/qml-rust/src/qinthasharray.rs44
-rw-r--r--prototype_2016/third_party/qml-rust/src/qmeta.rs195
-rw-r--r--prototype_2016/third_party/qml-rust/src/qmlengine.rs118
-rw-r--r--prototype_2016/third_party/qml-rust/src/qmlregister.rs101
-rw-r--r--prototype_2016/third_party/qml-rust/src/qmodelindex.rs43
-rw-r--r--prototype_2016/third_party/qml-rust/src/qobject.rs120
-rw-r--r--prototype_2016/third_party/qml-rust/src/qresource.rs11
-rw-r--r--prototype_2016/third_party/qml-rust/src/qtypes.rs36
-rw-r--r--prototype_2016/third_party/qml-rust/src/qurl.rs17
-rw-r--r--prototype_2016/third_party/qml-rust/src/qvariant.rs270
-rw-r--r--prototype_2016/third_party/qml-rust/src/types.rs24
-rw-r--r--prototype_2016/third_party/qml-rust/src/utils.rs11
450 files changed, 13125 insertions, 17435 deletions
diff --git a/prototype_2016/Cargo.toml b/prototype_2016/Cargo.toml
index 20c764e..0af6aa8 100644
--- a/prototype_2016/Cargo.toml
+++ b/prototype_2016/Cargo.toml
@@ -1,10 +1,13 @@
1[package] 1[package]
2name = "secushare" 2name = "secushare"
3version = "0.0.1" 3version = "0.0.1"
4#build = "build.rs" 4build = "build.rs"
5 5
6[dependencies] 6[dependencies]
7#qml = { path = "third_party/qml-rust", version = "0.0.5" } 7qml = ">=0.0.9"
8psyc = { path = "third_party/libpsyc/rust", version = "1.0" } 8psyc = { path = "third_party/libpsyc/rust", version = "1.0" }
9futures = "0.1" 9futures = ">=0.1"
10tokio-core = "0.1" 10tokio-core = ">=0.1"
11
12[build-dependencies]
13fs-utils = "*"
diff --git a/prototype_2016/build-fluid.sh b/prototype_2016/build-fluid.sh
new file mode 100644
index 0000000..d4aef7c
--- /dev/null
+++ b/prototype_2016/build-fluid.sh
@@ -0,0 +1,11 @@
1#! /bin/bash
2
3BUILD_DIR=$(pwd)/third_party/fluid/build
4TARGET_DIR=$(pwd)/target/$PROFILE
5
6mkdir $BUILD_DIR
7cd $BUILD_DIR
8
9cmake -DCMAKE_INSTALL_PREFIX=../install ..
10make install
11cp -R ../install/lib64/qml/Fluid/ $TARGET_DIR
diff --git a/prototype_2016/build-qml-material.sh b/prototype_2016/build-qml-material.sh
deleted file mode 100755
index b2ee46e..0000000
--- a/prototype_2016/build-qml-material.sh
+++ /dev/null
@@ -1,11 +0,0 @@
1#! /bin/bash
2
3BUILD_DIR=$(pwd)/third_party/qml-material/build
4INSTALL_DIR=$BUILD_DIR/qml_modules
5
6#rm -rf $BUILD_DIR
7mkdir $BUILD_DIR
8cd $BUILD_DIR
9qtchooser -run-tool=qmake -qt=5 MODULE_INSTALL_PATH=$INSTALL_DIR ..
10make
11make install
diff --git a/prototype_2016/build.rs b/prototype_2016/build.rs
index 1bc7e06..126368d 100644
--- a/prototype_2016/build.rs
+++ b/prototype_2016/build.rs
@@ -1,38 +1,71 @@
1extern crate fs_utils;
2
1use std::process::Command; 3use std::process::Command;
2//use std::env; 4use std::str::from_utf8;
3//use std::path::*; 5use std::env;
6use std::path::Path;
7use std::fs;
8use fs_utils::*;
4 9
5fn main() 10fn main()
6{ 11{
7 Command::new("sh") 12 let out_dir = env::var("OUT_DIR").unwrap();
8 .arg("build-qml-material.sh") 13 let out_dir_path = Path::new(&out_dir);
14
15 let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
16 let resources_path = Path::new(&manifest_dir).join("resources");
17
18 let _ = fs::remove_dir_all(out_dir_path.join("resources"));
19 let path_res = copy::copy_directory(&resources_path, &out_dir_path);
20 let path = match path_res {
21 Ok(path) => path,
22 Err(err) => {
23 match err {
24 copy::Error::DestinationDirectoryExists(dir) => dir,
25 _ => panic!("failed to copy resources dir: {}", err),
26 }
27 }
28 };
29
30 let qml_lib_build_output = Command::new("sh")
31 .current_dir(&path)
32 .arg("build-resources-lib.sh")
9 .output() 33 .output()
10 .unwrap_or_else(|e| panic!("failed to execute process: {}", e)); 34 .unwrap_or_else(|e| panic!("failed to execute process: {}", e));
11 35
12 Command::new("qtchooser") 36 if !qml_lib_build_output.status.success() {
13 .arg("-run-tool=rcc") 37 panic!("Cannot build qml lib:\n{:#?}\n{:#?}",
14 .arg("-binary") 38 to_utf(&qml_lib_build_output.stdout),
15 .arg("-o") 39 to_utf(&qml_lib_build_output.stderr));
16 .arg("resources.rcc") 40 }
17 .arg("icons/icons.qrc") 41
18 .arg("third_party/qml-material/fonts/fonts.qrc") 42 let fluid_build_output = Command::new("sh")
19 //.arg("third_party/qml-material/src/styles/styles.qrc") 43 .arg("build-fluid.sh")
20 //.arg("third_party/qml-material/src/components/components.qrc")
21 //.arg("third_party/qml-material/src/core/core.qrc")
22 //.arg("third_party/qml-material/src/listitems/listitems.qrc")
23 //.arg("third_party/qml-material/src/popups/popups.qrc")
24 //.arg("third_party/qml-material/src/extras/extras.qrc")
25 //.arg("third_party/qml-material/src/window/window.qrc")
26 //.arg("third_party/qml-material/src/material.qrc")
27 //.arg("third_party/qml-material/src/controls/controls.qrc")
28 //.arg("third_party/qml-material/icons/core_icons.qrc")
29 //.arg("third_party/qml-material/fonts/fonts.qrc")
30 .output() 44 .output()
31 .unwrap_or_else(|e| panic!("failed to execute process: {}", e)); 45 .unwrap_or_else(|e| panic!("failed to execute process: {}", e));
32 46
33 //let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); 47 if !fluid_build_output.status.success() {
34 //let path = Path::new(&manifest_dir).join("third_party").join("qml-material").join("build").join("src"); 48 panic!("Cannot build qml lib:\n{:#?}\n{:#?}",
49 to_utf(&fluid_build_output.stdout),
50 to_utf(&fluid_build_output.stderr));
51 }
52
53 println!("cargo:rerun-if-changed={}", resources_path.display());
54 println!("cargo:rerun-if-changed={}", resources_path.join("qml").display());
55 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("+material").display());
56 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("+universal").display());
57 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Basic").display());
58 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Material").display());
59 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Navigation").display());
60 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Style").display());
61 println!("cargo:rustc-link-search=native={}", path.display());
62 println!("cargo:rustc-link-lib=static=resources");
63 println!("cargo:rustc-link-lib=dylib=Qt5Svg");
64}
35 65
36 //println!("cargo:rustc-link-search=native={}", path.display()); 66fn to_utf(buf: &[u8]) -> &str {
37 //println!("cargo:rustc-link-lib=static=material"); 67 match from_utf8(buf) {
68 Ok(v) => v,
69 Err(e) => panic!("Invalid UTF-8 sequence: {}", e),
70 }
38} 71}
diff --git a/prototype_2016/icons.yml b/prototype_2016/icons.yml
deleted file mode 100644
index b24452e..0000000
--- a/prototype_2016/icons.yml
+++ /dev/null
@@ -1,3 +0,0 @@
1icons:
2 - action/search
3 - action/settings
diff --git a/prototype_2016/icons/action_search.svg b/prototype_2016/icons/action_search.svg
deleted file mode 100644
index be555cd..0000000
--- a/prototype_2016/icons/action_search.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M31 28h-1.59l-.55-.55C30.82 25.18 32 22.23 32 19c0-7.18-5.82-13-13-13S6 11.82 6 19s5.82 13 13 13c3.23 0 6.18-1.18 8.45-3.13l.55.55V31l10 9.98L40.98 38 31 28zm-12 0c-4.97 0-9-4.03-9-9s4.03-9 9-9 9 4.03 9 9-4.03 9-9 9z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/icons/action_settings.svg b/prototype_2016/icons/action_settings.svg
deleted file mode 100644
index 7a01c33..0000000
--- a/prototype_2016/icons/action_settings.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3c-1.22.51-2.35 1.17-3.38 1.97L9.9 10.1c-.45-.17-.97 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3c1.22-.51 2.35-1.17 3.38-1.97l4.98 2.01c.45.17.97 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/icons/icons.qrc b/prototype_2016/icons/icons.qrc
deleted file mode 100644
index 438f540..0000000
--- a/prototype_2016/icons/icons.qrc
+++ /dev/null
@@ -1,9 +0,0 @@
1<!DOCTYPE RCC>
2<RCC version="1.0">
3
4<qresource prefix="/icons/action">
5 <file alias="search.svg">action_search.svg</file>
6 <file alias="settings.svg">action_settings.svg</file>
7</qresource>
8
9</RCC> \ No newline at end of file
diff --git a/prototype_2016/resources/build-resources-lib.sh b/prototype_2016/resources/build-resources-lib.sh
new file mode 100644
index 0000000..360ac1a
--- /dev/null
+++ b/prototype_2016/resources/build-resources-lib.sh
@@ -0,0 +1,15 @@
1#! /bin/bash
2
3#SOURCE_DIR=$(pwd)/src/view
4#BUILD_DIR=$SOURCE_DIR/build
5
6#cp -R $SOURCE_DIR/* $OUT_DIR
7
8#rm -rf $BUILD_DIR
9#mkdir $BUILD_DIR
10#cd $BUILD_DIR
11#cd $OUT_DIR
12
13set -e
14qtchooser -run-tool=qmake -qt=5 resources.pro
15make
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
diff --git a/prototype_2016/resources/resources.pro b/prototype_2016/resources/resources.pro
new file mode 100644
index 0000000..3247633
--- /dev/null
+++ b/prototype_2016/resources/resources.pro
@@ -0,0 +1,8 @@
1TEMPLATE = lib
2TARGET = resources
3
4QT += qml gui quickcontrols2
5CONFIG += c++11
6CONFIG += staticlib
7
8RESOURCES += qml/qml.qrc
diff --git a/prototype_2016/src/secushare_qml.rs b/prototype_2016/src/secushare_qml.rs
index c2f8286..7ccf12c 100644
--- a/prototype_2016/src/secushare_qml.rs
+++ b/prototype_2016/src/secushare_qml.rs
@@ -6,52 +6,47 @@ use std::time::Duration;
6use futures::Future; 6use futures::Future;
7 7
8pub struct SecushareQml { 8pub struct SecushareQml {
9 //engine: QmlEngine, 9 engine: QmlEngine,
10 psyc_client: PsycClient 10 //psyc_client: PsycClient
11} 11}
12 12
13impl SecushareQml { 13impl SecushareQml {
14 pub fn new() -> Self { 14 pub fn new() -> Self {
15 //register_resources("resources.rcc"); 15 let mut engine = QmlEngine::new();
16 //let mut engine = QmlEngine::new();
17 //engine.add_import_path("qrc://");
18 16
19 //// FIXME: importing qml-material via Qt resource system does not work yet, 17 //engine.set_and_store_property("version", "0.0.1");
20 //// so we have to tell the QML engine where the module is
21 //engine.add_import_path("third_party/qml-material/build/qml_modules");
22
23 //engine.set_and_store_property("version", "0.0.1");
24 18
25 //let mut contacts = QListModel::new(&["first_name", "surname"]); 19 //let mut contacts = QListModel::new(&["first_name", "surname"]);
26 //contacts.insert_row(qvarlist!["Paul", "McCartney"].into_iter()); 20 //contacts.insert_row(qvarlist!["Paul", "McCartney"].into_iter());
27 //contacts.insert_row(qvarlist!["Ringo", "Starr"].into_iter()); 21 //contacts.insert_row(qvarlist!["Ringo", "Starr"].into_iter());
28 //engine.set_property("contacts", &contacts.get_qvar()); 22 //engine.set_property("contacts", &contacts.get_qvar());
29 23
24 engine.load_url("qrc:///main.qml");
30 //engine.load_file("src/view/main.qml"); 25 //engine.load_file("src/view/main.qml");
31 26
32 let psyc_client = PsycClient::new(); 27 //let psyc_client = PsycClient::new();
33 28
34 SecushareQml { 29 SecushareQml {
35 //engine: engine, 30 engine: engine,
36 psyc_client: psyc_client 31 //psyc_client: psyc_client
37 } 32 }
38 } 33 }
39 34
40 pub fn run(&mut self) { 35 pub fn run(&mut self) {
41 self.psyc_client.run(); 36 //self.psyc_client.run();
42 37
43 println!("sending"); 38 //println!("sending");
44 39
45 let recipe = LoginRecipe { 40 /*let recipe = LoginRecipe {
46 recipient: b"psyc://localhost/~bob" 41 recipient: b"psyc://localhost/~bob"
47 }; 42 };*/
48 let task = self.psyc_client.make_task(recipe).map(|response| { 43 /*let task = self.psyc_client.make_task(recipe).map(|response| {
49 println!("got result: {}", response.payload); 44 println!("got result: {}", response.payload);
50 }); 45 });*/
51 46
52 self.psyc_client.start_task(task); 47 //self.psyc_client.start_task(task);
53 thread::sleep(Duration::from_millis(3000)); 48 //thread::sleep(Duration::from_millis(3000));
54 //self.engine.exec(); 49 self.engine.exec();
55 //self.engine.quit(); 50 self.engine.quit();
56 } 51 }
57} 52}
diff --git a/prototype_2016/src/view/main.qml b/prototype_2016/src/view/main.qml
deleted file mode 100644
index 67ce80e..0000000
--- a/prototype_2016/src/view/main.qml
+++ /dev/null
@@ -1,86 +0,0 @@
1import QtQuick 2.6
2import Material 0.3
3import Material.ListItems 0.1 as ListItem
4
5ApplicationWindow {
6 id: app
7
8 title: "secushare %1".arg(version)
9
10 theme {
11 primaryColor: "orange"
12 accentColor: "purple"
13 tabHighlightColor: "white"
14 }
15
16 visible: true
17
18 initialPage: TabbedPage {
19 title: "Secushare"
20
21 // FIXME: no qrc files yet
22 actions: [
23 Action {
24 iconName: 'action/search'
25 text: 'Search'
26 },
27
28
29 Action {
30 iconName: 'action/settings'
31 text: 'Settings'
32 }
33 ]
34
35 Tab {
36 title: "Conversations"
37
38 Item {
39 Sidebar {
40 Column {
41 anchors.fill: parent
42
43 Item {
44 width: parent.width
45 height: 8
46 }
47
48 ListItem.Standard {
49 text: "Conversation with Paul"
50 }
51
52 ListItem.Standard {
53 text: "Secushare prototype release"
54 }
55 }
56 }
57 }
58 }
59
60 Tab {
61 title: "Contacts"
62
63 Item {
64 Sidebar {
65 Column {
66 anchors.fill: parent
67
68 Item {
69 width: parent.width
70 height: 8
71 }
72
73 Repeater {
74 model: contacts
75
76 delegate: ListItem.Standard {
77 text: "%1 %2".arg(first_name).arg(surname)
78 }
79 }
80 }
81 }
82 }
83 }
84
85 }
86}
diff --git a/prototype_2016/third_party/fluid/.gitignore b/prototype_2016/third_party/fluid/.gitignore
new file mode 100644
index 0000000..305f772
--- /dev/null
+++ b/prototype_2016/third_party/fluid/.gitignore
@@ -0,0 +1,4 @@
1build/
2material-design-icons/
3icons/
4*.user
diff --git a/prototype_2016/third_party/fluid/.mailmap b/prototype_2016/third_party/fluid/.mailmap
new file mode 100644
index 0000000..dccdf66
--- /dev/null
+++ b/prototype_2016/third_party/fluid/.mailmap
@@ -0,0 +1,2 @@
1Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> <plfiorini@users.noreply.github.com>
2Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> <pierluigi.fiorini@hawaiios.org>
diff --git a/prototype_2016/third_party/fluid/.travis.yml b/prototype_2016/third_party/fluid/.travis.yml
new file mode 100644
index 0000000..e0d227d
--- /dev/null
+++ b/prototype_2016/third_party/fluid/.travis.yml
@@ -0,0 +1,54 @@
1language: c
2
3compiler:
4 - gcc
5 - clang
6
7sudo: required
8
9env:
10 global:
11 # BINTRAY_USER
12 - secure: "vEoMBcWLvExapeJ7644Qa5j8zQcIRvSmZawrDWciQAVv47ckjS4CzeKxfniwYuVcMY+G8mk+NANM/cvEYhBuBx1YLRz7qR9WkLtIGs5ZN/Tqna8bEYDx4fz/grsaPIO0zSCOlFy4gjW4OTZc0Pi6h82UNkbu4VruCA0+KHRMeLbqP2SnhLTlKibofp3YgFLK+MpBjQ9m99rfkRlVWSdY6dscST3s5ROreTepoaP1Q4XzG1eRp2aLSqKurWnDdFdXZhInHeWxWwZ5lRPcCj29+oYgU8cvxA/D2DuDfPlM92XzqTTqD9tTztnz0klN/tQaXECaFZYu5/BC/o71FmWtYzuc7SScggFU1XLmEPdsYy8B/bDyvP+QueiwO/i3ZnEiSLccuN7fkEi2qCHLjpcMRJb/A6NKcgkyFHN65ncqcvG3xrk7mcCAMiupkpx0MVskiYI0HD3g/2auIEjDcqKbOGYV1mRwGhWwV51qfDYsAtSQcn5JaTN3ioFjfPpSI4swevAfOdBp1vhkFXvYQHDEWtyaQWQkiZN/D2osO3VoTgXMUF68I2BNskUVXqU/X18f3xzcv3PXsUCTWAY8tQ7iDt93UQyC/rtqnxUhKJqcnM2ri7GGk2yK/GHyjUonf9GO5mucPyAWzkPP13T6gj1Y/XH76wFBurdP89FUidyiVVE="
13 # BINTRAY_API_KEY
14 - secure: "Z4721k6LWdc7/UDVkBSVxr1G2nRWJu1817jCpuE+6pub65WhGqBB20xwI3jsp/J2U2iX3RUgLiJTCRPuQnLoxaDRXY1WZa2qXLumgGcYwgwgCLQgBIvV5OWwPgBpSl40f7w1c8qfEVTeFt4X51fwZR+2WSNzCn9dHZFICHwweasNXMe/1/nnopvZmTmnAICLTTGM3QL8TgrqnAevNtR9/ILGli6YewFmpPBiy/nV5SIPlay4s0gtpr4WOACHbCjyi2dY+OMgln+zcrV2Xe75b/G9G+JbjmQj2wb3MviQhQ9EXGhxcRZTmpgLmZ4VXuFizsl1ssfte7p8JEHdwJi1nnGkjuP0xcmfc/t8y3u/QFQbPd0K/xgQhrHVlVytDGgrwZdfGoHV43E5v338E6vPd0R4PaZbKKwvEfze3T+X04wrnMm2SgtVQnr4l0WBwYEsOLP+MdFyfHsXs74MMg+1VQcz6gnD7YPOPqftds0ZaEltIn6VOZqt72K06t544jjFv1fIxA0bWDFBgIECfF6dGRykaw/Jo/29VoUT9K4dfMX/V9LMxy1x3p/ltW1U0VryqUCzj/QqSJw82rEYkMMvQYq8x+eBdlYjbAZZhRGvMHYa+1uHwiKbyRyQQZlc+r8b1/usI9B2E4y12dPPGmHBW8gbRHfoGCX5m3aBkaqUpeE="
15 # BINTRAY_REPO_OWNER
16 - secure: "fHxkvRKupN+jmbncPeNIVxvAxmHpZskJ89jJoDM3Fdmheq08+BPCLVUaDX3C1Ux4ETCONKKFwiQ152M30TczU95OXCfs9N3Uo631CL0AFH0vavBPDtAdZyOdljS+gkFMRCT/NFxdTgaju128jYVqumJw6fSVke8Edh43cDURhhpD6Xr6qm45620Iua3/Vieu/IBzoCISV4RgBxSgPOBew8diIk9nVqk4nSeU9aP110lJ5ExhI++G7sRaZvlMTkHdti5Wcg2/MXy883IVAacieOALRmdBuW1lv1lgEkV6KZ0cjmiG8B0XuvkWCgx05wbY4FWnAZlU6mkuTUPo4Sg2JhtGUr1ejAHe3TF1g05s2JBiP8oX2vdflh5Immyi0afpdzJGxinrEXY39QBmfK8Donkn78Flz7NdLQz882bdQsQ3MnFGHG8FOqMdJWAAUxpn7L5SCgShH/GpspFnvONWKmJybsRAdMZTHJL7d4pwYgo854vo43p9RDGSZX/jdQ6Gb874rNUdtfWXZLWpaq4jH/jigC+WGG4r78kNIMoylRRqINfg2F7jjR4Z/rieePZ7d0IUeD4+a0XFriYuix415FPpRcogB4cpXmDn6ZQTCfd4QDBxILlv6phHMcTOvrwgBMd40OCtewkXrODIKqC6xaeWf99/8sJti5ZUZK5DiuA="
17
18arch:
19 packages:
20 - qt5-declarative
21 - qt5-quickcontrols2
22 - qt5-graphicaleffects
23 - qt5-svg
24 - extra-cmake-modules
25 - xorg-server-xvfb
26 - clang
27 #- clazy-git
28 script:
29 - scripts/fetch_icons.sh
30 - if [ "$CC" = "gcc" ]; then cmake . -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr; fi
31 #- if [ "$CC" = "clang" ]; then env CLAZY_CHECKS="level1" cmake . -DCMAKE_CXX_COMPILER=clazy -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr; fi
32 - if [ "$CC" = "clang" ]; then cmake . -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_INSTALL_PREFIX=/usr; fi
33 - make
34 - sudo make install
35 - xvfb-run -a -s "-screen 0 800x600x24" make check
36 - ./.travis/bintray-wrapper.sh
37
38script:
39 - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"
40
41deploy:
42 provider: bintray
43 on:
44 branch: develop
45 condition: "$CC = gcc"
46 file: cibuild/bintray.json
47 user:
48 secure: "ABQ0Vh69XIJ38UOTGQOmnJ/zr1E0zNK6bDkqJ+ioujqBE8pvZuppdb9DyPmqscUgJWLQy8C7qfRMXMkkBUdecqV7LAFplO08yMxXmSNCq2gYi7l8jY6WCp+dyno+8tO7P7zO/8Vgae99c2MNkCVw8FpN7vFC3l5QLBUuEuSgCWYInW4aXkQnTkKNPN5hiMb7pJ7c1WMo6YKydkKs6yL4ACUkTzoR8iuTLqIAvi2w9UMzIUE16FGOHHUSZZI0UwExhSPTmH30pLddKexvdip6AyROGPDSqgh1zh9mIpYyz6BRWoTPR8LCpAFE2soTF2t0XdkRoQeZS6+zXJdU3AdJnEj1y2n9zxR3CSl+MfeJCz24yAJ+2shLyl+LZwhert7z45GC5CNrFsxliA7wMCuP3AeBEwCYaTgNcB5mQWK7+nyQuEZ43v/ffQiZUziEPOsHpxdggPN4TQ/KLSwC9eSKyh7dvlvupfd5p509d06239gXVNwDU45H3in2XKv9WQQIBXLW48IoY7YQFDvKCsAuNNn1fJLMLhg4MUqSYWSCYGjGn3nHBm9IJ0Y176dzN7c+2kP+Vm6x9PhWR6ZDpRVh4ygh+TKVNTVpzQ2bD/J+vWcGTf1KP4GJOLPWe7S0BsXNWry1jGz8v+9IDDPMVf9bFRSBZNSGD/qU8FCsS6nVXOU="
49 key:
50 secure: "x5L7Cc9ncaXhjLjGi/+0P1Yjzo5yPTPqB47odKvnvHVG91n7LR0tCY8pKMAITSlnKqxlV6q/jlr5Ur8JzY0hwwi1KaM7t80cjWn9feE79DsA2Tpdxks2eRLQs1kXoqepa+tpuxOCysrYL5KMw/ly3vnnnkeXleb05bdadZLxdf54BK+6pA8djwKoVAba4lQDBL4RrdN7yQYB5ZBdGHFO6BScaVR1xuykOalfSQsQWAQqENbnOSFpxkdxYt0FUsP2N0UwqZ7kbX7XtdRKCfubnRJ9YoNh4kbImRLKbosl1NX8+MAwbudnKa6AV3P+LxQZA6cU1T8JIu6W54A7pXJYnf2bOezSy4ifzE0L+4rgbrIQVL9AUcWpK8gDkdpPJ6B6gwWW8+VP+wDCnzXEk9DXBlOLCGeHBaDOJAeOkCC2NJ64hC0bQfILO79KKYkpQTTf1uepngeie7y50CmOq4CaxAX1rQcPz2GlZlp5XIOZX5ZV5GABxORCn4zANrs7hmhY44ooky6KltiA35vgFxJGfqkgSUWWFqHvEPwDN2anRLjlY+trMN3YRMBCnhL3WCtHjiJ5sUW6drUcBfzcoJxGY7JF31q8N7y0ZhdXNc5P6GC/f62ggHDnk9lklOb4DlEqh+npREk+o89TUU/RkXNPuLBpNiq3UwCrDlKbpoULhgs="
51
52notifications:
53 email: false
54 slack: lirios:fdUqVmPzqPskEL1UBhqapZ0w
diff --git a/prototype_2016/third_party/fluid/.travis/PKGBUILD.in b/prototype_2016/third_party/fluid/.travis/PKGBUILD.in
new file mode 100644
index 0000000..82a49c2
--- /dev/null
+++ b/prototype_2016/third_party/fluid/.travis/PKGBUILD.in
@@ -0,0 +1,47 @@
1# Maintainer: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2
3pkgname=fluid-git
4pkgver=@PKGVER@
5pkgrel=1
6pkgdesc="Components for Qt Quick applications"
7arch=('i686' 'x86_64' 'armv6h' 'armv7h')
8url='https://github.com/lirios'
9license=('MPL2')
10depends=('qt5-quickcontrols2' 'qt5-graphicaleffects' 'qt5-svg')
11makedepends=('git' 'extra-cmake-modules')
12conflicts=('fluid')
13replaces=('fluid')
14provides=('fluid')
15groups=('liri-git')
16
17_gitroot="git://github.com/lirios/fluid.git"
18_gitbranch=@GITBRANCH@
19_gitname=$pkgname
20source=(${_gitname}::${_gitroot}#branch=${_gitbranch})
21md5sums=('SKIP')
22
23pkgver() {
24 cd ${srcdir}/${_gitname}
25 echo "$(git log -1 --format="%cd" --date=short | tr -d '-').$(git log -1 --format="%h")"
26}
27
28prepare() {
29 mkdir -p build
30}
31
32build() {
33 cd build
34 cmake ../${_gitname} \
35 -DCMAKE_INSTALL_PREFIX=/usr \
36 -DLIB_INSTALL_DIR=lib \
37 -DLIBEXEC_INSTALL_DIR=lib \
38 -DQML_INSTALL_DIR=lib/qt/qml \
39 -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
40 -DCMAKE_BUILD_TYPE=RelWithDebInfo
41 make
42}
43
44package() {
45 cd build
46 make DESTDIR="${pkgdir}" install
47}
diff --git a/prototype_2016/third_party/fluid/.travis/bintray-wrapper.sh b/prototype_2016/third_party/fluid/.travis/bintray-wrapper.sh
new file mode 100755
index 0000000..04c2ebd
--- /dev/null
+++ b/prototype_2016/third_party/fluid/.travis/bintray-wrapper.sh
@@ -0,0 +1,42 @@
1#!/bin/bash
2#
3# This file is part of Liri.
4#
5# Copyright (C) 2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
6#
7# $BEGIN_LICENSE:BSD$
8#
9# You may use this file under the terms of the BSD license as follows:
10#
11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions are met:
13# * Redistributions of source code must retain the above copyright
14# notice, this list of conditions and the following disclaimer.
15# * Redistributions in binary form must reproduce the above copyright
16# notice, this list of conditions and the following disclaimer in the
17# documentation and/or other materials provided with the distribution.
18# * Neither the name of the Hawaii Project nor the
19# names of its contributors may be used to endorse or promote products
20# derived from this software without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25# DISCLAIMED. IN NO EVENT SHALL Pier Luigi Fiorini BE LIABLE FOR ANY
26# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32#
33# $END_LICENSE$
34#
35
36if [ "$CC" = "gcc" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
37 if [ "$TRAVIS_BRANCH" = "develop" -o "$TRAVIS_BRANCH" = "master" ]; then
38 curl -s https://raw.githubusercontent.com/lirios/repotools/${TRAVIS_BRANCH}/travis/bintray.sh > .travis/bintray.sh
39 chmod 755 .travis/bintray.sh
40 exec ./.travis/bintray.sh
41 fi
42fi
diff --git a/prototype_2016/third_party/fluid/.travis/bintray.json.in b/prototype_2016/third_party/fluid/.travis/bintray.json.in
new file mode 100644
index 0000000..690b379
--- /dev/null
+++ b/prototype_2016/third_party/fluid/.travis/bintray.json.in
@@ -0,0 +1,29 @@
1{
2 "package": {
3 "name": "fluid",
4 "repo": "archlinux-@GITBRANCH@",
5 "subject": "liri",
6 "desc": "A collection of cross-platform QtQuick components for building fluid and dynamic applications",
7 "website_url": "http://liri.io",
8 "issue_tracker_url": "https://github.com/lirios/fluid",
9 "vcs_url": "https://github.com/lirios/fluid",
10 "licenses": ["MPL-2.0"],
11 "labels": ["qt", "qml", "quick", "controls", "material"]
12 },
13 "version": {
14 "name": "@PKGVER@",
15 "desc": "Arch Linux build from CI",
16 "released": "@TODAY@",
17 "vcs_tag": "@GITREV@",
18 "attributes": [
19 {"name": "gitrevision", "values": ["@GITREV@"], "type": "string"},
20 {"name": "gitdate", "values": ["@GITDATE@"], "type": "date"}
21 ],
22 "gpgSign": false
23 },
24 "files": [
25 {"includePattern": "cibuild/(fluid-git-.*.pkg.tar.xz)", "uploadPattern": "@ARCH@/$1", "matrixParams": {"override": 1}},
26 {"includePattern": "cibuild/(fluid.db.tar.gz)", "uploadPattern": "@ARCH@/fluid.db", "matrixParams": {"override": 1}}
27 ],
28 "publish": true
29}
diff --git a/prototype_2016/third_party/fluid/AUTHORS.md b/prototype_2016/third_party/fluid/AUTHORS.md
new file mode 100644
index 0000000..77aee46
--- /dev/null
+++ b/prototype_2016/third_party/fluid/AUTHORS.md
@@ -0,0 +1,25 @@
1Fluid
2=====
3
4# Authors
5
6 * Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
7 * Michael Spencer <sonrisesoftware@gmail.com>
8
9This is the list of contributors to this code base.
10
11Names are sorted by number of commits at the time of this writing.
12Commit data has been generated with:
13
14```sh
15git shortlog -s -e -n
16```
17
18Commit counts have been removed, since they change pretty frequently.
19
20Remember to update this file before any release is made, also make sure
21a .mailmap file is maintained if committer names and email addresses
22change over time.
23
24 * Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
25 * Michael Spencer <sonrisesoftware@gmail.com>
diff --git a/prototype_2016/third_party/fluid/CMakeLists.txt b/prototype_2016/third_party/fluid/CMakeLists.txt
new file mode 100644
index 0000000..3411262
--- /dev/null
+++ b/prototype_2016/third_party/fluid/CMakeLists.txt
@@ -0,0 +1,84 @@
1project(Fluid)
2
3cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
4cmake_policy(VERSION 3.4.1)
5
6# Instruct CMake to run moc and rrc automatically when needed
7set(CMAKE_AUTOMOC ON)
8set(CMAKE_AUTORCC ON)
9
10# Apple-specific configuration
11set(APPLE_SUPPRESS_X11_WARNING ON)
12
13# Set version
14set(PROJECT_VERSION "0.9.0")
15set(PROJECT_VERSION_MAJOR 0)
16set(PROJECT_SOVERSION 0)
17
18# Set up packaging
19if(NOT USE_SUPERBUILD)
20 set(CPACK_PACKAGE_NAME "fluid")
21 set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
22 set(CPACK_GENERATOR "TGZ")
23 set(CPACK_SET_DESTDIR FALSE)
24 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
25 set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git;/.tx/;~$;${CPACK_SOURCE_IGNORE_FILES}")
26 include(CPack)
27 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
28endif()
29
30# ECM
31find_package(ECM 1.7.0 REQUIRED NO_MODULE)
32list(APPEND CMAKE_MODULE_PATH
33 "${ECM_MODULE_PATH}"
34 "${ECM_KDE_MODULE_DIR}"
35)
36
37# Macros
38include(FeatureSummary)
39include(KDEInstallDirs)
40include(KDECompilerSettings)
41include(KDECMakeSettings)
42
43# Build flags
44set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Werror -Wall -Wextra -Wformat -Wswitch-default -Wunused-parameter -pedantic -std=c++11")
45
46# Assume release build by default
47if(NOT CMAKE_BUILD_TYPE)
48 set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
49endif()
50
51# Find Qt5
52set(REQUIRED_QT_VERSION "5.7.0")
53find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED COMPONENTS
54 Svg Gui Qml Quick QuickTest QuickControls2)
55
56# Find QT_INSTALL_DOCS
57get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
58if(NOT QT_INSTALL_DOCS)
59 exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_DOCS" RETURN_VALUE return_code OUTPUT_VARIABLE QT_INSTALL_DOCS)
60endif()
61
62# Documentation target
63find_program(QDOC_EXECUTABLE qdoc-qt5 qdoc)
64add_custom_target(docs
65 COMMAND QT_INSTALL_DOCS=${QT_INSTALL_DOCS} QT_VERSION_TAG=5.7 FLUID_VERSION=${PROJECT_VERSION} FLUID_VERSION_TAG=1.0 FLUID_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doc/fluid.qdocconf)
66
67# Subdirectories
68add_subdirectory(controls)
69add_subdirectory(core)
70add_subdirectory(demo)
71add_subdirectory(effects)
72add_subdirectory(src)
73add_subdirectory(tests)
74add_subdirectory(material)
75
76# Install icons
77if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons")
78 install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/icons"
79 DESTINATION ${QML_INSTALL_DIR}/Fluid/Controls
80 PATTERN "icons/icons.qrc" EXCLUDE)
81endif()
82
83# Display feature summary
84feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/prototype_2016/third_party/fluid/LICENSE.MPL2 b/prototype_2016/third_party/fluid/LICENSE.MPL2
new file mode 100644
index 0000000..14e2f77
--- /dev/null
+++ b/prototype_2016/third_party/fluid/LICENSE.MPL2
@@ -0,0 +1,373 @@
1Mozilla Public License Version 2.0
2==================================
3
41. Definitions
5--------------
6
71.1. "Contributor"
8 means each individual or legal entity that creates, contributes to
9 the creation of, or owns Covered Software.
10
111.2. "Contributor Version"
12 means the combination of the Contributions of others (if any) used
13 by a Contributor and that particular Contributor's Contribution.
14
151.3. "Contribution"
16 means Covered Software of a particular Contributor.
17
181.4. "Covered Software"
19 means Source Code Form to which the initial Contributor has attached
20 the notice in Exhibit A, the Executable Form of such Source Code
21 Form, and Modifications of such Source Code Form, in each case
22 including portions thereof.
23
241.5. "Incompatible With Secondary Licenses"
25 means
26
27 (a) that the initial Contributor has attached the notice described
28 in Exhibit B to the Covered Software; or
29
30 (b) that the Covered Software was made available under the terms of
31 version 1.1 or earlier of the License, but not also under the
32 terms of a Secondary License.
33
341.6. "Executable Form"
35 means any form of the work other than Source Code Form.
36
371.7. "Larger Work"
38 means a work that combines Covered Software with other material, in
39 a separate file or files, that is not Covered Software.
40
411.8. "License"
42 means this document.
43
441.9. "Licensable"
45 means having the right to grant, to the maximum extent possible,
46 whether at the time of the initial grant or subsequently, any and
47 all of the rights conveyed by this License.
48
491.10. "Modifications"
50 means any of the following:
51
52 (a) any file in Source Code Form that results from an addition to,
53 deletion from, or modification of the contents of Covered
54 Software; or
55
56 (b) any new file in Source Code Form that contains any Covered
57 Software.
58
591.11. "Patent Claims" of a Contributor
60 means any patent claim(s), including without limitation, method,
61 process, and apparatus claims, in any patent Licensable by such
62 Contributor that would be infringed, but for the grant of the
63 License, by the making, using, selling, offering for sale, having
64 made, import, or transfer of either its Contributions or its
65 Contributor Version.
66
671.12. "Secondary License"
68 means either the GNU General Public License, Version 2.0, the GNU
69 Lesser General Public License, Version 2.1, the GNU Affero General
70 Public License, Version 3.0, or any later versions of those
71 licenses.
72
731.13. "Source Code Form"
74 means the form of the work preferred for making modifications.
75
761.14. "You" (or "Your")
77 means an individual or a legal entity exercising rights under this
78 License. For legal entities, "You" includes any entity that
79 controls, is controlled by, or is under common control with You. For
80 purposes of this definition, "control" means (a) the power, direct
81 or indirect, to cause the direction or management of such entity,
82 whether by contract or otherwise, or (b) ownership of more than
83 fifty percent (50%) of the outstanding shares or beneficial
84 ownership of such entity.
85
862. License Grants and Conditions
87--------------------------------
88
892.1. Grants
90
91Each Contributor hereby grants You a world-wide, royalty-free,
92non-exclusive license:
93
94(a) under intellectual property rights (other than patent or trademark)
95 Licensable by such Contributor to use, reproduce, make available,
96 modify, display, perform, distribute, and otherwise exploit its
97 Contributions, either on an unmodified basis, with Modifications, or
98 as part of a Larger Work; and
99
100(b) under Patent Claims of such Contributor to make, use, sell, offer
101 for sale, have made, import, and otherwise transfer either its
102 Contributions or its Contributor Version.
103
1042.2. Effective Date
105
106The licenses granted in Section 2.1 with respect to any Contribution
107become effective for each Contribution on the date the Contributor first
108distributes such Contribution.
109
1102.3. Limitations on Grant Scope
111
112The licenses granted in this Section 2 are the only rights granted under
113this License. No additional rights or licenses will be implied from the
114distribution or licensing of Covered Software under this License.
115Notwithstanding Section 2.1(b) above, no patent license is granted by a
116Contributor:
117
118(a) for any code that a Contributor has removed from Covered Software;
119 or
120
121(b) for infringements caused by: (i) Your and any other third party's
122 modifications of Covered Software, or (ii) the combination of its
123 Contributions with other software (except as part of its Contributor
124 Version); or
125
126(c) under Patent Claims infringed by Covered Software in the absence of
127 its Contributions.
128
129This License does not grant any rights in the trademarks, service marks,
130or logos of any Contributor (except as may be necessary to comply with
131the notice requirements in Section 3.4).
132
1332.4. Subsequent Licenses
134
135No Contributor makes additional grants as a result of Your choice to
136distribute the Covered Software under a subsequent version of this
137License (see Section 10.2) or under the terms of a Secondary License (if
138permitted under the terms of Section 3.3).
139
1402.5. Representation
141
142Each Contributor represents that the Contributor believes its
143Contributions are its original creation(s) or it has sufficient rights
144to grant the rights to its Contributions conveyed by this License.
145
1462.6. Fair Use
147
148This License is not intended to limit any rights You have under
149applicable copyright doctrines of fair use, fair dealing, or other
150equivalents.
151
1522.7. Conditions
153
154Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155in Section 2.1.
156
1573. Responsibilities
158-------------------
159
1603.1. Distribution of Source Form
161
162All distribution of Covered Software in Source Code Form, including any
163Modifications that You create or to which You contribute, must be under
164the terms of this License. You must inform recipients that the Source
165Code Form of the Covered Software is governed by the terms of this
166License, and how they can obtain a copy of this License. You may not
167attempt to alter or restrict the recipients' rights in the Source Code
168Form.
169
1703.2. Distribution of Executable Form
171
172If You distribute Covered Software in Executable Form then:
173
174(a) such Covered Software must also be made available in Source Code
175 Form, as described in Section 3.1, and You must inform recipients of
176 the Executable Form how they can obtain a copy of such Source Code
177 Form by reasonable means in a timely manner, at a charge no more
178 than the cost of distribution to the recipient; and
179
180(b) You may distribute such Executable Form under the terms of this
181 License, or sublicense it under different terms, provided that the
182 license for the Executable Form does not attempt to limit or alter
183 the recipients' rights in the Source Code Form under this License.
184
1853.3. Distribution of a Larger Work
186
187You may create and distribute a Larger Work under terms of Your choice,
188provided that You also comply with the requirements of this License for
189the Covered Software. If the Larger Work is a combination of Covered
190Software with a work governed by one or more Secondary Licenses, and the
191Covered Software is not Incompatible With Secondary Licenses, this
192License permits You to additionally distribute such Covered Software
193under the terms of such Secondary License(s), so that the recipient of
194the Larger Work may, at their option, further distribute the Covered
195Software under the terms of either this License or such Secondary
196License(s).
197
1983.4. Notices
199
200You may not remove or alter the substance of any license notices
201(including copyright notices, patent notices, disclaimers of warranty,
202or limitations of liability) contained within the Source Code Form of
203the Covered Software, except that You may alter any license notices to
204the extent required to remedy known factual inaccuracies.
205
2063.5. Application of Additional Terms
207
208You may choose to offer, and to charge a fee for, warranty, support,
209indemnity or liability obligations to one or more recipients of Covered
210Software. However, You may do so only on Your own behalf, and not on
211behalf of any Contributor. You must make it absolutely clear that any
212such warranty, support, indemnity, or liability obligation is offered by
213You alone, and You hereby agree to indemnify every Contributor for any
214liability incurred by such Contributor as a result of warranty, support,
215indemnity or liability terms You offer. You may include additional
216disclaimers of warranty and limitations of liability specific to any
217jurisdiction.
218
2194. Inability to Comply Due to Statute or Regulation
220---------------------------------------------------
221
222If it is impossible for You to comply with any of the terms of this
223License with respect to some or all of the Covered Software due to
224statute, judicial order, or regulation then You must: (a) comply with
225the terms of this License to the maximum extent possible; and (b)
226describe the limitations and the code they affect. Such description must
227be placed in a text file included with all distributions of the Covered
228Software under this License. Except to the extent prohibited by statute
229or regulation, such description must be sufficiently detailed for a
230recipient of ordinary skill to be able to understand it.
231
2325. Termination
233--------------
234
2355.1. The rights granted under this License will terminate automatically
236if You fail to comply with any of its terms. However, if You become
237compliant, then the rights granted under this License from a particular
238Contributor are reinstated (a) provisionally, unless and until such
239Contributor explicitly and finally terminates Your grants, and (b) on an
240ongoing basis, if such Contributor fails to notify You of the
241non-compliance by some reasonable means prior to 60 days after You have
242come back into compliance. Moreover, Your grants from a particular
243Contributor are reinstated on an ongoing basis if such Contributor
244notifies You of the non-compliance by some reasonable means, this is the
245first time You have received notice of non-compliance with this License
246from such Contributor, and You become compliant prior to 30 days after
247Your receipt of the notice.
248
2495.2. If You initiate litigation against any entity by asserting a patent
250infringement claim (excluding declaratory judgment actions,
251counter-claims, and cross-claims) alleging that a Contributor Version
252directly or indirectly infringes any patent, then the rights granted to
253You by any and all Contributors for the Covered Software under Section
2542.1 of this License shall terminate.
255
2565.3. In the event of termination under Sections 5.1 or 5.2 above, all
257end user license agreements (excluding distributors and resellers) which
258have been validly granted by You or Your distributors under this License
259prior to termination shall survive termination.
260
261************************************************************************
262* *
263* 6. Disclaimer of Warranty *
264* ------------------------- *
265* *
266* Covered Software is provided under this License on an "as is" *
267* basis, without warranty of any kind, either expressed, implied, or *
268* statutory, including, without limitation, warranties that the *
269* Covered Software is free of defects, merchantable, fit for a *
270* particular purpose or non-infringing. The entire risk as to the *
271* quality and performance of the Covered Software is with You. *
272* Should any Covered Software prove defective in any respect, You *
273* (not any Contributor) assume the cost of any necessary servicing, *
274* repair, or correction. This disclaimer of warranty constitutes an *
275* essential part of this License. No use of any Covered Software is *
276* authorized under this License except under this disclaimer. *
277* *
278************************************************************************
279
280************************************************************************
281* *
282* 7. Limitation of Liability *
283* -------------------------- *
284* *
285* Under no circumstances and under no legal theory, whether tort *
286* (including negligence), contract, or otherwise, shall any *
287* Contributor, or anyone who distributes Covered Software as *
288* permitted above, be liable to You for any direct, indirect, *
289* special, incidental, or consequential damages of any character *
290* including, without limitation, damages for lost profits, loss of *
291* goodwill, work stoppage, computer failure or malfunction, or any *
292* and all other commercial damages or losses, even if such party *
293* shall have been informed of the possibility of such damages. This *
294* limitation of liability shall not apply to liability for death or *
295* personal injury resulting from such party's negligence to the *
296* extent applicable law prohibits such limitation. Some *
297* jurisdictions do not allow the exclusion or limitation of *
298* incidental or consequential damages, so this exclusion and *
299* limitation may not apply to You. *
300* *
301************************************************************************
302
3038. Litigation
304-------------
305
306Any litigation relating to this License may be brought only in the
307courts of a jurisdiction where the defendant maintains its principal
308place of business and such litigation shall be governed by laws of that
309jurisdiction, without reference to its conflict-of-law provisions.
310Nothing in this Section shall prevent a party's ability to bring
311cross-claims or counter-claims.
312
3139. Miscellaneous
314----------------
315
316This License represents the complete agreement concerning the subject
317matter hereof. If any provision of this License is held to be
318unenforceable, such provision shall be reformed only to the extent
319necessary to make it enforceable. Any law or regulation which provides
320that the language of a contract shall be construed against the drafter
321shall not be used to construe this License against a Contributor.
322
32310. Versions of the License
324---------------------------
325
32610.1. New Versions
327
328Mozilla Foundation is the license steward. Except as provided in Section
32910.3, no one other than the license steward has the right to modify or
330publish new versions of this License. Each version will be given a
331distinguishing version number.
332
33310.2. Effect of New Versions
334
335You may distribute the Covered Software under the terms of the version
336of the License under which You originally received the Covered Software,
337or under the terms of any subsequent version published by the license
338steward.
339
34010.3. Modified Versions
341
342If you create software not governed by this License, and you want to
343create a new license for such software, you may create and use a
344modified version of this License if you rename the license and remove
345any references to the name of the license steward (except to note that
346such modified license differs from this License).
347
34810.4. Distributing Source Code Form that is Incompatible With Secondary
349Licenses
350
351If You choose to distribute Source Code Form that is Incompatible With
352Secondary Licenses under the terms of this version of the License, the
353notice described in Exhibit B of this License must be attached.
354
355Exhibit A - Source Code Form License Notice
356-------------------------------------------
357
358 This Source Code Form is subject to the terms of the Mozilla Public
359 License, v. 2.0. If a copy of the MPL was not distributed with this
360 file, You can obtain one at http://mozilla.org/MPL/2.0/.
361
362If it is not possible or desirable to put the notice in a particular
363file, then You may include the notice in a location (such as a LICENSE
364file in a relevant directory) where a recipient would be likely to look
365for such a notice.
366
367You may add additional accurate notices of copyright ownership.
368
369Exhibit B - "Incompatible With Secondary Licenses" Notice
370---------------------------------------------------------
371
372 This Source Code Form is "Incompatible With Secondary Licenses", as
373 defined by the Mozilla Public License, v. 2.0.
diff --git a/prototype_2016/third_party/fluid/README.md b/prototype_2016/third_party/fluid/README.md
new file mode 100644
index 0000000..70d04ba
--- /dev/null
+++ b/prototype_2016/third_party/fluid/README.md
@@ -0,0 +1,77 @@
1Fluid
2=====
3
4[![ZenHub.io](https://img.shields.io/badge/supercharged%20by-zenhub.io-blue.svg)](https://zenhub.io)
5
6[![License](https://img.shields.io/badge/license-MPL2-blue.svg)](https://www.mozilla.org/en-US/MPL/2.0/)
7[![GitHub release](https://img.shields.io/github/release/lirios/fluid.svg)](https://github.com/lirios/fluid)
8[![Build Status](https://travis-ci.org/lirios/fluid.svg?branch=develop)](https://travis-ci.org/lirios/fluid)
9[![GitHub issues](https://img.shields.io/github/issues/lirios/fluid.svg)](https://github.com/lirios/fluid/issues)
10[![Maintained](https://img.shields.io/maintenance/yes/2017.svg)](https://github.com/lirios/fluid/commits/develop)
11
12Fluid is a collection of cross-platform QtQuick components for building fluid and dynamic applications.
13
14## Dependencies
15
16Qt >= 5.7.0 with at least the following modules is required:
17
18 * [qtbase](http://code.qt.io/cgit/qt/qtbase.git)
19 * [qtdeclarative](http://code.qt.io/cgit/qt/qtdeclarative.git)
20 * [qtquickcontrols2](http://code.qt.io/cgit/qt/qtquickcontrols2.git)
21 * [qtgraphicaleffects](http://code.qt.io/cgit/qt/qtgraphicaleffects.git)
22 * [qtsvg](http://code.qt.io/cgit/qt/qtsvg.git)
23
24## System-wide installation
25
26First, if you want to include the Material Design icons used with the `Icon` component, run:
27
28```sh
29./scripts/fetch_icons.sh
30```
31
32This will clone the Google repository holding the icons and copy the SVG icons into the `icons` directory.
33
34From the root of the repository, run:
35
36```sh
37mkdir build; cd build
38cmake .. -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
39make
40make install # use sudo if necessary
41```
42
43On the `cmake` line, you can specify additional configuration parameters:
44
45 * `-DCMAKE_INSTALL_PREFIX=/path/to/install` (for example, `/opt/liri` or `/usr`)
46 * `-DCMAKE_BUILD_TYPE=<build_type>`, where `<build_type>` is one of:
47 * **Debug:** debug build
48 * **Release:** release build
49 * **RelWithDebInfo:** release build with debugging information
50
51## Per-project installation using QMake
52
53First, clone this repository.
54
55Run the icon script located here:
56
57```sh
58./scripts/fetch_icons.sh
59```
60
61In your project file, include the fluid.pri file:
62 `include(path/to/fluid.pri)`
63
64Then, in your `main.cpp` file or wherever you set up a `QQmlApplicationEngine`:
65* add this include directive :
66`#include "iconthemeimageprovider.h"`
67* add the resources files to your `QQmlApplicationEngine` import paths :
68`engine.addImportPath(QStringLiteral("qrc:/"));`
69* register fluid's image providers to the engine :
70`engine.addImageProvider(QLatin1String("fluidicons"), new IconsImageProvider());`
71`engine.addImageProvider(QLatin1String("fluidicontheme"), new IconThemeImageProvider());`
72* and after that you can load your qml file:
73`engine.load(QUrl(QStringLiteral("qrc:/main.qml")));`
74
75## Licensing
76
77Licensed under the terms of the Mozilla Public License version 2.0.
diff --git a/prototype_2016/third_party/fluid/controls/+material/BaseListItem.qml b/prototype_2016/third_party/fluid/controls/+material/BaseListItem.qml
new file mode 100644
index 0000000..2a956bc
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/BaseListItem.qml
@@ -0,0 +1,45 @@
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 2.4
16import QtQuick.Controls 2.0
17import Fluid.Material 1.0
18
19ListItemDelegate {
20 id: listItem
21
22 background: Rectangle {
23 color: listItem.highlighted ? Qt.rgba(0,0,0,0.05)
24 : ripple.containsMouse ? Qt.rgba(0,0,0,0.03)
25 : Qt.rgba(0,0,0,0)
26
27 Ripple {
28 id: ripple
29 width: parent.width
30 height: parent.height
31 enabled: interactive
32
33 control: listItem
34 }
35
36 ThinDivider {
37 x: dividerInset
38 y: parent.height - height
39
40 width: parent.width - x
41
42 visible: showDivider
43 }
44 }
45}
diff --git a/prototype_2016/third_party/fluid/controls/+material/BodyLabel.qml b/prototype_2016/third_party/fluid/controls/+material/BodyLabel.qml
new file mode 100644
index 0000000..9445a1e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/BodyLabel.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.4
16import QtQuick.Controls 2.0
17import Fluid.Core 1.0
18
19Label {
20 property int level: 1
21
22 font.pixelSize: Device.isMobile ? 14 : 13
23 font.weight: level == 1 ? Font.Normal : Font.Medium
24 lineHeight: level <= 1 ? 20.0 : 24.0
25 lineHeightMode: Text.FixedHeight
26 onLevelChanged: {
27 if (level < 1 || level > 2)
28 console.error("BodyLabel level must be either 1 or 2")
29 }
30}
diff --git a/prototype_2016/third_party/fluid/controls/+material/CaptionLabel.qml b/prototype_2016/third_party/fluid/controls/+material/CaptionLabel.qml
new file mode 100644
index 0000000..66d5638
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/CaptionLabel.qml
@@ -0,0 +1,20 @@
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.4
16import QtQuick.Controls 2.0
17
18Label {
19 font.pixelSize: 12
20}
diff --git a/prototype_2016/third_party/fluid/controls/+material/DialogLabel.qml b/prototype_2016/third_party/fluid/controls/+material/DialogLabel.qml
new file mode 100644
index 0000000..4230d4c
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/DialogLabel.qml
@@ -0,0 +1,23 @@
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 as FluidCore
19
20Label {
21 font.pixelSize: FluidCore.Device.isMobile ? 18 : 17
22 color: Material.secondaryTextColor
23}
diff --git a/prototype_2016/third_party/fluid/controls/+material/DisplayLabel.qml b/prototype_2016/third_party/fluid/controls/+material/DisplayLabel.qml
new file mode 100644
index 0000000..67b9e4b
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/DisplayLabel.qml
@@ -0,0 +1,48 @@
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.4
16import QtQuick.Controls 2.0
17import Fluid.Core 1.0
18
19Label {
20 property int level: 1
21
22 font.pixelSize: {
23 if (level <= 1)
24 return 34
25 else if (level == 2)
26 return 45
27 else if (level == 3)
28 return 56
29 return 112
30 }
31 lineHeight: {
32 if (level <= 1)
33 return 40.0
34 else if (level == 2)
35 return 48.0
36 return 1.0
37 }
38 lineHeightMode: {
39 if (level <= 2)
40 return Text.FixedHeight
41 return Text.ProportionalHeight
42 }
43 font.weight: level >= 4 ? Font.Light : Font.Normal
44 onLevelChanged: {
45 if (level < 1 || level > 4)
46 console.error("DisplayLabel level must be between 1 and 4")
47 }
48}
diff --git a/prototype_2016/third_party/fluid/controls/+material/HeadlineLabel.qml b/prototype_2016/third_party/fluid/controls/+material/HeadlineLabel.qml
new file mode 100644
index 0000000..b001aa9
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/HeadlineLabel.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.4
16import QtQuick.Controls 2.0
17
18Label {
19 font.pixelSize: 24
20 lineHeight: 32.0
21 lineHeightMode: Text.FixedHeight
22}
diff --git a/prototype_2016/third_party/fluid/controls/+material/SubheadingLabel.qml b/prototype_2016/third_party/fluid/controls/+material/SubheadingLabel.qml
new file mode 100644
index 0000000..d7f23bf
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/SubheadingLabel.qml
@@ -0,0 +1,29 @@
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.4
16import QtQuick.Controls 2.0
17import Fluid.Core 1.0
18
19Label {
20 property int level: 1
21
22 font.pixelSize: Device.isMobile ? 16 : 15
23 lineHeight: level <= 1 ? 24.0 : 28.0
24 lineHeightMode: Text.FixedHeight
25 onLevelChanged: {
26 if (level < 1 || level > 2)
27 console.error("SubheadingLabel level must be either 1 or 2 with the Material style")
28 }
29}
diff --git a/prototype_2016/third_party/fluid/controls/+material/ThinDivider.qml b/prototype_2016/third_party/fluid/controls/+material/ThinDivider.qml
new file mode 100644
index 0000000..0b69ef5
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/ThinDivider.qml
@@ -0,0 +1,22 @@
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 2.4
16import QtQuick.Controls.Material 2.0
17
18Rectangle {
19 color: Material.dividerColor
20 width: parent.width
21 height: 1
22}
diff --git a/prototype_2016/third_party/fluid/controls/+material/TitleLabel.qml b/prototype_2016/third_party/fluid/controls/+material/TitleLabel.qml
new file mode 100644
index 0000000..486abff
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/+material/TitleLabel.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.4
16import QtQuick.Controls 2.0
17
18Label {
19 font.pixelSize: 20
20 font.weight: Font.Medium
21}
diff --git a/prototype_2016/third_party/qml-material/src/controls/Action.qml b/prototype_2016/third_party/fluid/controls/Action.qml
index a8ad35b..582b945 100644
--- a/prototype_2016/third_party/qml-material/src/controls/Action.qml
+++ b/prototype_2016/third_party/fluid/controls/Action.qml
@@ -1,32 +1,40 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> 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$
5 * 8 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 9 * 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 10 * 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/. 11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
9 */ 14 */
10 15
11import QtQuick 2.4 16import QtQuick 2.5
12import QtQuick.Controls 1.3 as Controls 17import Fluid.Core 1.0
18
13/*! 19/*!
14 \qmltype Action 20 \qmltype Action
15 \inqmlmodule Material 21 \inqmlmodule Fluid.Controls
22 \ingroup fluidcontrols
16 23
17 \brief Represents an action shown in an action bar, context menu, or list. 24 \brief Represents an action shown in an action bar, context menu, or list.
18 25
19 One of the most common uses of actions is displaying actions in the action bar of a page 26 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. 27 using the \l Page::actions property. See the example for \l Page for more details.
21 */ 28 */
22Controls.Action { 29Object {
23 id: action 30 id: action
24 31
25 /*! 32 /*!
26 Set to \c true to display a divider between this action and the next action. Used in lists 33 Set to \c false to disable the action in the UI.
27 or context menus.
28 */ 34 */
29 property bool hasDividerAfter 35 property bool enabled: true
36
37 property string iconName
30 38
31 /*! 39 /*!
32 A URL pointing to an image to display as the icon. By default, this is 40 A URL pointing to an image to display as the icon. By default, this is
@@ -37,30 +45,35 @@ Controls.Action {
37 \sa iconName 45 \sa iconName
38 \sa Icon 46 \sa Icon
39 */ 47 */
40 property string iconSource: "icon://" + iconName 48 property url iconSource: Utils.getSourceForIconName(iconName)
49
50 /*!
51 \qmlproperty keysequence shortcut
52
53 This property holds the shortcut bound to the action.
54 The keysequence can be a string or a standard key.
55 */
56 property alias shortcut: shortcutItem.sequence
41 57
42 /*! 58 /*!
43 The text displayed for the action. 59 The text displayed for the action.
44 */ 60 */
45 property string name 61 property string text
46 62
47 /*! 63 /*!
48 A short summary of the action, which may be displayed depending on the UI showing the 64 The tooltip displayed for the action.
49 action. For example, a list of actions could display the summary as the secondary line of
50 text.
51 */ 65 */
52 property string summary 66 property string tooltip
53 67
54 /*! 68 /*!
55 Set to \c false to hide the action in the UI. 69 Set to \c false to hide the action in the UI.
56 */ 70 */
57 property bool visible: true 71 property bool visible: true
58 72
59 /*! 73 signal triggered(var source)
60 Set to \c true to rotate the icon 90 degrees on mouseover.
61 */
62 property bool hoverAnimation: false
63 74
64 property alias text: action.name 75 Shortcut {
65 property alias tooltip: action.summary 76 id: shortcutItem
77 onActivated: action.triggered(shortcutItem)
78 }
66} 79}
diff --git a/prototype_2016/third_party/fluid/controls/AppBar.qml b/prototype_2016/third_party/fluid/controls/AppBar.qml
new file mode 100644
index 0000000..822b258
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/AppBar.qml
@@ -0,0 +1,194 @@
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 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 Fluid.Material 1.0 as FluidMaterial
22
23/*!
24 \qmltype AppBar
25 \inqmlmodule Fluid.Controls
26 \ingroup fluidcontrols
27
28 \brief Application tool bar.
29 */
30ToolBar {
31 id: appBar
32
33 Material.elevation: toolbar && !tabBar.visible ? 0 : elevation
34 Material.theme: toolbar ? toolbar.Material.theme : Material.Light
35
36 /*!
37 The back action to display to the left of the title in the action bar.
38 When used with a page, this will pick up the page's back action, which
39 by default is a back arrow when there is a page behind the current page
40 on the page stack. However, you can customize this, for example, to show
41 a navigation drawer at the root of your app.
42
43 When using an action bar in a page, set the \l Page::backAction instead of
44 directly setting this property.
45 */
46 property Action leftAction
47
48 /*!
49 A list of actions to show in the action bar. These actions will be shown
50 anchored to the right, and will overflow if there are more than the
51 maximum number of actions as defined in \l maxActionCount.
52
53 When used with a page, the actions will be set to the page's \l Page::actions
54 property, so set that instead of changing this directly.
55 */
56 property list<Action> actions
57
58 /*!
59 The elevation of the action bar. Set to 0 if you want have a header or some
60 other view below the action bar that you want to appear as part of the action bar.
61 */
62 property int elevation: 2
63
64 /*!
65 \internal
66 The size of the left icon and the action icons.
67 */
68 property int iconSize: Device.gridUnit <= 48 ? 20 : 24
69
70 property alias leftKeyline: titleLabel.x
71
72 /*!
73 The maximum number of actions that can be displayed before they spill over
74 into a drop-down menu. When using an action bar with a page, this inherits
75 from the global \l Toolbar::maxActionCount. If you are using an action bar
76 for custom purposes outside of a toolbar, this defaults to \c 3.
77 */
78 property int maxActionCount: toolbar ? toolbar.maxActionCount : 3
79
80 /*!
81 The title displayed in the action bar. When used in a page, the title will
82 be set to the title of the page, so set the \l Page::title property instead
83 of changing this directly.
84 */
85 property alias title: titleLabel.text
86
87 property alias tabs: tabBar.contentData
88
89 property alias currentTabIndex: tabBar.currentIndex
90
91 property AppToolBar toolbar
92
93 implicitHeight: background.implicitHeight
94
95 background: Rectangle {
96 color: appBar.Material.toolBarColor
97 height: implicitHeight
98 implicitHeight: Device.gridUnit + (tabBar.visible ? tabBar.implicitHeight : 0)
99
100 layer.enabled: appBar.Material.elevation > 0
101 layer.effect: FluidMaterial.ElevationEffect {
102 elevation: appBar.Material.elevation
103 fullWidth: true
104 }
105
106 ColumnLayout {
107 anchors.fill: parent
108 spacing: 0
109
110 RowLayout {
111 spacing: 0
112
113 Layout.preferredHeight: Device.gridUnit
114 Layout.fillWidth: true
115
116 IconButton {
117 id: leftButton
118
119 property bool showing: leftAction && leftAction.visible
120 property int margin: (width - 24)/2
121
122 Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
123 Layout.leftMargin: leftButton.showing ? 16 - leftButton.margin : -leftButton.width
124
125 iconSize: appBar.iconSize
126
127 iconSource: leftAction ? leftAction.iconSource : ""
128 visible: leftAction && leftAction.visible
129 enabled: leftAction && leftAction.enabled
130 onClicked: {
131 if (leftAction)
132 leftAction.triggered(leftButton)
133 }
134 }
135
136 TitleLabel {
137 id: titleLabel
138
139 Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
140 Layout.leftMargin: 16 + (leftButton.showing ? Device.gridUnit - leftButton.margin : 0)
141 Layout.rightMargin: 16
142
143 textFormat: Text.PlainText
144 color: Material.primaryTextColor
145 elide: Text.ElideRight
146 }
147
148 Item {
149 Layout.fillWidth: true
150 }
151
152 Row {
153 id: actionsRow
154
155 Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
156 Layout.rightMargin: 16 - leftButton.margin
157 Layout.preferredHeight: Device.gridUnit
158
159 spacing: 24 - 2 * leftButton.margin
160
161 Repeater {
162 model: appBar.actions
163 delegate: IconButton {
164 id: actionButton
165
166 anchors.verticalCenter: parent.verticalCenter
167
168 iconSize: appBar.iconSize
169
170 iconSource: modelData.iconSource
171 visible: modelData.visible
172 enabled: modelData.enabled
173 onClicked: modelData.triggered(actionButton)
174 }
175 }
176 }
177 }
178
179 TabBar {
180 id: tabBar
181
182 property bool fixed: true
183 property bool centered: false
184
185 Material.accent: appBar.Material.foreground
186
187 Layout.alignment: centered ? Qt.AlignHCenter : Qt.AlignLeft
188 Layout.leftMargin: centered ? 0 : leftKeyline - 12
189
190 visible: count > 0
191 }
192 }
193 }
194}
diff --git a/prototype_2016/third_party/fluid/controls/AppToolBar.qml b/prototype_2016/third_party/fluid/controls/AppToolBar.qml
new file mode 100644
index 0000000..1f81816
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/AppToolBar.qml
@@ -0,0 +1,62 @@
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 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import Fluid.Core 1.0
19
20/*!
21 \qmltype AppToolBar
22 \inqmlmodule Fluid.Controls
23 \ingroup fluidcontrols
24
25 \brief Application tool bar.
26 */
27ToolBar {
28 id: toolbar
29
30 Material.elevation: page ? page.appBar.elevation : 2
31 Material.background: Material.primaryColor
32 Material.theme: Utils.lightDark(Material.background, Material.Light, Material.Dark)
33
34 property Page page
35 property int maxActionCount: 3
36
37 function pop(page) {
38 stack.pop(page.appBar)
39
40 toolbar.page = page
41 }
42
43 function push(page) {
44 stack.push(page.appBar)
45
46 page.appBar.toolbar = toolbar
47 toolbar.page = page
48 }
49
50 function replace(page) {
51 toolbar.page = page
52
53 stack.replace(page.appBar)
54 }
55
56 StackView {
57 id: stack
58
59 width: parent.width
60 height: parent.height
61 }
62}
diff --git a/prototype_2016/third_party/fluid/controls/BaseListItem.qml b/prototype_2016/third_party/fluid/controls/BaseListItem.qml
new file mode 100644
index 0000000..3a4d989
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/BaseListItem.qml
@@ -0,0 +1,43 @@
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 2.4
16import QtQuick.Controls 2.0
17
18/*!
19 \qmltype BaseListItem
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief The base class for list items.
24
25 Provides ripple effects, mouse/touch handling and tinting on mouse hover.
26 */
27ListItemDelegate {
28 id: listItem
29
30 background: Rectangle {
31 color: listItem.interactive && (listItem.highlighted || listItem.down)
32 ? Qt.rgba(0,0,0,0.05) : Qt.rgba(0,0,0,0)
33
34 ThinDivider {
35 x: dividerInset
36 y: parent.height - height
37
38 width: parent.width - x
39
40 visible: showDivider
41 }
42 }
43}
diff --git a/prototype_2016/third_party/fluid/controls/BodyLabel.qml b/prototype_2016/third_party/fluid/controls/BodyLabel.qml
new file mode 100644
index 0000000..ff63cec
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/BodyLabel.qml
@@ -0,0 +1,51 @@
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.Templates 2.0 as T
17
18/*!
19 \qmltype BodyLabel
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Text label with standard font and styling suitable to body text.
24
25 \code
26 BodyLabel {
27 text: qsTr("Body text")
28 }
29 \endcode
30*/
31T.Label {
32 /*!
33 \qmlproperty int level
34
35 This property holds the label level that controls
36 font style and size.
37
38 It can be either 1 or 2.
39
40 Default value is 1.
41 */
42 property int level: 1
43
44 font.pixelSize: 14
45 color: "#26282a"
46 linkColor: "#45a7d7"
47 onLevelChanged: {
48 if (level < 1 || level > 2)
49 console.error("BodyLabel level must be either 1 or 2")
50 }
51}
diff --git a/prototype_2016/third_party/fluid/controls/CMakeLists.txt b/prototype_2016/third_party/fluid/controls/CMakeLists.txt
new file mode 100644
index 0000000..0c190ab
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/CMakeLists.txt
@@ -0,0 +1,67 @@
1set(SOURCES
2 iconthemeimageprovider.cpp
3 plugin.cpp
4)
5
6set(QML_FILES
7 plugins.qmltypes
8 qmldir
9 Action.qml
10 AppBar.qml
11 AppToolBar.qml
12 BaseListItem.qml
13 BodyLabel.qml
14 CaptionLabel.qml
15 Card.qml
16 CircleImage.qml
17 Dialog.qml
18 DialogLabel.qml
19 DisplayLabel.qml
20 FluidStyle.qml
21 FluidWindow.qml
22 HeadlineLabel.qml
23 IconButton.qml
24 Icon.qml
25 InfoBar.qml
26 ListItemDelegate.qml
27 ListItem.qml
28 Loadable.qml
29 NavigationDrawer.qml
30 NoiseBackground.qml
31 Page.qml
32 PageStack.qml
33 Placeholder.qml
34 Showable.qml
35 Sidebar.qml
36 SmoothFadeImage.qml
37 SmoothFadeLoader.qml
38 Subheader.qml
39 SubheadingLabel.qml
40 Tab.qml
41 TabbedPage.qml
42 ThinDivider.qml
43 TitleLabel.qml
44 Units.qml
45)
46
47set(MATERIAL_FILES
48 +material/BaseListItem.qml
49 +material/BodyLabel.qml
50 +material/CaptionLabel.qml
51 +material/DialogLabel.qml
52 +material/DisplayLabel.qml
53 +material/HeadlineLabel.qml
54 +material/SubheadingLabel.qml
55 +material/ThinDivider.qml
56 +material/TitleLabel.qml
57)
58
59add_library(fluidcontrols SHARED ${SOURCES} ${QML_FILES} ${MATERIAL_FILES})
60target_link_libraries(fluidcontrols Qt5::Gui Qt5::Quick)
61
62install(TARGETS fluidcontrols LIBRARY
63 DESTINATION ${QML_INSTALL_DIR}/Fluid/Controls)
64install(FILES ${QML_FILES}
65 DESTINATION ${QML_INSTALL_DIR}/Fluid/Controls)
66install(FILES ${MATERIAL_FILES}
67 DESTINATION ${QML_INSTALL_DIR}/Fluid/Controls/+material)
diff --git a/prototype_2016/third_party/fluid/controls/CaptionLabel.qml b/prototype_2016/third_party/fluid/controls/CaptionLabel.qml
new file mode 100644
index 0000000..b62f1c2
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/CaptionLabel.qml
@@ -0,0 +1,35 @@
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.Templates 2.0 as T
17
18/*!
19 \qmltype CaptionLabel
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Text label with standard font and styling suitable to captions.
24
25 \code
26 Caption {
27 text: qsTr("A translatable caption")
28 }
29 \endcode
30*/
31T.Label {
32 font.pixelSize: 10
33 color: "#26282a"
34 linkColor: "#45a7d7"
35}
diff --git a/prototype_2016/third_party/fluid/controls/Card.qml b/prototype_2016/third_party/fluid/controls/Card.qml
new file mode 100644
index 0000000..4b4f666
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Card.qml
@@ -0,0 +1,88 @@
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.Controls 2.0 as C
16import QtQuick.Controls.Material 2.0
17
18/*!
19 \qmltype Card
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Cards display content composed of different elements.
24
25 \code
26 Card {
27 anchors.centerIn: parent
28 width: 400
29 height: 400
30
31 Image {
32 id: picture
33 anchors {
34 left: parent.left
35 top: parent.top
36 right: parent.right
37 }
38 height: 200
39 source: "Yosemite.jpg"
40 }
41
42 Column {
43 id: column
44 anchors {
45 left: parent.left
46 top: picture.bottom
47 right: parent.right
48 margins: Units.smallSpacing * 2
49 }
50 spacing: Units.smallSpacing * 2
51
52 TitleLabel {
53 text: qsTr("Yosemite National Park")
54 }
55
56 BodyLabel {
57 text: qsTr("First protected in 1864, Yosemite National Park " +
58 "is best known for its waterfalls, but within its " +
59 "nearly 1,200 square miles, you can find deep " +
60 "valleys, grand meadows, ancient giant sequoias, " +
61 "a vast wilderness area, and much more.")
62 wrapMode: Text.WordWrap
63 width: parent.width
64 }
65
66 Row {
67 spacing: Units.smallSpacing
68
69 Button {
70 text: qsTr("Share")
71 flat: true
72 }
73
74 Button {
75 text: qsTr("Explore")
76 flat: true
77 }
78 }
79 }
80 }
81 \endcode
82*/
83C.Pane {
84 padding: 0
85
86 Material.background: "white"
87 Material.elevation: 1
88}
diff --git a/prototype_2016/third_party/qml-material/src/extras/CircleImage.qml b/prototype_2016/third_party/fluid/controls/CircleImage.qml
index 777f412..c846109 100644
--- a/prototype_2016/third_party/qml-material/src/extras/CircleImage.qml
+++ b/prototype_2016/third_party/fluid/controls/CircleImage.qml
@@ -1,23 +1,33 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> 4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
5 * 7 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 8 * 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 9 * 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/. 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
9 */ 13 */
10 14
11import QtQuick 2.4 15import QtQuick 2.4
12import Material.Extras 0.1 as Extras
13import QtGraphicalEffects 1.0 16import QtGraphicalEffects 1.0
17import Fluid.Effects 1.0
18
19/*!
20 \qmltype CircleImage
21 \inqmlmodule Fluid.Controls
22 \ingroup fluidcontrols
14 23
24 \brief Circular image.
25*/
15Item { 26Item {
16 id: item 27 id: item
17 28
18 property alias source: image.source 29 property alias source: image.source
19 property alias status: image.status 30 property alias status: image.status
20 property alias averageColor: image.averageColor
21 property alias sourceSize: image.sourceSize 31 property alias sourceSize: image.sourceSize
22 property alias asynchronous: image.asynchronous 32 property alias asynchronous: image.asynchronous
23 property alias cache: image.cache 33 property alias cache: image.cache
@@ -26,12 +36,10 @@ Item {
26 width: image.implicitWidth 36 width: image.implicitWidth
27 height: image.implicitHeight 37 height: image.implicitHeight
28 38
29 Extras.Image { 39 Image {
30 id: image 40 id: image
31 anchors.fill: parent 41 anchors.fill: parent
32 smooth: true
33 visible: false 42 visible: false
34 mipmap: true
35 } 43 }
36 44
37 CircleMask { 45 CircleMask {
diff --git a/prototype_2016/third_party/fluid/controls/Dialog.qml b/prototype_2016/third_party/fluid/controls/Dialog.qml
new file mode 100644
index 0000000..b9d1b77
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Dialog.qml
@@ -0,0 +1,169 @@
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.Controls.Material 2.0
19import QtQuick.Layouts 1.0
20import Fluid.Core 1.0
21import Fluid.Controls 1.0
22
23/*!
24 \qmltype Dialog
25 \inqmlmodule Fluid.Controls
26 \ingroup fluidcontrols
27
28 \brief Dialog.
29*/
30Popup {
31 property alias title: titleLabel.text
32 property alias text: textLabel.text
33
34 property alias positiveButton: positiveButton
35 property alias negativeButton: negativeButton
36
37 property string positiveButtonText: qsTr("Ok")
38 property string negativeButtonText: qsTr("Cancel")
39
40 default property alias dialogContent: dialogContentItem.data
41
42 property bool __triggered
43
44 padding: 0
45 modal: true
46 focus: true
47
48 x: (parent.width - width)/2
49 y: (parent.height - height)/2
50
51 signal accepted
52 signal rejected
53 signal canceled
54
55 onOpened: __triggered = false
56
57 onAccepted: {
58 __triggered = true
59 close()
60 }
61
62 onRejected: {
63 __triggered = true
64 close()
65 }
66
67 onClosed: {
68 if (!__triggered)
69 canceled()
70 }
71
72 ColumnLayout {
73 width: parent.width
74 spacing: 0
75
76 Rectangle {
77 Layout.fillWidth: true
78 Layout.preferredWidth: column.implicitWidth + 48
79 Layout.preferredHeight: column.implicitHeight + 48
80 Layout.minimumWidth: Device.isMobile ? 280 : 300
81
82 ColumnLayout {
83 id: column
84
85 anchors.centerIn: parent
86 spacing: 0
87
88 width: parent.width - 48
89
90 TitleLabel {
91 id: titleLabel
92
93 Layout.fillWidth: true
94
95 wrapMode: Text.Wrap
96 visible: title != ""
97 }
98
99 Item {
100 Layout.fillWidth: true
101 Layout.preferredHeight: 20
102 visible: titleLabel.visible && textLabel.visible
103 }
104
105 Label {
106 id: textLabel
107
108 Layout.fillWidth: true
109
110 font: FluidStyle.dialogFont
111 wrapMode: Text.Wrap
112 color: Material.secondaryTextColor
113 visible: text != ""
114 }
115
116 Item {
117 Layout.fillWidth: true
118 Layout.preferredHeight: 20
119 visible: textLabel.visible
120 }
121
122 Item {
123 id: dialogContentItem
124 Layout.fillWidth: true
125 Layout.preferredHeight: childrenRect.height
126 }
127 }
128 }
129
130 RowLayout {
131 Layout.alignment: Qt.AlignRight
132 Layout.preferredHeight: 52
133
134 spacing: 0
135
136 Button {
137 id: negativeButton
138
139 Layout.alignment: Qt.AlignVCenter
140 Material.foreground: Material.primaryColor
141
142 text: negativeButtonText
143 flat: true
144
145 onClicked: rejected()
146 }
147
148 Item {
149 Layout.preferredWidth: 8
150 }
151
152 Button {
153 id: positiveButton
154
155 Layout.alignment: Qt.AlignVCenter
156 Material.foreground: Material.primaryColor
157
158 text: positiveButtonText
159 flat: true
160
161 onClicked: accepted()
162 }
163
164 Item {
165 Layout.preferredWidth: 8
166 }
167 }
168 }
169}
diff --git a/prototype_2016/third_party/fluid/controls/DialogLabel.qml b/prototype_2016/third_party/fluid/controls/DialogLabel.qml
new file mode 100644
index 0000000..2777027
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/DialogLabel.qml
@@ -0,0 +1,38 @@
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.Templates 2.0 as T
17
18/*!
19 \qmltype DialogLabel
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Text label with standard font and styling suitable to message box text.
24
25 \code
26 import QtQuick 2.0
27 import Fluid.Controls 1.0 as FluidControls
28
29 FluidControls.DialogLabel {
30 text: "Text to display"
31 }
32 \endcode
33*/
34T.Label {
35 font.pixelSize: 18
36 color: "#909090"
37 linkColor: "#45a7d7"
38}
diff --git a/prototype_2016/third_party/fluid/controls/DisplayLabel.qml b/prototype_2016/third_party/fluid/controls/DisplayLabel.qml
new file mode 100644
index 0000000..8f27f05
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/DisplayLabel.qml
@@ -0,0 +1,59 @@
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.Templates 2.0 as T
17
18/*!
19 \qmltype DisplayLabel
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Text label with standard font and styling suitable to display text.
24
25 \code
26 DisplayLabel {
27 text: qsTr("Display text")
28 }
29 \endcode
30*/
31T.Label {
32 /*!
33 \qmlproperty int level
34
35 This property holds the label level that controls
36 font style and size.
37
38 Only values between 1 and 4 are allowed.
39
40 Default value is 1.
41 */
42 property int level: 1
43
44 font.pixelSize: {
45 if (level <= 1)
46 return 30
47 else if (level == 2)
48 return 40
49 else if (level == 3)
50 return 50
51 return 100
52 }
53 color: "#26282a"
54 linkColor: "#45a7d7"
55 onLevelChanged: {
56 if (level < 1 || level > 4)
57 console.error("DisplayLabel level must be between 1 and 4")
58 }
59}
diff --git a/prototype_2016/third_party/fluid/controls/FluidStyle.qml b/prototype_2016/third_party/fluid/controls/FluidStyle.qml
new file mode 100644
index 0000000..4d3afea
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/FluidStyle.qml
@@ -0,0 +1,68 @@
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 2.0
16import Fluid.Core 1.0
17
18pragma Singleton
19
20/*!
21 \qmltype FluidStyle
22 \inqmlmodule Fluid.Controls
23 \ingroup fluidcontrols
24
25 \brief Style.
26*/
27QtObject {
28 id: fluidStyle
29
30 readonly property color iconColorLight: Qt.rgba(0,0,0,0.54)
31 readonly property color iconColorDark: Qt.rgba(1,1,1)
32
33 readonly property font display4Font: Qt.font({ family: "Roboto", weight: Font.Light,
34 pixelSize: 112 })
35
36 readonly property font display3Font: Qt.font({ family: "Roboto", pixelSize: 56 })
37
38 readonly property font display2Font: Qt.font({ family: "Roboto", pixelSize: 45 })
39
40 readonly property font display1Font: Qt.font({ family: "Roboto", pixelSize: 34 })
41
42 readonly property font headlineFont: Qt.font({ family: "Roboto", pixelSize: 24 })
43
44 readonly property font titleFont: Qt.font({ family: "Roboto", weight: Font.DemiBold,
45 pixelSize: 20 })
46
47 readonly property font subheadingFont: Qt.font({ family: "Roboto",
48 pixelSize: Device.isMobile ? 16 : 15 })
49
50 readonly property font body2Font: Qt.font({ family: "Roboto", weight: Font.DemiBold,
51 pixelSize: Device.isMobile ? 14 : 13 })
52
53 readonly property font body1Font: Qt.font({ family: "Roboto",
54 pixelSize: Device.isMobile ? 14 : 13 })
55
56 readonly property font captionFont: Qt.font({ family: "Roboto", pixelSize: 12 })
57
58 readonly property font buttonFont: Qt.font({ family: "Roboto", weight: Font.DemiBold,
59 pixelSize: 14, capitalization: Font.AllUppercase })
60
61 /* Control fonts that don't fit into the standard font styles */
62
63 readonly property font subheaderFont: Qt.font({ family: "Roboto", weight: Font.DemiBold,
64 pixelSize: 14 })
65
66 readonly property font dialogFont: Qt.font({ family: "Roboto",
67 pixelSize: Device.isMobile ? 18 : 17 })
68}
diff --git a/prototype_2016/third_party/fluid/controls/FluidWindow.qml b/prototype_2016/third_party/fluid/controls/FluidWindow.qml
new file mode 100644
index 0000000..e7b0b67
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/FluidWindow.qml
@@ -0,0 +1,101 @@
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 2.4
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import Fluid.Core 1.0
19import Fluid.Controls 1.0 as FluidControls
20
21/*!
22 \qmltype FluidWindow
23 \inqmlmodule Fluid.Controls
24 \ingroup fluidcontrols
25
26 \brief A window that provides features commonly used for Material Design apps.
27
28 This is normally what you should use as your root component. It provides a \l Toolbar and
29 \l PageStack to provide access to standard features used by Material Design applications.
30
31 Here is a short working example of an application:
32
33 \qml
34 import QtQuick 2.4
35 import Fluid.Controls 1.0 as FluidControls
36
37 FluidControls.ApplicationWindow {
38 title: "Application Name"
39
40 initialPage: page
41
42 Page {
43 id: page
44 title: "Page Title"
45
46 Label {
47 anchors.centerIn: parent
48 text: "Hello World!"
49 }
50 }
51 }
52 \endqml
53*/
54ApplicationWindow {
55 id: window
56
57 /*!
58 \qmlproperty color decorationColor
59
60 The color of the status bar or window decorations, if the current
61 platform supports it.
62 */
63 property alias decorationColor: platformExtensions.decorationColor
64
65 property alias appBar: appBar
66
67 /*!
68 \qmlproperty Page initialPage
69
70 The initial page shown when the application starts.
71 */
72 property alias initialPage: pageStack.initialItem
73
74 /*!
75 \qmlproperty PageStack pageStack
76
77 The \l PageStack used for controlling pages and transitions between pages.
78 */
79 property alias pageStack: pageStack
80
81 header: FluidControls.AppToolBar {
82 id: appBar
83 }
84
85 FluidControls.PageStack {
86 id: pageStack
87
88 width: parent.width
89 height: parent.height
90
91 onPushed: appBar.push(page)
92 onPopped: appBar.pop(page)
93 onReplaced: appBar.replace(page)
94 }
95
96 PlatformExtensions {
97 id: platformExtensions
98 window: window
99 decorationColor: Material.shade(window.Material.primaryColor, Material.Shade700)
100 }
101}
diff --git a/prototype_2016/third_party/fluid/controls/HeadlineLabel.qml b/prototype_2016/third_party/fluid/controls/HeadlineLabel.qml
new file mode 100644
index 0000000..93d2bf6
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/HeadlineLabel.qml
@@ -0,0 +1,35 @@
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.Templates 2.0 as T
17
18/*!
19 \qmltype HeadlineLabel
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Text label with standard font and styling suitable to headlines.
24
25 \code
26 HeadlineLabel {
27 text: qsTr("A translatable headline")
28 }
29 \endcode
30*/
31T.Label {
32 font.pixelSize: 22
33 color: "#26282a"
34 linkColor: "#45a7d7"
35}
diff --git a/prototype_2016/third_party/fluid/controls/Icon.qml b/prototype_2016/third_party/fluid/controls/Icon.qml
new file mode 100644
index 0000000..3f0d4c5
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Icon.qml
@@ -0,0 +1,173 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 * Copyright (C) 2015 Bogdan Cuza <bogdan.cuza@hotmail.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.4
17import QtQuick.Window 2.2
18import QtGraphicalEffects 1.0
19import QtQuick.Controls.Material 2.0
20import Fluid.Core 1.0
21import Fluid.Controls 1.0
22
23/*!
24 \qmltype Icon
25 \inqmlmodule Fluid.Controls
26 \ingroup fluidcontrols
27
28 \brief Displays an icon from the Material Design icon collection, the platform's icon theme,
29 or another (local or remote) location.
30
31 To use an icon from the \l{}{Material Design icon collection}, set the \c name property to the name of the icon in its group in the form of \c group/icon_name. For example:
32 \code
33 Icon {
34 name: "action/settings"
35 }
36 \endcode
37
38 This icon will by default use the light icon color from Material Design. To use the dark icon
39 color:
40 \code
41 Icon {
42 Material.theme: Material.Dark
43
44 name: "action/settings"
45 }
46 \endcode
47
48 In addition to using icons from Material Design, you can also use icons from the platform's
49 \l{http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html}{Freedesktop icon theme}. For example:
50
51 \code
52 Icon {
53 name: "gimp"
54 }
55 \endcode
56
57 By default, icons from the Freedesktop icon theme are not colorized unless they include the word "symbolic" in the icon name. For example, "gimp" would be full-colored by "edit-cut-symbolic" would be colored using the set \c color property (based off of \c Material.theme). If you need to colorize an icon manually, you can do so like this:
58
59 \code
60 Icon {
61 name: "gimp"
62 colorize: true
63 }
64 \endcode
65
66 You can also use custom icons like this:
67 \code
68 Icon {
69 source: Qt.resolvedUrl("icons/fun_icon.png")
70 }
71 \endcode
72 */
73Item {
74 id: icon
75
76 /*!
77 The color of the icon. Defaults to \c FluidStyle.iconColorLight. For dark backgrounds,
78 set \c Material.theme to Material.Dark or set this to \c FluidStyle.iconColorDark.
79 */
80 property color color: Material.theme == Material.Light ? FluidStyle.iconColorLight
81 : FluidStyle.iconColorDark
82
83 /*!
84 The size of the icon. Defaults to 24px.
85 */
86 property real size: 24
87
88 /*!
89 The name of the icon to display.
90
91 \sa source
92 */
93 property string name
94
95 /*!
96 \brief A URL pointing to an image to display as the icon.
97
98 By default, this is a special URL representing the icon named by \ref name from the Material
99 Design icon collection when using the form of "collection/icon_name", or in the case of a
100 single "icon_name", the platform's Freedesktop icon theme will be used.
101
102 By default, icons from the Material Design icons collection will be treated as symbolic icons and colored using the specified \ref color, while icons from the Freedesktop icon theme will
103 not be colorized. To override this, or set the behavior for your own custom icons, use
104 \ref colorize.
105
106 \sa name
107 */
108 property url source: Utils.getSourceForIconName(name)
109
110 /*!
111 \qmlproperty enumeration status
112 \list
113 \li Image.Null - no image has been set
114 \li Image.Ready - the image has been loaded
115 \li Image.Loading - the image is currently being loaded
116 \li Image.Error - an error occurred while loading the image
117 \endlist
118 */
119 property alias status: image.status
120
121 /*!
122 Specifies whether the image should be cached.
123 The default value is true.
124
125 Setting cache to false is useful when dealing with large images,
126 to make sure that they aren't cached at the expense of small
127 'ui element' images.
128 */
129 property alias cache: image.cache
130
131 /*!
132 \c true if the icon is valid and fully loaded.
133 */
134 readonly property bool valid: status == Image.Ready
135
136 /*!
137 Set to \c false if you want the icon to use the original image's colors and not be
138 colored using the specified \ref color.
139 */
140 property bool colorize: (String(icon.source).indexOf(".color.") === -1 &&
141 String(icon.source).indexOf("image://fluidicontheme/") === -1) ||
142 String(icon.source).indexOf("symbolic") !== -1
143
144 readonly property real sourceSize: String(icon.source).indexOf("image://fluidicontheme/") === 0 ? Units.roundToIconSize(size) : size
145
146 width: size
147 height: size
148
149 Image {
150 id: image
151
152 anchors.fill: parent
153 visible: !colorize
154
155 source: icon.source
156
157 sourceSize {
158 width: icon.sourceSize * Screen.devicePixelRatio
159 height: icon.sourceSize * Screen.devicePixelRatio
160 }
161 }
162
163 ColorOverlay {
164 id: overlay
165
166 anchors.fill: parent
167 source: image
168 color: Utils.alpha(icon.color, 1)
169 cached: true
170 visible: icon.valid && colorize
171 opacity: icon.color.a
172 }
173}
diff --git a/prototype_2016/third_party/fluid/controls/IconButton.qml b/prototype_2016/third_party/fluid/controls/IconButton.qml
new file mode 100644
index 0000000..7b74d53
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/IconButton.qml
@@ -0,0 +1,39 @@
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 2.0
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18
19/*!
20 \qmltype IconButton
21 \inqmlmodule Fluid.Controls
22 \ingroup fluidcontrols
23
24 \brief Tool button with an \l Icon.
25*/
26ToolButton {
27 id: iconButton
28
29 property alias iconName: icon.name
30 property alias iconSource: icon.source
31 property alias iconSize: icon.size
32 property alias iconColor: icon.color
33
34 indicator: Icon {
35 id: icon
36
37 anchors.centerIn: parent
38 }
39}
diff --git a/prototype_2016/third_party/fluid/controls/InfoBar.qml b/prototype_2016/third_party/fluid/controls/InfoBar.qml
new file mode 100644
index 0000000..27fbfcb
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/InfoBar.qml
@@ -0,0 +1,149 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com>
6 * Copyright (C) 2014 Bogdan Cuza <bogdan.cuza@hotmail.com>
7 *
8 * $BEGIN_LICENSE:MPL2$
9 *
10 * This Source Code Form is subject to the terms of the Mozilla Public
11 * License, v. 2.0. If a copy of the MPL was not distributed with this
12 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 *
14 * $END_LICENSE$
15 */
16
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
19import QtQuick.Controls 2.0
20import QtQuick.Controls.Material 2.0
21import Fluid.Core 1.0
22
23/*!
24 \qmltype InfoBar
25 \inqmlmodule Fluid.Controls
26 \ingroup fluidcontrols
27
28 \brief InfoBar provide lightweight feedback about an operation.
29
30 \code
31 Page {
32 title: qsTr("Send a message")
33
34 Button {
35 anchors.centerIn: parent
36 text: qsTr("Send Message")
37 onClicked: infoBar.open(qsTr("Message sent"))
38 }
39
40 InfoBar {
41 id: infoBar
42 }
43 }
44 \endcode
45*/
46Rectangle {
47 id: infoBar
48
49 property string buttonText
50 property color buttonColor: Material.accentColor
51 property string text
52 property bool opened
53 property int duration: 2000
54 property bool fullWidth: Device.type === Device.phone || Device.type === Device.phablet
55
56 signal clicked
57
58 function open(text) {
59 infoBar.text = text
60 opened = true
61 timer.restart()
62 }
63
64 anchors {
65 left: fullWidth ? parent.left : undefined
66 right: fullWidth ? parent.right : undefined
67 bottom: parent.bottom
68 bottomMargin: opened ? 0 : -infoBar.height
69 horizontalCenter: fullWidth ? undefined : parent.horizontalCenter
70
71 Behavior on bottomMargin {
72 NumberAnimation { duration: 300 }
73 }
74 }
75 radius: fullWidth ? 0 : 2
76 color: "#323232"
77 height: snackLayout.height
78 width: fullWidth ? undefined : snackLayout.width
79 opacity: opened ? 1 : 0
80
81 Timer {
82 id: timer
83
84 interval: infoBar.duration
85
86 onTriggered: {
87 if (!running)
88 infoBar.opened = false
89 }
90 }
91
92 RowLayout {
93 id: snackLayout
94
95 anchors {
96 verticalCenter: parent.verticalCenter
97 left: infoBar.fullWidth ? parent.left : undefined
98 right: infoBar.fullWidth ? parent.right : undefined
99 }
100
101 spacing: 0
102
103 Item {
104 width: 24
105 }
106
107 Label {
108 id: snackText
109 Layout.fillWidth: true
110 Layout.minimumWidth: infoBar.fullWidth ? -1 : 216 - snackButton.width
111 Layout.maximumWidth: infoBar.fullWidth ? -1 :
112 Math.min(496 - snackButton.width - middleSpacer.width - 48,
113 infoBar.parent.width - snackButton.width - middleSpacer.width - 48)
114
115 Layout.preferredHeight: lineCount == 2 ? 80 : 48
116 verticalAlignment: Text.AlignVCenter
117 maximumLineCount: 2
118 wrapMode: Text.Wrap
119 elide: Text.ElideRight
120 text: infoBar.text
121 color: "white"
122 }
123
124 Item {
125 id: middleSpacer
126 width: infoBar.buttonText == "" ? 0 : infoBar.fullWidth ? 24 : 48
127 }
128
129 Button {
130 id: snackButton
131 visible: infoBar.buttonText != ""
132 text: infoBar.buttonText
133 flat: true
134 width: visible ? implicitWidth : 0
135 font.bold: true
136 onClicked: infoBar.clicked()
137
138 Material.foreground: infoBar.buttonColor
139 }
140
141 Item {
142 width: 24
143 }
144 }
145
146 Behavior on opacity {
147 NumberAnimation { duration: 300 }
148 }
149}
diff --git a/prototype_2016/third_party/fluid/controls/ListItem.qml b/prototype_2016/third_party/fluid/controls/ListItem.qml
new file mode 100644
index 0000000..252e9fd
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/ListItem.qml
@@ -0,0 +1,155 @@
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.4
17import QtQuick.Controls 2.0
18import QtQuick.Controls.Material 2.0
19import QtQuick.Layouts 1.1
20import Fluid.Controls 1.0
21
22/*!
23 \qmltype BaseListItem
24 \inqmlmodule Fluid.Controls
25 \ingroup fluidcontrols
26
27 \brief A standard list item, with one or more lines of text and optional left and right items.
28 */
29BaseListItem {
30 id: listItem
31
32 implicitHeight: Math.max(subText != "" ? maximumLineCount == 2 ? 72 : 88
33 : secondaryItem.showing ? secondaryItem.childrenRect.height + Units.smallSpacing * 2 : 48,
34 leftItem.childrenRect.height + Units.smallSpacing * 2,
35 rightItem.childrenRect.height + Units.smallSpacing * 2)
36
37 dividerInset: leftItem.visible ? listItem.height : 0
38
39 property int maximumLineCount: 2
40
41 property alias subText: subLabel.text
42 property alias valueText: valueLabel.text
43
44 property alias iconName: icon.name
45 property alias iconSource: icon.source
46
47 property alias leftItem: leftItem.children
48 property alias rightItem: rightItem.children
49 property alias secondaryItem: secondaryItem.children
50
51 contentItem: RowLayout {
52 spacing: Units.smallSpacing * 2
53
54 Item {
55 id: leftItem
56 objectName: "leftItem"
57
58 Layout.preferredWidth: showing ? 40 : 0
59 Layout.preferredHeight: width
60 Layout.alignment: Qt.AlignCenter
61
62 property bool showing: visibleChildren.length > 0
63
64 Icon {
65 id: icon
66 objectName: "icon"
67
68 anchors {
69 verticalCenter: parent.verticalCenter
70 left: parent.left
71 }
72
73 visible: icon.valid
74 color: listItem.highlighted ? Material.primaryColor
75 : Material.theme == Material.Light ? FluidStyle.iconColorLight
76 : FluidStyle.iconColorDark
77 }
78 }
79
80 ColumnLayout {
81 Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
82 Layout.fillWidth: true
83
84 spacing: 0
85
86 RowLayout {
87 Layout.fillWidth: true
88
89 visible: label.text != "" || valueLabel.text != ""
90 spacing: Units.smallSpacing
91
92 SubheadingLabel {
93 id: label
94 objectName: "textLabel"
95
96 Layout.alignment: Qt.AlignVCenter
97 Layout.fillWidth: true
98
99 text: listItem.text
100 elide: Text.ElideRight
101 color: listItem.highlighted ? Material.primaryColor
102 : Material.primaryTextColor
103 visible: text != ""
104 }
105
106 BodyLabel {
107 id: valueLabel
108 objectName: "valueLabel"
109
110 Layout.alignment: Qt.AlignVCenter
111 Layout.preferredWidth: visible ? implicitWidth : 0
112
113 color: Material.secondaryTextColor
114 elide: Text.ElideRight
115
116 visible: text != ""
117 }
118 }
119
120 BodyLabel {
121 id: subLabel
122 objectName: "subTextLabel"
123
124 Layout.fillWidth: true
125 Layout.preferredHeight: implicitHeight * maximumLineCount/lineCount
126
127 color: Material.secondaryTextColor
128 elide: Text.ElideRight
129 wrapMode: Text.WordWrap
130
131 visible: text != "" && !contentItem.showing
132 maximumLineCount: listItem.maximumLineCount - 1
133 }
134
135 Item {
136 id: secondaryItem
137 objectName: "secondaryItem"
138
139 Layout.fillWidth: true
140 Layout.preferredHeight: showing ? childrenRect.height + Units.smallSpacing : 0
141
142 property bool showing: visibleChildren.length > 0
143 }
144 }
145
146 Item {
147 id: rightItem
148 objectName: "rightItem"
149 Layout.preferredWidth: showing ? childrenRect.width : 0
150 Layout.preferredHeight: parent.height
151
152 property bool showing: visibleChildren.length > 0
153 }
154 }
155}
diff --git a/prototype_2016/third_party/fluid/controls/ListItemDelegate.qml b/prototype_2016/third_party/fluid/controls/ListItemDelegate.qml
new file mode 100644
index 0000000..576f271
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/ListItemDelegate.qml
@@ -0,0 +1,42 @@
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 2.4
16import QtQuick.Layouts 1.0
17import QtQuick.Controls 2.0
18import Fluid.Material 1.0
19
20/*!
21 \qmltype ListItemDelegate
22 \inqmlmodule Fluid.Controls
23 \ingroup fluidcontrols
24
25 \brief A delegate for list views.
26*/
27ItemDelegate {
28 Layout.fillWidth: true
29
30 property int dividerInset: 0
31 property bool showDivider: false
32 property bool interactive: true
33
34 width: parent ? parent.width : undefined
35
36 leftPadding: 16
37 rightPadding: 16
38 topPadding: 0
39 bottomPadding: 0
40
41 opacity: enabled ? 1 : 0.6
42}
diff --git a/prototype_2016/third_party/fluid/controls/Loadable.qml b/prototype_2016/third_party/fluid/controls/Loadable.qml
new file mode 100644
index 0000000..f1c9176
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Loadable.qml
@@ -0,0 +1,70 @@
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
17/*!
18 \qmltype Loadable
19 \inqmlmodule Fluid.Controls
20 \ingroup fluidcontrols
21
22 \brief Loadable component.
23*/
24Item {
25 property Component component
26 property var showAnimation
27 property var hideAnimation
28 property alias asynchronous: loader.asynchronous
29 property alias item: loader.item
30
31 id: root
32 visible: false
33
34 Loader {
35 id: loader
36 anchors.fill: parent
37 asynchronous: true
38 onStatusChanged: {
39 if (status != Loader.Ready)
40 return;
41 if (item.showAnimation == undefined && root.showAnimation != undefined)
42 item.showAnimation = root.showAnimation;
43 if (item.hideAnimation == undefined && root.hideAnimation != undefined)
44 item.hideAnimation = root.hideAnimation;
45 root.visible = true;
46 if (item.show != undefined)
47 item.show();
48 }
49 }
50
51 Connections {
52 target: loader.item
53 onVisibleChanged: {
54 // Unload component as soon as it's hidden and hide this item as well
55 if (!loader.item.visible) {
56 loader.sourceComponent = undefined;
57 root.visible = false;
58 }
59 }
60 }
61
62 function show() {
63 loader.sourceComponent = root.component;
64 }
65
66 function hide() {
67 if (loader.item && loader.item.hide != undefined)
68 loader.item.hide();
69 }
70}
diff --git a/prototype_2016/third_party/fluid/controls/NavigationDrawer.qml b/prototype_2016/third_party/fluid/controls/NavigationDrawer.qml
new file mode 100644
index 0000000..36d3547
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/NavigationDrawer.qml
@@ -0,0 +1,195 @@
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 QtQml 2.2
19import Fluid.Core 1.0
20import Fluid.Controls 1.0
21
22/*!
23 \qmltype NavigationDrawer
24 \inqmlmodule Fluid.Controls
25 \ingroup fluidcontrols
26
27 \brief The navigation drawer slides in from the left and is a common pattern in apps.
28
29 \code
30 import QtQuick.Window 2.2
31 import Fluid.Controls 2.0 as FluidControls
32
33 Window {
34 id: window
35 width: 400
36 height: 400
37 visible: true
38
39 Button {
40 text: "Open"
41 onClicked: drawer.open()
42 }
43
44 FluidControls.NavigationDrawer {
45 topContent: [
46 Button {
47 text: "Push me"
48 onClicked: console.log("Pushed")
49 }
50 ]
51
52 actions: [
53 Action {
54 text: "Action 1"
55 },
56 Action {
57 text: "Action 1"
58 }
59 ]
60 }
61 }
62 \endcode
63*/
64
65Drawer {
66 id: drawer
67
68 /*!
69 \qmlproperty list<Item> topContent
70
71 The items added to this list will be displayed on top of the
72 actions list.
73
74 \code
75 import QtQuick.Window 2.2
76 import Fluid.Controls 2.0 as FluidControls
77
78 Window {
79 id: window
80 width: 400
81 height: 400
82 visible: true
83
84 Button {
85 text: "Open"
86 onClicked: drawer.open()
87 }
88
89 FluidControls.NavigationDrawer {
90 topContent: [
91 Button {
92 text: "Push me"
93 onClicked: console.log("Pushed")
94 }
95 ]
96 }
97 }
98 \endcode
99 */
100 property alias topContent: topContent.data
101
102 /*!
103 \qmlproperty list<QtObject> actions
104
105 List of actions to be displayed by the drawer.
106
107 \code
108 import QtQuick.Window 2.2
109 import Fluid.Controls 2.0 as FluidControls
110
111 Window {
112 id: window
113 width: 400
114 height: 400
115 visible: true
116
117 Button {
118 text: "Open"
119 onClicked: drawer.open()
120 }
121
122 FluidControls.NavigationDrawer {
123 actions: [
124 Action {
125 text: "Action 1"
126 },
127 Action {
128 text: "Action 1"
129 }
130 ]
131 }
132 }
133 \endcode
134 */
135 property list<QtObject> actions
136
137 width: {
138 switch (Device.formFactor) {
139 case Device.Phone:
140 return 280
141 case Device.Tablet:
142 return 320
143 default:
144 break
145 }
146 return 56 * 4
147 }
148 height: ApplicationWindow.height
149
150 padding: 0
151
152 Pane {
153 id: pane
154
155 anchors.fill: parent
156 padding: 0
157
158 ColumnLayout {
159 anchors.fill: parent
160 spacing: 0
161
162 ColumnLayout {
163 id: topContent
164
165 height: childrenRect.height + 2 * drawer.padding
166
167 spacing: 0
168 visible: children.length > 0
169
170 Layout.margins: drawer.padding
171 Layout.fillWidth: true
172 }
173
174 ListView {
175 currentIndex: -1
176 spacing: 0
177
178 model: drawer.actions
179
180 delegate: ListItem {
181 iconName: modelData.iconName
182 text: modelData.text
183 onClicked: modelData.triggered(drawer)
184 }
185
186 visible: count > 0
187
188 Layout.fillWidth: true
189 Layout.fillHeight: true
190
191 ScrollBar.vertical: ScrollBar {}
192 }
193 }
194 }
195}
diff --git a/prototype_2016/third_party/fluid/controls/NoiseBackground.qml b/prototype_2016/third_party/fluid/controls/NoiseBackground.qml
new file mode 100644
index 0000000..e3513de
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/NoiseBackground.qml
@@ -0,0 +1,99 @@
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
15/****************************************************************************
16**
17** Copyright (C) 2017 The Qt Company Ltd.
18** Contact: https://www.qt.io/licensing/
19**
20** This file is part of Fluid and is derived from NoisyGradient.qml
21** from the Qt 5 launch demo.
22**
23** $QT_BEGIN_LICENSE:BSD$
24** You may use this file under the terms of the BSD license as follows:
25**
26** "Redistribution and use in source and binary forms, with or without
27** modification, are permitted provided that the following conditions are
28** met:
29** * Redistributions of source code must retain the above copyright
30** notice, this list of conditions and the following disclaimer.
31** * Redistributions in binary form must reproduce the above copyright
32** notice, this list of conditions and the following disclaimer in
33** the documentation and/or other materials provided with the
34** distribution.
35** * Neither the name of The Qt Company nor the names
36** of its contributors may be used to endorse or promote products derived
37** from this software without specific prior written permission.
38**
39**
40** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
51**
52** $QT_END_LICENSE$
53**
54****************************************************************************/
55
56import QtQuick 2.0
57
58/*!
59 \qmltype NoiseBackground
60 \inqmlmodule Fluid.Controls
61 \ingroup fluidcontrols
62
63 \brief Background with noise.
64*/
65ShaderEffect {
66 property alias gradient: rect.gradient
67 property alias color: rect.color
68
69 Rectangle {
70 id: rect
71 anchors.fill: parent
72 layer.enabled: true
73 layer.smooth: true
74 visible: false
75 }
76
77 readonly property variant source: rect
78
79 blending: false
80 fragmentShader: "
81 #ifdef GL_ES
82 precision lowp float;
83 #endif
84
85 uniform sampler2D source;
86 varying highp vec2 qt_TexCoord0;
87 uniform lowp float qt_Opacity;
88
89 // Noise function from: http://stackoverflow.com/questions/4200224/random-noise-functions-for-glsl
90 float rand(vec2 n) {
91 return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233))) * 43758.5453);
92 }
93
94 void main() {
95 lowp float len = clamp(length(vec2(0.5, 0.0) - qt_TexCoord0), 0.0, 1.0);
96 gl_FragColor = texture2D(source, vec2(0, len)) * qt_Opacity + rand(qt_TexCoord0) * 0.05;
97 }
98 "
99}
diff --git a/prototype_2016/third_party/fluid/controls/Page.qml b/prototype_2016/third_party/fluid/controls/Page.qml
new file mode 100644
index 0000000..7cd93f5
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Page.qml
@@ -0,0 +1,139 @@
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.4
17import QtQuick.Controls 2.0
18import Fluid.Controls 1.0 as FluidControls
19
20/*!
21 \qmltype Page
22 \inqmlmodule Fluid.Controls
23 \ingroup fluidcontrols
24
25 \brief Represents a page on the navigation page stack.
26
27 Example:
28
29 \qml
30 import QtQuick 2.4
31 import Fluid.Controls 1.0 as FluidControls
32
33 FluidControls.Page {
34 title: "Application Name"
35
36 actions: [
37 FluidControls.Action {
38 name: "Print"
39
40 // Icon name from the Google Material Design icon pack
41 iconName: "action/print"
42 }
43 ]
44 }
45 \endqml
46 */
47Page {
48 id: page
49
50 /*
51 \qmlproperty ActionBar actionBar
52
53 The action bar for this page. Use it as a group property to customize
54 this page's action bar. See the \l Page example for details on how to use
55 this property.
56 */
57 property alias appBar: appBar
58
59 /*!
60 The page's actions shown in the action bar.
61 */
62 property alias actions: appBar.actions
63
64 /*!
65 The action shown to the left of the title in the action bar. By default,
66 this is a back button which shows when there is a page behind the current
67 page in the page stack. However, you can replace it with your own action,
68 for example, an icon to open a navigation drawer when on your root page.
69 */
70 property alias leftAction: appBar.leftAction
71
72 /*!
73 \internal
74 Set by the page stack to true if there is a page behind this page on the
75 page stack.
76 */
77 property bool canGoBack: false
78
79 /*!
80 This signal is emitted when the back action is triggered or back key is released.
81
82 By default, the page will be popped from the page stack. To change the default
83 behavior, for example to show a confirmation dialog, listen for this signal using
84 \c onGoBack and set \c event.accepted to \c true. To dismiss the page from your
85 dialog without triggering this signal and re-showing the dialog, call
86 \c page.forcePop().
87 */
88 signal goBack(var event)
89
90 /*!
91 Pop this page from the page stack. This does nothing if this page is not
92 the current page on the page stack.
93
94 Use \c force to avoid calling the \l goBack signal. This is useful if you
95 use the \l goBack signal to show a confirmation dialog, and want to close
96 the page from your dialog without showing the dialog again. You can also
97 use \c forcePop() as a shortcut to this behavior.
98 */
99 function pop(event, force) {
100 if (StackView.view.currentItem !== page)
101 return false
102
103 if (!event)
104 event = {accepted: false}
105
106 if (!force)
107 goBack(event)
108
109 if (event.accepted) {
110 return true
111 } else {
112 return StackView.view.pop()
113 }
114 }
115
116 function forcePop() {
117 pop(null, true)
118 }
119
120 /*!
121 Push the specified component onto the page stack.
122 */
123 function push(component, properties) {
124 return StackView.view.push({item: component, properties: properties});
125 }
126
127 header: FluidControls.AppBar {
128 id: appBar
129
130 title: page.title
131
132 leftAction: FluidControls.Action {
133 text: "Back"
134 iconName: "navigation/arrow_back"
135 onTriggered: page.pop()
136 visible: page.canGoBack
137 }
138 }
139}
diff --git a/prototype_2016/third_party/qml-material/src/window/PageStack.qml b/prototype_2016/third_party/fluid/controls/PageStack.qml
index 11fc2b9..4c948da 100644
--- a/prototype_2016/third_party/qml-material/src/window/PageStack.qml
+++ b/prototype_2016/third_party/fluid/controls/PageStack.qml
@@ -1,24 +1,28 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> 4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
5 * 7 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 8 * 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 9 * 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/. 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
9 */ 13 */
10 14
11import QtQuick 2.4 15import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls 16import QtQuick.Controls 2.0
13import Material 0.3
14 17
15/*! 18/*!
16 \qmltype PageStack 19 \qmltype PageStack
17 \inqmlmodule Material 20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
18 22
19 \brief Manages the page stack used for navigation. 23 \brief Manages the page stack used for navigation.
20*/ 24*/
21Controls.StackView { 25StackView {
22 id: stackView 26 id: stackView
23 27
24 signal pushed(Item page) 28 signal pushed(Item page)
diff --git a/prototype_2016/third_party/fluid/controls/Placeholder.qml b/prototype_2016/third_party/fluid/controls/Placeholder.qml
new file mode 100644
index 0000000..f1e7996
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Placeholder.qml
@@ -0,0 +1,66 @@
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 2.2
16import QtQuick.Layouts 1.0
17import QtQuick.Controls 2.0
18import QtQuick.Controls.Material 2.0
19import Fluid.Controls 1.0
20
21/*!
22 \qmltype Placeholder
23 \inqmlmodule Fluid.Controls
24 \ingroup fluidcontrols
25
26 \brief Placeholder.
27*/
28Item {
29 property alias iconName: icon.name
30 property alias iconSource: icon.source
31 property alias text: textLabel.text
32 property alias subText: subTextLabel.text
33
34 ColumnLayout {
35 anchors.centerIn: parent
36
37 width: parent.width - 2 * Units.mediumSpacing
38
39 Icon {
40 id: icon
41 size: 96
42
43 Layout.alignment: Qt.AlignHCenter
44 }
45
46 Label {
47 id: textLabel
48 font: FluidStyle.titleFont
49 color: Material.secondaryTextColor
50 horizontalAlignment: Qt.AlignHCenter
51
52 Layout.fillWidth: true
53 }
54
55 Label {
56 id: subTextLabel
57 font: FluidStyle.subheadingFont
58 color: Material.secondaryTextColor
59 horizontalAlignment: Qt.AlignHCenter
60 wrapMode: Text.Wrap
61 visible: text !== ""
62
63 Layout.fillWidth: true
64 }
65 }
66}
diff --git a/prototype_2016/third_party/fluid/controls/Showable.qml b/prototype_2016/third_party/fluid/controls/Showable.qml
new file mode 100644
index 0000000..c7ceb9f
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Showable.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
16
17/*!
18 \qmltype Showable
19 \inqmlmodule Fluid.Controls
20 \ingroup fluidcontrols
21
22 \brief Showtable component.
23*/
24FocusScope {
25 property var showAnimation
26 property var hideAnimation
27
28 id: root
29 visible: false
30 onHideAnimationChanged: {
31 // Automatically set animation target when it's possible
32 if (showAnimation && showAnimation.target != undefined)
33 showAnimation.target = root;
34 if (hideAnimation && hideAnimation.target != undefined)
35 hideAnimation.target = root;
36
37 // Hide the item when the animation is over
38 if (hideAnimation) {
39 hideAnimation.runningChanged.connect(function() {
40 if (!hideAnimation.running)
41 root.visible = false;
42 });
43 }
44 }
45
46 function show() {
47 // Stop hide animation if it's still running
48 if (hideAnimation != undefined && hideAnimation.running)
49 hideAnimation.stop();
50
51 // Show the item otherwise we won't see the animation
52 visible = true;
53
54 // Restart show animation if available
55 if (showAnimation != undefined && !showAnimation.running)
56 showAnimation.restart();
57 }
58
59 function hide() {
60 // Stop show animation if it's still running
61 if (showAnimation != undefined && showAnimation.running)
62 showAnimation.stop();
63
64 // Restart hide animation if available
65 if (hideAnimation != undefined && !hideAnimation.running)
66 hideAnimation.restart();
67 }
68}
diff --git a/prototype_2016/third_party/qml-material/src/window/Sidebar.qml b/prototype_2016/third_party/fluid/controls/Sidebar.qml
index 7954294..8632a03 100644
--- a/prototype_2016/third_party/qml-material/src/window/Sidebar.qml
+++ b/prototype_2016/third_party/fluid/controls/Sidebar.qml
@@ -1,20 +1,27 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> 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$
5 * 8 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 9 * 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 10 * 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/. 11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
9 */ 14 */
10 15
11import QtQuick 2.4 16import QtQuick 2.0
12import Material 0.3 17import QtQuick.Controls 2.0
13import "ListItems" as ListItem 18import QtQuick.Controls.Material 2.0
19import Fluid.Controls 1.0
14 20
15/*! 21/*!
16 \qmltype Sidebar 22 \qmltype Sidebar
17 \inqmlmodule Material 23 \inqmlmodule Fluid.Controls
24 \ingroup fluidcontrols
18 25
19 \brief A sidebar component for use in adaptive layouts 26 \brief A sidebar component for use in adaptive layouts
20 27
@@ -27,9 +34,9 @@ import "ListItems" as ListItem
27 entire sidebar, set the autoFill property to false. 34 entire sidebar, set the autoFill property to false.
28 35
29 Examples: 36 Examples:
30 \qml 37 \code
31 Item{ 38 Item {
32 property bool wideAspect: width > gu(80) 39 property bool wideAspect: width > Units.gu(80)
33 40
34 Sidebar { 41 Sidebar {
35 expanded: wideAspect 42 expanded: wideAspect
@@ -37,34 +44,32 @@ import "ListItems" as ListItem
37 // Anchoring is automatic 44 // Anchoring is automatic
38 } 45 }
39 } 46 }
40 \endqml 47 \endcode
41 */ 48 */
42View { 49Pane {
43 id: root 50 id: sidebar
44 51
45 backgroundColor: style === "default" ? "white" : "#333" 52 default property alias contents: contents.data
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 53
56 width: 250 * Units.dp 54 /*!
55 The text displayed for the action.
56 */
57 property int edge: Qt.LeftEdge
57 58
59 /*!
60 Show or hide the sidebar.
61 */
58 property bool expanded: true 62 property bool expanded: true
59 63
60 property string mode: "left" // or "right" 64 /*!
61 property alias header: headerItem.text 65 Flick automatically.
62 66 */
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 67 property bool autoFlick: true
66 68
67 default property alias contents: contents.data 69 /*!
70 The text displayed as header.
71 */
72 property alias header: headerItem.text
68 73
69 Behavior on anchors.leftMargin { 74 Behavior on anchors.leftMargin {
70 NumberAnimation { duration: 200 } 75 NumberAnimation { duration: 200 }
@@ -74,15 +79,31 @@ View {
74 NumberAnimation { duration: 200 } 79 NumberAnimation { duration: 200 }
75 } 80 }
76 81
82 Material.background: Material.theme === Material.Light ? "white" : "#333"
83 Material.elevation: 1
84
85 anchors {
86 left: edge === Qt.LeftEdge ? parent.left : undefined
87 top: parent.top
88 right: edge === Qt.RightEdge ? parent.right : undefined
89 bottom: parent.bottom
90 leftMargin: expanded ? 0 : -width
91 rightMargin: expanded ? 0 : -width
92 }
93
94 width: 250
95
96 padding: 0
97
77 Rectangle { 98 Rectangle {
78 color: borderColor 99 color: Material.dividerColor
79 width: 1 100 width: 1
80 101
81 anchors { 102 anchors {
103 left: edge === Qt.RightEdge ? parent.left : undefined
82 top: parent.top 104 top: parent.top
105 right: edge === Qt.LeftEdge ? parent.right : undefined
83 bottom: parent.bottom 106 bottom: parent.bottom
84 right: mode === "left" ? parent.right : undefined
85 left: mode === "right" ? parent.left : undefined
86 //rightMargin: -1 107 //rightMargin: -1
87 } 108 }
88 } 109 }
@@ -92,17 +113,16 @@ View {
92 113
93 anchors { 114 anchors {
94 fill: parent 115 fill: parent
95 rightMargin: mode === "left" ? 1 : 0 116 leftMargin: edge === Qt.RightEdge ? 1 : 0
96 leftMargin: mode === "right" ? 1 : 0 117 rightMargin: edge === Qt.LeftEdge ? 1 : 0
97 } 118 }
98 119
99 ListItem.Subheader { 120 Subheader {
100 id: headerItem 121 id: headerItem
101 122
123 Material.elevation: flickable.atYBeginning ? 0 : 1
124
102 visible: text !== "" 125 visible: text !== ""
103 backgroundColor: root.backgroundColor
104 elevation: flickable.atYBeginning ? 0 : 1
105 fullWidth: true
106 z: 2 126 z: 2
107 } 127 }
108 128
@@ -111,9 +131,11 @@ View {
111 131
112 clip: true 132 clip: true
113 133
134 ScrollBar.vertical: ScrollBar {}
135
114 anchors { 136 anchors {
115 top: headerItem.visible ? headerItem.bottom : parent.top
116 left: parent.left 137 left: parent.left
138 top: headerItem.visible ? headerItem.bottom : parent.top
117 right: parent.right 139 right: parent.right
118 bottom: parent.bottom 140 bottom: parent.bottom
119 } 141 }
@@ -131,21 +153,16 @@ View {
131 153
132 function getFlickableChild(item) { 154 function getFlickableChild(item) {
133 if (item && item.hasOwnProperty("children")) { 155 if (item && item.hasOwnProperty("children")) {
134 for (var i=0; i < item.children.length; i++) { 156 for (var i = 0; i < item.children.length; i++) {
135 var child = item.children[i]; 157 var child = item.children[i]
136 if (internal.isVerticalFlickable(child)) { 158 if (internal.isVerticalFlickable(child)) {
137 if (child.anchors.top === page.top || child.anchors.fill === page) { 159 if (child.anchors.top === page.top || child.anchors.fill === page)
138 return item.children[i]; 160 return item.children[i]
139 }
140 } 161 }
141 } 162 }
142 } 163 }
143 return null; 164 return null
144 } 165 }
145 } 166 }
146
147 Scrollbar {
148 flickableItem: flickable
149 }
150 } 167 }
151} 168}
diff --git a/prototype_2016/third_party/fluid/controls/SmoothFadeImage.qml b/prototype_2016/third_party/fluid/controls/SmoothFadeImage.qml
new file mode 100644
index 0000000..fbd0a94
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/SmoothFadeImage.qml
@@ -0,0 +1,309 @@
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
17/*!
18 \qmltype SmoothFadeImage
19 \inqmlmodule Fluid.Controls
20 \ingroup fluidcontrols
21
22 \brief Displays an image and smoothly fade when the source is changed.
23
24 This component can be used in place of an Image when a smooth fade animation
25 between two sources is needed.
26
27 When the source is changed and the fade animation ends, the image loaded before
28 is unloaded; this means that only one image at a time is loaded.
29
30 Images are loaded asynchronously and are not cache, so unlike the Image
31 component the \c asynchronous and \c cache properties are not available.
32
33 Example of usage:
34 \code
35 import QtQuick 2.0
36 import Fluid.Controls 1.0
37
38 Item {
39 width: 128
40 height: 128
41
42 SmoothFadeImage {
43 anchors.fill: parent
44 source: "http://www.maui-project.org/images/logos/m.png"
45 fillMode: Image.PreserveAspectFit
46 smooth: true
47 fadeDuration: 400
48
49 MouseArea {
50 anchors.fill: parent
51 onClicked: parent.source = "http://www.maui-project.org/images/logos/qt.png"
52 }
53 }
54 }
55 \endcode
56*/
57Item {
58 id: root
59
60 /*!
61 The image being displayed.
62 SmoothFadeImage can handle any image format supported by Qt, loaded
63 from any URL scheme supported by Qt.
64
65 \sa Image::source
66 */
67 property url source
68
69 /*!
70 \qmlproperty enumeration fillMode
71
72 Set this property to define what happens when the source image has a
73 different size than the item.
74
75 \list
76 \li Image.Stretch - the image is scaled to fit (default)
77 \li Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping
78 \li Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary
79 \li Image.Tile - the image is duplicated horizontally and vertically
80 \li Image.TileVertically - the image is stretched horizontally and tiled vertically
81 \li Image.TileHorizontally - the image is stretched vertically and tiled horizontally
82 \li Image.Pad - the image is not transformed
83 \endlist
84
85 Defaults to \c Image.Stretch.
86
87 Note that \c clip is false by default which means that the item might
88 paint outside its bounding rectangle even if the fillMode is set to PreserveAspectCrop.
89 */
90 property int fillMode : Image.Stretch
91
92 /*!
93 Set this to change the fade animation time (in milliseconds).
94 Default value is 250 ms.
95 */
96 property int fadeDuration: 250
97
98 /*!
99 This property holds whether the fade animation is running or not.
100 */
101 readonly property bool running: animation.running
102
103 /*!
104 Set this property to false to disable the fade animation.
105 If the animation is disable, SmoothFadeImage behaves like a normal Image.
106
107 The fade animation is enabled by default.
108 */
109 property bool animationEnabled: true
110
111 /*!
112 This property holds the actual width and height of the loaded image.
113
114 Unlike the \c width and \c height properties, which scale the painting of the
115 image, this property sets the actual number of pixels stored for the
116 loaded image so that large images do not use more memory than necessary.
117
118 For example, this ensures the image in memory is no larger than
119 1024x1024 pixels, regardless of the SmoothFadeImage's width and height values:
120
121 \code
122 Rectangle {
123 width: ...
124 height: ...
125
126 Image {
127 anchors.fill: parent
128 source: "reallyBigImage.jpg"
129 sourceSize.width: 1024
130 sourceSize.height: 1024
131 }
132 }
133 \endcode
134
135 If the image's actual size is larger than the sourceSize, the image is
136 scaled down. If only one dimension of the size is set to greater than 0,
137 the other dimension is set in proportion to preserve the source image's
138 aspect ratio. (The \c fillMode is independent of this.)
139
140 If both the sourceSize.width and sourceSize.height are set the image
141 will be scaled down to fit within the specified size, maintaining the
142 image's aspect ratio. The actual size of the image after scaling is
143 available via \c Item::implicitWidth and \c Item::implicitHeight.
144
145 If the source is an intrinsically scalable image (eg. SVG), this property
146 determines the size of the loaded image regardless of intrinsic size.
147 Avoid changing this property dynamically; rendering an SVG is slow compared
148 to an image.
149
150 If the source is a non-scalable image (eg. JPEG), the loaded image will be
151 no greater than this property specifies. For some formats (currently only
152 JPEG), the whole image will never actually be loaded into memory.
153
154 sourceSize can be cleared to the natural size of the image by setting
155 sourceSize to undefined.
156
157 Note: Changing this property dynamically causes the image source to be
158 reloaded, potentially even from the network, if it is not in the disk cache.
159 */
160 property alias sourceSize: __priv.sourceSize
161
162 /*!
163 \qmlproperty enumeration status
164
165 This property holds the status of image loading. It can be one of:
166
167 \list
168 \li Image.Null - no image has been set
169 \li Image.Ready - the image has been loaded
170 \li Image.Loading - the image is currently being loaded
171 \li Image.Error - an error occurred while loading the image
172 \endlist
173 */
174 readonly property int status: __priv.loadingImage ? __priv.loadingImage.status : Image.Null
175
176 /*!
177 This property holds whether the image is smoothly filtered when scaled or
178 transformed. Smooth filtering gives better visual quality, but it may be
179 slower on some hardware.
180
181 If the image is displayed at its natural size, this property has no
182 visual or performance effect.
183
184 By default, this property is set to \c true.
185 */
186 property bool smooth: true
187
188 /*!
189 This signal is emitted when the swap between the old source and the new
190 one has happened.
191 */
192 signal imageSwapped()
193
194 QtObject {
195 id: __priv
196
197 property size sourceSize: undefined
198
199 property Image currentImage: image1
200 property Image nextImage: image2
201 property Image loadingImage: currentImage
202
203 onSourceSizeChanged: {
204 // Change source size for both images
205 image1.sourceSize = sourceSize;
206 image2.sourceSize = sourceSize;
207 }
208
209 function swapImages() {
210 // Swap images stacking order and start fading animation
211 __priv.currentImage.z = 0;
212 __priv.nextImage.z = 1;
213 if (root.animationEnabled)
214 animation.start();
215
216 // Swap images pointers
217 var oldImage = __priv.currentImage;
218 __priv.currentImage = __priv.nextImage;
219 __priv.nextImage = oldImage;
220 }
221 }
222
223 onSourceChanged: {
224 // Set image pointers at creation time
225 if (__priv.currentImage === null) {
226 __priv.currentImage = image1;
227 __priv.nextImage = image2;
228 }
229
230 // Stop the animation if the source is changed while
231 // it's still running
232 animation.stop();
233
234 // Unload both images
235 if (root.source == "") {
236 __priv.currentImage.source = "";
237 __priv.nextImage.source = "";
238 __priv.loadingImage = null;
239 return;
240 }
241
242 if (__priv.currentImage.source == "") {
243 // Assign the source to the current image for the first time
244 __priv.currentImage.source = root.source;
245 __priv.loadingImage = __priv.currentImage;
246 } else {
247 // Image source is changed, make sure the animation is not running
248 animation.stop();
249
250 // Prepare the next image
251 __priv.nextImage.opacity = 0.0;
252 __priv.nextImage.source = root.source;
253 __priv.loadingImage = __priv.nextImage;
254
255 // If the next image is still cached the status will already be Ready
256 // otherwise it's not loaded, either way we need to swap
257 if (__priv.nextImage.status === Image.Ready || __priv.nextImage.source === "")
258 __priv.swapImages();
259 }
260 }
261
262 Connections {
263 target: __priv.nextImage
264 onOpacityChanged: {
265 if (__priv.nextImage.opacity == 1.0)
266 root.imageSwapped();
267 }
268 onStatusChanged: {
269 if (__priv.nextImage.status === Image.Ready)
270 __priv.swapImages();
271 }
272 }
273
274 Image {
275 id: image1
276 anchors.fill: parent
277 cache: false
278 asynchronous: true
279 fillMode: root.fillMode
280 smooth: root.smooth
281 clip: root.clip
282 z: 1
283 }
284
285 Image {
286 id: image2
287 anchors.fill: parent
288 cache: false
289 asynchronous: true
290 fillMode: root.fillMode
291 smooth: root.smooth
292 clip: root.clip
293 z: 0
294 }
295
296 NumberAnimation {
297 id: animation
298 target: __priv.nextImage
299 property: "opacity"
300 to: 1.0
301 duration: root.fadeDuration
302 onRunningChanged: {
303 // When the fade animation stops, we unload the second image in
304 // order to save some memory (only one image will be load at a time)
305 if (!running)
306 __priv.nextImage.source = "";
307 }
308 }
309}
diff --git a/prototype_2016/third_party/fluid/controls/SmoothFadeLoader.qml b/prototype_2016/third_party/fluid/controls/SmoothFadeLoader.qml
new file mode 100644
index 0000000..0c76a67
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/SmoothFadeLoader.qml
@@ -0,0 +1,137 @@
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
17/*!
18 \qmltype SmoothFadeLoader
19 \inqmlmodule Fluid.Controls
20 \ingroup fluidcontrols
21
22 \brief Displays an item and smoothly fade when the source is changed.
23
24 This component loads an item with a Loader and smoothly fade to another item when
25 the source URL is changed.
26
27 Items are loaded synchronously, also the item being hidden is not unloaded to
28 avoid an unpleasant "flash" after the transition.
29
30 Example of usage:
31 \code
32 import QtQuick 2.0
33 import Fluid.Controls 1.0
34
35 Item {
36 width: 640
37 height: 480
38
39 SmoothFadeLoader {
40 anchors.fill: parent
41 source: "MyComponent.qml"
42 fadeDuration: 400
43
44 MouseArea {
45 anchors.fill: parent
46 onClicked: parent.source = "AnotherComponent.qml"
47 }
48 }
49 }
50 \endcode
51*/
52Item {
53 /*!
54 The item being displayed.
55
56 \sa Loader::source
57 */
58 property url source
59
60 /*!
61 Set this to change the fade animation time (in milliseconds).
62 Default value is 250 ms.
63 */
64 property int fadeDuration: 250
65
66 /*!
67 This property holds whether the fade animation is running or not.
68 */
69 readonly property bool running: animation.running
70
71 id: root
72 onSourceChanged: {
73 animation.running = false;
74
75 if (__priv.currentLoader == loader1) {
76 __priv.currentLoader = loader2;
77 __priv.nextLoader = loader1;
78 } else {
79 __priv.currentLoader = loader1;
80 __priv.nextLoader = loader2;
81 }
82
83 __priv.currentLoader.source = sourceUrl;
84 __priv.currentLoader.opacity = 0;
85 __priv.currentLoader.z = 1;
86 __priv.nextLoader.z = 0;
87
88 if (__priv.firstTime) {
89 __priv.currentLoader.opacity = 1.0;
90 __priv.nextLoader.opacity = 0.0;
91 __priv.firstTime = false;
92 } else {
93 animation.running = true;
94 }
95 }
96
97 QtObject {
98 id: __priv
99
100 property bool firstTime: true
101 property Loader currentLoader: loader1
102 property Loader nextLoader: loader2
103 }
104
105 SequentialAnimation {
106 id: animation
107 running: false
108
109 NumberAnimation {
110 target: __priv.currentLoader
111 properties: "opacity"
112 from: 0.0
113 to: 1.0
114 duration: root.fadeDuration
115 easing.type: Easing.OutQuad
116 }
117
118 ScriptAction {
119 script: {
120 __priv.nextLoader.opacity = 0;
121 //__priv.nextLoader.source = "";
122 }
123 }
124 }
125
126 Loader {
127 id: loader1
128 anchors.fill: parent
129 z: 1
130 }
131
132 Loader {
133 id: loader2
134 anchors.fill: parent
135 z: 0
136 }
137}
diff --git a/prototype_2016/third_party/fluid/controls/Subheader.qml b/prototype_2016/third_party/fluid/controls/Subheader.qml
new file mode 100644
index 0000000..329d683
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Subheader.qml
@@ -0,0 +1,45 @@
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 2.4
16import QtQuick.Controls 2.0
17import QtQuick.Controls.Material 2.0
18import Fluid.Controls 1.0
19
20/*!
21 \qmltype Subheader
22 \inqmlmodule Fluid.Controls
23 \ingroup fluidcontrols
24
25 \brief Subheaders are special list tiles that delineate distinct sections of a list or grid list.
26 */
27BaseListItem {
28 id: listItem
29
30 implicitHeight: 48
31 interactive: false
32
33 property alias textColor: label.color
34
35 contentItem: Label {
36 id: label
37
38 font: FluidStyle.subheaderFont
39 text: listItem.text
40
41 verticalAlignment: Text.AlignVCenter
42
43 color: Material.secondaryTextColor
44 }
45}
diff --git a/prototype_2016/third_party/fluid/controls/SubheadingLabel.qml b/prototype_2016/third_party/fluid/controls/SubheadingLabel.qml
new file mode 100644
index 0000000..e43d1f5
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/SubheadingLabel.qml
@@ -0,0 +1,51 @@
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.Templates 2.0 as T
17
18/*!
19 \qmltype SubheadingLabel
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Text label with standard font and styling suitable to subheading.
24
25 \code
26 SubheadingLabel {
27 text: qsTr("A translatable subheading")
28 }
29 \endcode
30*/
31T.Label {
32 /*!
33 \qmlproperty int level
34
35 This property holds the label level that controls
36 font style and size.
37
38 Only values between 1 and 4 are allowed.
39
40 Default value is 1.
41 */
42 property int level: 1
43
44 font.pixelSize: 14
45 color: "#26282a"
46 linkColor: "#45a7d7"
47 onLevelChanged: {
48 if (level < 1 || level > 2)
49 console.error("BodyLabel level must be either 1 or 2")
50 }
51}
diff --git a/prototype_2016/third_party/fluid/controls/Tab.qml b/prototype_2016/third_party/fluid/controls/Tab.qml
new file mode 100644
index 0000000..80038d4
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Tab.qml
@@ -0,0 +1,47 @@
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 2.4
16import Fluid.Core 1.0
17
18Item {
19 id: tab
20
21 /*!
22 The title of this tab.
23 */
24 property string title
25
26 /*!
27 The icon displayed for this tab. This can be a Material Design icon or an icon from
28 FontAwesome. See \l Icon from more details.
29 */
30 property string iconName
31
32 /*!
33 A URL pointing to an image to display as the icon of this tab. By default, this is
34 a special URL representing the icon named by \l iconName from the Material Design
35 icon collection. The icon will be colorized using the specificed \l color,
36 unless you put ".color." in the filename, for example, "app-icon.color.svg".
37
38 \sa iconName
39 \sa Icon
40 */
41 property string iconSource: Utils.getSourceForIconName(iconName)
42
43 /*!
44 * Controls whether a close button will be shown for this tab.
45 */
46 property bool canRemove: false
47}
diff --git a/prototype_2016/third_party/fluid/controls/TabbedPage.qml b/prototype_2016/third_party/fluid/controls/TabbedPage.qml
new file mode 100644
index 0000000..bec0543
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/TabbedPage.qml
@@ -0,0 +1,90 @@
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.4
17import QtQuick.Controls 2.0
18import QtQuick.Controls.Material 2.0
19import Fluid.Core 1.0 as FluidCore
20import Fluid.Controls 1.0 as FluidControls
21
22FluidControls.Page {
23 id: page
24
25 default property alias contents: swipeView.contentChildren
26
27 property alias count: swipeView.count
28
29 readonly property int currentIndex: appBar.currentTabIndex
30
31 /*!
32 The currently selected tab.
33 */
34 readonly property Tab selectedTab: count > 0
35 ? swipeView.contentChildren[currentIndex] : null
36
37 onCurrentIndexChanged: swipeView.currentIndex = currentIndex
38
39 appBar.tabs: Repeater {
40 model: swipeView.contentChildren
41 delegate: TabButton {
42 text: modelData.title
43 width: parent.fixed ? parent.width / parent.count : implicitWidth
44
45 // Active color
46 Material.accent: appBar.Material.foreground
47
48 // Unfocused color
49 Material.foreground: FluidCore.Utils.alpha(appBar.Material.foreground, 0.7)
50
51 FluidControls.Icon {
52 id: tabIcon
53
54 anchors.left: parent.left
55 anchors.verticalCenter: parent.verticalCenter
56 anchors.leftMargin: FluidControls.Units.smallSpacing
57
58 name: modelData.iconName
59 source: modelData.iconSource
60 visible: status == Image.Ready
61 }
62
63 FluidControls.IconButton {
64 id: tabCloseButton
65
66 anchors.right: parent.right
67 anchors.verticalCenter: parent.verticalCenter
68 anchors.rightMargin: FluidControls.Units.smallSpacing
69
70 iconName: "navigation/close"
71 visible: modelData.canRemove
72
73 onClicked: swipeView.removeItem(swipeView.currentIndex)
74 }
75 }
76 }
77
78 SwipeView {
79 id: swipeView
80 anchors.fill: parent
81 currentIndex: appBar.currentTabIndex
82
83 onCurrentIndexChanged: appBar.currentTabIndex = currentIndex
84 }
85
86 function addTab(tab) {
87 swipeView.addItem(tab);
88 appBar.currentTabIndex = swipeView.count - 1;
89 }
90}
diff --git a/prototype_2016/third_party/fluid/controls/ThinDivider.qml b/prototype_2016/third_party/fluid/controls/ThinDivider.qml
new file mode 100644
index 0000000..7d2def5
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/ThinDivider.qml
@@ -0,0 +1,28 @@
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 2.4
16
17/*!
18 \qmltype ThinDivider
19 \inqmlmodule Fluid.Controls
20 \ingroup fluidcontrols
21
22 \brief A 1px high divider for use in lists and other columns of content.
23 */
24Rectangle {
25 color: "#999"
26 width: parent.width
27 height: 1
28}
diff --git a/prototype_2016/third_party/fluid/controls/TitleLabel.qml b/prototype_2016/third_party/fluid/controls/TitleLabel.qml
new file mode 100644
index 0000000..8742d7e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/TitleLabel.qml
@@ -0,0 +1,36 @@
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.Templates 2.0 as T
17
18/*!
19 \qmltype TitleLabel
20 \inqmlmodule Fluid.Controls
21 \ingroup fluidcontrols
22
23 \brief Text label with standard font and styling suitable to titles.
24
25 \code
26 Title {
27 text: qsTr("Translatable title")
28 }
29 \endcode
30*/
31T.Label {
32 font.pixelSize: 18
33 font.bold: true
34 color: "#26282a"
35 linkColor: "#45a7d7"
36}
diff --git a/prototype_2016/third_party/fluid/controls/Units.qml b/prototype_2016/third_party/fluid/controls/Units.qml
new file mode 100644
index 0000000..e702e33
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/Units.qml
@@ -0,0 +1,125 @@
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
15pragma Singleton
16
17import QtQuick 2.4
18import Fluid.Core 1.0
19
20/*!
21 \qmltype Units
22 \inqmlmodule Fluid.Controls
23 \ingroup fluidcontrols
24
25 \brief Units.
26*/
27Item {
28 /*
29 \qmlproperty int gridUnit
30 Fundamental unit of space for sizes depending on the current font.
31 It correspond to the capital letter M width in pixel.
32 */
33 readonly property int gridUnit: textMetrics.height
34
35 /*!
36 \qmlproperty real smallSpacing
37 The amount of spacing that should be used around smaller UI
38 elements. It can be used as margin around button box and
39 spacing between buttons.
40 */
41 readonly property real smallSpacing: 8
42
43 /*!
44 \qmlproperty real mediumSpacing
45 The amount of spacing that should be used inside medium UI
46 elements such as padding between title and body text in a dialog box.
47 */
48 readonly property real mediumSpacing: 20
49
50 /*!
51 \qmlproperty real largeSpacing
52 The amount of spacing that should be used inside bigger UI
53 elements such as padding in a dialog box.
54 */
55 readonly property real largeSpacing: 24
56
57 /*!
58 \qmlproperty int shortDuration
59 Duration for short animations to make UI events noticeable.
60 */
61 readonly property int shortDuration: 100
62
63 /*!
64 \qmlproperty int mediumDuration
65 Duration for medium length animations.
66 */
67 readonly property int mediumDuration: 200
68
69 /*!
70 \qmlproperty int longDuration
71 Duration for long animations such as windows opening or closing.
72 */
73 readonly property int longDuration: 400
74
75 /*!
76 \qmlproperty object iconSizes
77 Standard icon sizes.
78 */
79 readonly property QtObject iconSizes: QtObject {
80 readonly property int tiny: 8
81 readonly property int small: 16
82 readonly property int smallMedium: 22
83 readonly property int medium: 32
84 readonly property int large: 48
85 readonly property int huge: 64
86 readonly property int enormous: 128
87 }
88
89 TextMetrics {
90 id: textMetrics
91 text: "M"
92 }
93
94 /*!
95 Returns a round size in pixels multiplied by grid unit.
96 */
97 function gu(x) {
98 return Math.round(x * gridUnit);
99 }
100
101 /*!
102 Returns the size in pixel closes to the icon size.
103 */
104 function roundToIconSize(x) {
105 // Find the size closest to icon size
106 if (x <= 0)
107 return 0;
108 else if (x < 8)
109 return 8;
110 else if (x < 16)
111 return 16;
112 else if (x < 22)
113 return 22;
114 else if (x < 32)
115 return 32;
116 else if (x < 48)
117 return 48;
118 else if (x < 64)
119 return 64;
120 else if (x < 128)
121 return 128;
122
123 return x;
124 }
125}
diff --git a/prototype_2016/third_party/fluid/controls/controls.pri b/prototype_2016/third_party/fluid/controls/controls.pri
new file mode 100644
index 0000000..db09cef
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/controls.pri
@@ -0,0 +1,4 @@
1HEADERS += $$PWD/iconthemeimageprovider.h
2SOURCES += $$PWD/iconthemeimageprovider.cpp
3INCLUDEPATH += $$PWD
4RESOURCES += $$PWD/controls.qrc
diff --git a/prototype_2016/third_party/fluid/controls/controls.qrc b/prototype_2016/third_party/fluid/controls/controls.qrc
new file mode 100644
index 0000000..8f0c46c
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/controls.qrc
@@ -0,0 +1,46 @@
1<RCC>
2 <qresource prefix="/Fluid/Controls">
3 <file>Action.qml</file>
4 <file>AppBar.qml</file>
5 <file>AppToolBar.qml</file>
6 <file>BaseListItem.qml</file>
7 <file>BodyLabel.qml</file>
8 <file>CaptionLabel.qml</file>
9 <file>Card.qml</file>
10 <file>CircleImage.qml</file>
11 <file>Dialog.qml</file>
12 <file>DisplayLabel.qml</file>
13 <file>FluidStyle.qml</file>
14 <file>FluidWindow.qml</file>
15 <file>HeadlineLabel.qml</file>
16 <file>Icon.qml</file>
17 <file>IconButton.qml</file>
18 <file>InfoBar.qml</file>
19 <file>ListItem.qml</file>
20 <file>ListItemDelegate.qml</file>
21 <file>Loadable.qml</file>
22 <file>NavigationDrawer.qml</file>
23 <file>NoiseBackground.qml</file>
24 <file>Page.qml</file>
25 <file>PageStack.qml</file>
26 <file>Placeholder.qml</file>
27 <file>Showable.qml</file>
28 <file>Sidebar.qml</file>
29 <file>SmoothFadeImage.qml</file>
30 <file>SmoothFadeLoader.qml</file>
31 <file>Subheader.qml</file>
32 <file>SubheadingLabel.qml</file>
33 <file>ThinDivider.qml</file>
34 <file>TitleLabel.qml</file>
35 <file>Units.qml</file>
36 <file>+material/BaseListItem.qml</file>
37 <file>+material/BodyLabel.qml</file>
38 <file>+material/CaptionLabel.qml</file>
39 <file>+material/DisplayLabel.qml</file>
40 <file>+material/HeadlineLabel.qml</file>
41 <file>+material/SubheadingLabel.qml</file>
42 <file>+material/ThinDivider.qml</file>
43 <file>+material/TitleLabel.qml</file>
44 <file alias="qmldir">qmldir_noplugin</file>
45 </qresource>
46</RCC>
diff --git a/prototype_2016/third_party/fluid/controls/iconthemeimageprovider.cpp b/prototype_2016/third_party/fluid/controls/iconthemeimageprovider.cpp
new file mode 100644
index 0000000..8b1c77b
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/iconthemeimageprovider.cpp
@@ -0,0 +1,47 @@
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
15#include <QtGui/QIcon>
16
17#include "iconthemeimageprovider.h"
18
19IconThemeImageProvider::IconThemeImageProvider()
20 : QQuickImageProvider(QQuickImageProvider::Pixmap)
21{
22}
23
24QPixmap IconThemeImageProvider::requestPixmap(const QString &id, QSize *realSize,
25 const QSize &requestedSize)
26{
27 // Sanitize requested size
28 QSize size(requestedSize);
29 if (size.width() < 1)
30 size.setWidth(1);
31 if (size.height() < 1)
32 size.setHeight(1);
33
34 // Return real size
35 if (realSize)
36 *realSize = size;
37
38 // Is it a path?
39 if (id.startsWith('/'))
40 return QPixmap(id).scaled(size);
41
42 // Return icon from theme or fallback to a generic icon
43 QIcon icon = QIcon::fromTheme(id);
44 if (icon.isNull())
45 icon = QIcon::fromTheme(QLatin1String("application-x-executable"));
46 return icon.pixmap(size);
47}
diff --git a/prototype_2016/third_party/fluid/controls/iconthemeimageprovider.h b/prototype_2016/third_party/fluid/controls/iconthemeimageprovider.h
new file mode 100644
index 0000000..e50008f
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/iconthemeimageprovider.h
@@ -0,0 +1,25 @@
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
15#pragma once
16
17#include <QtQuick/QQuickImageProvider>
18
19class IconThemeImageProvider : public QQuickImageProvider
20{
21public:
22 IconThemeImageProvider();
23
24 QPixmap requestPixmap(const QString &id, QSize *realSize, const QSize &requestedSize);
25};
diff --git a/prototype_2016/third_party/fluid/controls/plugin.cpp b/prototype_2016/third_party/fluid/controls/plugin.cpp
new file mode 100644
index 0000000..661b234
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/plugin.cpp
@@ -0,0 +1,42 @@
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
15#include <QtQml>
16
17#include "iconthemeimageprovider.h"
18
19class FluidCorePlugin : public QQmlExtensionPlugin
20{
21 Q_OBJECT
22 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
23public:
24 void initializeEngine(QQmlEngine *engine, const char *uri);
25 void registerTypes(const char *uri);
26};
27
28void FluidCorePlugin::initializeEngine(QQmlEngine *engine, const char *uri)
29{
30 Q_ASSERT(QByteArray(uri) == QByteArrayLiteral("Fluid.Controls"));
31
32 engine->addImageProvider(QLatin1String("fluidicontheme"), new IconThemeImageProvider());
33}
34
35void FluidCorePlugin::registerTypes(const char *uri)
36{
37 Q_ASSERT(QByteArray(uri) == QByteArrayLiteral("Fluid.Controls"));
38
39 // @uri Fluid.Controls
40}
41
42#include "plugin.moc"
diff --git a/prototype_2016/third_party/fluid/controls/plugins.qmltypes b/prototype_2016/third_party/fluid/controls/plugins.qmltypes
new file mode 100644
index 0000000..29ef846
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/plugins.qmltypes
@@ -0,0 +1,569 @@
1import QtQuick.tooling 1.2
2
3// This file describes the plugin-supplied types contained in the library.
4// It is used for QML tooling purposes only.
5//
6// This file was auto-generated by:
7// 'qmlplugindump-qt5 -nonrelocatable Fluid.Controls 1.0'
8
9Module {
10 dependencies: [
11 "Fluid.Core 1.0",
12 "Fluid.Effects 1.0",
13 "Fluid.Material 1.0",
14 "QtGraphicalEffects 1.0",
15 "QtQml 2.2",
16 "QtQuick 2.7",
17 "QtQuick.Controls 2.0",
18 "QtQuick.Controls.Material 2.0",
19 "QtQuick.Controls.Material.impl 2.0",
20 "QtQuick.Controls.Universal 2.0",
21 "QtQuick.Controls.Universal.impl 2.0",
22 "QtQuick.Controls.impl 2.0",
23 "QtQuick.Layouts 1.1",
24 "QtQuick.Templates 2.0",
25 "QtQuick.Window 2.2"
26 ]
27 Component {
28 prototype: "QQuickApplicationWindow"
29 name: "QtQuick.Controls/ApplicationWindow 2.0"
30 exports: ["QtQuick.Controls/ApplicationWindow 2.0"]
31 exportMetaObjectRevisions: [0]
32 isComposite: true
33 defaultProperty: "data"
34 }
35 Component {
36 prototype: "QQuickItem"
37 name: "QtQuick.Controls.Material.impl/BoxShadow 2.0"
38 exports: ["QtQuick.Controls.Material.impl/BoxShadow 2.0"]
39 exportMetaObjectRevisions: [0]
40 isComposite: true
41 defaultProperty: "data"
42 Property { name: "offsetX"; type: "int" }
43 Property { name: "offsetY"; type: "int" }
44 Property { name: "blurRadius"; type: "int" }
45 Property { name: "spreadRadius"; type: "int" }
46 Property { name: "source"; type: "QQuickItem"; isPointer: true }
47 Property { name: "fullWidth"; type: "bool" }
48 Property { name: "fullHeight"; type: "bool" }
49 Property { name: "glowRadius"; type: "double" }
50 Property { name: "spread"; type: "double" }
51 Property { name: "color"; type: "QColor" }
52 Property { name: "cornerRadius"; type: "double" }
53 Property { name: "cached"; type: "bool" }
54 }
55 Component {
56 prototype: "QQuickBusyIndicator"
57 name: "QtQuick.Controls/BusyIndicator 2.0"
58 exports: ["QtQuick.Controls/BusyIndicator 2.0"]
59 exportMetaObjectRevisions: [0]
60 isComposite: true
61 defaultProperty: "data"
62 }
63 Component {
64 prototype: "QQuickButton"
65 name: "QtQuick.Controls/Button 2.0"
66 exports: ["QtQuick.Controls/Button 2.0"]
67 exportMetaObjectRevisions: [0]
68 isComposite: true
69 defaultProperty: "data"
70 }
71 Component {
72 prototype: "QQuickCheckBox"
73 name: "QtQuick.Controls/CheckBox 2.0"
74 exports: ["QtQuick.Controls/CheckBox 2.0"]
75 exportMetaObjectRevisions: [0]
76 isComposite: true
77 defaultProperty: "data"
78 }
79 Component {
80 prototype: "QQuickCheckDelegate"
81 name: "QtQuick.Controls/CheckDelegate 2.0"
82 exports: ["QtQuick.Controls/CheckDelegate 2.0"]
83 exportMetaObjectRevisions: [0]
84 isComposite: true
85 defaultProperty: "data"
86 }
87 Component {
88 prototype: "QQuickRectangle"
89 name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0"
90 exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"]
91 exportMetaObjectRevisions: [0]
92 isComposite: true
93 defaultProperty: "data"
94 Property { name: "control"; type: "QQuickItem"; isPointer: true }
95 }
96 Component {
97 prototype: "QQuickRectangle"
98 name: "QtQuick.Controls.impl/CheckIndicator 2.0"
99 exports: ["QtQuick.Controls.impl/CheckIndicator 2.0"]
100 exportMetaObjectRevisions: [0]
101 isComposite: true
102 defaultProperty: "data"
103 Property { name: "control"; type: "QQuickItem"; isPointer: true }
104 }
105 Component {
106 prototype: "QQuickComboBox"
107 name: "QtQuick.Controls/ComboBox 2.0"
108 exports: ["QtQuick.Controls/ComboBox 2.0"]
109 exportMetaObjectRevisions: [0]
110 isComposite: true
111 defaultProperty: "data"
112 }
113 Component {
114 prototype: "QQuickDial"
115 name: "QtQuick.Controls/Dial 2.0"
116 exports: ["QtQuick.Controls/Dial 2.0"]
117 exportMetaObjectRevisions: [0]
118 isComposite: true
119 defaultProperty: "data"
120 }
121 Component {
122 prototype: "QQuickDrawer"
123 name: "QtQuick.Controls/Drawer 2.0"
124 exports: ["QtQuick.Controls/Drawer 2.0"]
125 exportMetaObjectRevisions: [0]
126 isComposite: true
127 defaultProperty: "contentData"
128 }
129 Component {
130 prototype: "QQuickItem"
131 name: "QtQuick.Controls.Material.impl/ElevationEffect 2.0"
132 exports: ["QtQuick.Controls.Material.impl/ElevationEffect 2.0"]
133 exportMetaObjectRevisions: [0]
134 isComposite: true
135 defaultProperty: "data"
136 Property { name: "source"; type: "QVariant" }
137 Property { name: "elevation"; type: "int" }
138 Property { name: "fullWidth"; type: "bool" }
139 Property { name: "fullHeight"; type: "bool" }
140 Property { name: "sourceItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
141 Property { name: "_shadows"; type: "QVariant"; isReadonly: true }
142 Property { name: "_shadow"; type: "QVariant"; isReadonly: true }
143 }
144 Component {
145 prototype: "QObject"
146 name: "FluidStyle 1.0"
147 exports: ["FluidStyle 1.0"]
148 exportMetaObjectRevisions: [0]
149 isComposite: true
150 isCreatable: false
151 isSingleton: true
152 Property { name: "iconColorLight"; type: "QColor"; isReadonly: true }
153 Property { name: "iconColorDark"; type: "QColor"; isReadonly: true }
154 Property { name: "display4Font"; type: "QFont"; isReadonly: true }
155 Property { name: "display3Font"; type: "QFont"; isReadonly: true }
156 Property { name: "display2Font"; type: "QFont"; isReadonly: true }
157 Property { name: "display1Font"; type: "QFont"; isReadonly: true }
158 Property { name: "headlineFont"; type: "QFont"; isReadonly: true }
159 Property { name: "titleFont"; type: "QFont"; isReadonly: true }
160 Property { name: "subheadingFont"; type: "QFont"; isReadonly: true }
161 Property { name: "body2Font"; type: "QFont"; isReadonly: true }
162 Property { name: "body1Font"; type: "QFont"; isReadonly: true }
163 Property { name: "captionFont"; type: "QFont"; isReadonly: true }
164 Property { name: "buttonFont"; type: "QFont"; isReadonly: true }
165 Property { name: "subheaderFont"; type: "QFont"; isReadonly: true }
166 Property { name: "dialogFont"; type: "QFont"; isReadonly: true }
167 }
168 Component {
169 prototype: "QQuickFrame"
170 name: "QtQuick.Controls/Frame 2.0"
171 exports: ["QtQuick.Controls/Frame 2.0"]
172 exportMetaObjectRevisions: [0]
173 isComposite: true
174 defaultProperty: "contentData"
175 }
176 Component {
177 prototype: "QQuickGroupBox"
178 name: "QtQuick.Controls/GroupBox 2.0"
179 exports: ["QtQuick.Controls/GroupBox 2.0"]
180 exportMetaObjectRevisions: [0]
181 isComposite: true
182 defaultProperty: "contentData"
183 }
184 Component {
185 prototype: "QQuickItemDelegate"
186 name: "QtQuick.Controls/ItemDelegate 2.0"
187 exports: ["QtQuick.Controls/ItemDelegate 2.0"]
188 exportMetaObjectRevisions: [0]
189 isComposite: true
190 defaultProperty: "data"
191 }
192 Component {
193 prototype: "QQuickLabel"
194 name: "QtQuick.Controls/Label 2.0"
195 exports: ["QtQuick.Controls/Label 2.0"]
196 exportMetaObjectRevisions: [0]
197 isComposite: true
198 defaultProperty: "data"
199 }
200 Component {
201 prototype: "QQuickMenu"
202 name: "QtQuick.Controls/Menu 2.0"
203 exports: ["QtQuick.Controls/Menu 2.0"]
204 exportMetaObjectRevisions: [0]
205 isComposite: true
206 defaultProperty: "contentData"
207 }
208 Component {
209 prototype: "QQuickMenuItem"
210 name: "QtQuick.Controls/MenuItem 2.0"
211 exports: ["QtQuick.Controls/MenuItem 2.0"]
212 exportMetaObjectRevisions: [0]
213 isComposite: true
214 defaultProperty: "data"
215 }
216 Component {
217 prototype: "QQuickPage"
218 name: "QtQuick.Controls/Page 2.0"
219 exports: ["QtQuick.Controls/Page 2.0"]
220 exportMetaObjectRevisions: [0]
221 isComposite: true
222 defaultProperty: "contentData"
223 }
224 Component {
225 prototype: "QQuickPageIndicator"
226 name: "QtQuick.Controls/PageIndicator 2.0"
227 exports: ["QtQuick.Controls/PageIndicator 2.0"]
228 exportMetaObjectRevisions: [0]
229 isComposite: true
230 defaultProperty: "data"
231 }
232 Component {
233 prototype: "QQuickPane"
234 name: "QtQuick.Controls/Pane 2.0"
235 exports: ["QtQuick.Controls/Pane 2.0"]
236 exportMetaObjectRevisions: [0]
237 isComposite: true
238 defaultProperty: "contentData"
239 }
240 Component {
241 prototype: "QQuickPopup"
242 name: "QtQuick.Controls/Popup 2.0"
243 exports: ["QtQuick.Controls/Popup 2.0"]
244 exportMetaObjectRevisions: [0]
245 isComposite: true
246 defaultProperty: "contentData"
247 }
248 Component {
249 prototype: "QQuickProgressBar"
250 name: "QtQuick.Controls/ProgressBar 2.0"
251 exports: ["QtQuick.Controls/ProgressBar 2.0"]
252 exportMetaObjectRevisions: [0]
253 isComposite: true
254 defaultProperty: "data"
255 }
256 Component {
257 prototype: "QQuickRadioButton"
258 name: "QtQuick.Controls/RadioButton 2.0"
259 exports: ["QtQuick.Controls/RadioButton 2.0"]
260 exportMetaObjectRevisions: [0]
261 isComposite: true
262 defaultProperty: "data"
263 }
264 Component {
265 prototype: "QQuickRadioDelegate"
266 name: "QtQuick.Controls/RadioDelegate 2.0"
267 exports: ["QtQuick.Controls/RadioDelegate 2.0"]
268 exportMetaObjectRevisions: [0]
269 isComposite: true
270 defaultProperty: "data"
271 }
272 Component {
273 prototype: "QQuickRectangle"
274 name: "QtQuick.Controls.impl/RadioIndicator 2.0"
275 exports: ["QtQuick.Controls.impl/RadioIndicator 2.0"]
276 exportMetaObjectRevisions: [0]
277 isComposite: true
278 defaultProperty: "data"
279 Property { name: "control"; type: "QQuickItem"; isPointer: true }
280 }
281 Component {
282 prototype: "QQuickRectangle"
283 name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0"
284 exports: ["QtQuick.Controls.Universal.impl/RadioIndicator 2.0"]
285 exportMetaObjectRevisions: [0]
286 isComposite: true
287 defaultProperty: "data"
288 Property { name: "control"; type: "QVariant" }
289 }
290 Component {
291 prototype: "QQuickRangeSlider"
292 name: "QtQuick.Controls/RangeSlider 2.0"
293 exports: ["QtQuick.Controls/RangeSlider 2.0"]
294 exportMetaObjectRevisions: [0]
295 isComposite: true
296 defaultProperty: "data"
297 }
298 Component {
299 prototype: "QQuickRectangle"
300 name: "QtQuick.Controls.Material.impl/Ripple 2.0"
301 exports: ["QtQuick.Controls.Material.impl/Ripple 2.0"]
302 exportMetaObjectRevisions: [0]
303 isComposite: true
304 defaultProperty: "data"
305 Property { name: "control"; type: "QQuickItem"; isPointer: true }
306 Property { name: "colored"; type: "bool" }
307 }
308 Component {
309 prototype: "QQuickScrollBar"
310 name: "QtQuick.Controls/ScrollBar 2.0"
311 exports: ["QtQuick.Controls/ScrollBar 2.0"]
312 exportMetaObjectRevisions: [0]
313 isComposite: true
314 defaultProperty: "data"
315 }
316 Component {
317 prototype: "QQuickScrollIndicator"
318 name: "QtQuick.Controls/ScrollIndicator 2.0"
319 exports: ["QtQuick.Controls/ScrollIndicator 2.0"]
320 exportMetaObjectRevisions: [0]
321 isComposite: true
322 defaultProperty: "data"
323 }
324 Component {
325 prototype: "QQuickSlider"
326 name: "QtQuick.Controls/Slider 2.0"
327 exports: ["QtQuick.Controls/Slider 2.0"]
328 exportMetaObjectRevisions: [0]
329 isComposite: true
330 defaultProperty: "data"
331 }
332 Component {
333 prototype: "QQuickItem"
334 name: "QtQuick.Controls.Material.impl/SliderHandle 2.0"
335 exports: ["QtQuick.Controls.Material.impl/SliderHandle 2.0"]
336 exportMetaObjectRevisions: [0]
337 isComposite: true
338 defaultProperty: "data"
339 Property { name: "value"; type: "double" }
340 Property { name: "handleHasFocus"; type: "bool" }
341 Property { name: "handlePressed"; type: "bool" }
342 Property { name: "initialSize"; type: "int"; isReadonly: true }
343 Property { name: "horizontal"; type: "bool"; isReadonly: true }
344 Property { name: "control"; type: "QVariant"; isReadonly: true }
345 }
346 Component {
347 prototype: "QQuickSpinBox"
348 name: "QtQuick.Controls/SpinBox 2.0"
349 exports: ["QtQuick.Controls/SpinBox 2.0"]
350 exportMetaObjectRevisions: [0]
351 isComposite: true
352 defaultProperty: "data"
353 }
354 Component {
355 prototype: "QQuickStackView"
356 name: "QtQuick.Controls/StackView 2.0"
357 exports: ["QtQuick.Controls/StackView 2.0"]
358 exportMetaObjectRevisions: [0]
359 isComposite: true
360 defaultProperty: "data"
361 }
362 Component {
363 prototype: "QQuickSwipeDelegate"
364 name: "QtQuick.Controls/SwipeDelegate 2.0"
365 exports: ["QtQuick.Controls/SwipeDelegate 2.0"]
366 exportMetaObjectRevisions: [0]
367 isComposite: true
368 defaultProperty: "data"
369 }
370 Component {
371 prototype: "QQuickSwipeView"
372 name: "QtQuick.Controls/SwipeView 2.0"
373 exports: ["QtQuick.Controls/SwipeView 2.0"]
374 exportMetaObjectRevisions: [0]
375 isComposite: true
376 defaultProperty: "contentData"
377 }
378 Component {
379 prototype: "QQuickSwitch"
380 name: "QtQuick.Controls/Switch 2.0"
381 exports: ["QtQuick.Controls/Switch 2.0"]
382 exportMetaObjectRevisions: [0]
383 isComposite: true
384 defaultProperty: "data"
385 }
386 Component {
387 prototype: "QQuickSwitchDelegate"
388 name: "QtQuick.Controls/SwitchDelegate 2.0"
389 exports: ["QtQuick.Controls/SwitchDelegate 2.0"]
390 exportMetaObjectRevisions: [0]
391 isComposite: true
392 defaultProperty: "data"
393 }
394 Component {
395 prototype: "QQuickRectangle"
396 name: "QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"
397 exports: ["QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"]
398 exportMetaObjectRevisions: [0]
399 isComposite: true
400 defaultProperty: "data"
401 Property { name: "control"; type: "QQuickItem"; isPointer: true }
402 }
403 Component {
404 prototype: "QQuickItem"
405 name: "QtQuick.Controls.impl/SwitchIndicator 2.0"
406 exports: ["QtQuick.Controls.impl/SwitchIndicator 2.0"]
407 exportMetaObjectRevisions: [0]
408 isComposite: true
409 defaultProperty: "data"
410 Property { name: "control"; type: "QQuickItem"; isPointer: true }
411 }
412 Component {
413 prototype: "QQuickItem"
414 name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0"
415 exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"]
416 exportMetaObjectRevisions: [0]
417 isComposite: true
418 defaultProperty: "data"
419 Property { name: "control"; type: "QQuickItem"; isPointer: true }
420 }
421 Component {
422 prototype: "QQuickTabBar"
423 name: "QtQuick.Controls/TabBar 2.0"
424 exports: ["QtQuick.Controls/TabBar 2.0"]
425 exportMetaObjectRevisions: [0]
426 isComposite: true
427 defaultProperty: "contentData"
428 }
429 Component {
430 prototype: "QQuickTabButton"
431 name: "QtQuick.Controls/TabButton 2.0"
432 exports: ["QtQuick.Controls/TabButton 2.0"]
433 exportMetaObjectRevisions: [0]
434 isComposite: true
435 defaultProperty: "data"
436 }
437 Component {
438 prototype: "QQuickTextArea"
439 name: "QtQuick.Controls/TextArea 2.0"
440 exports: ["QtQuick.Controls/TextArea 2.0"]
441 exportMetaObjectRevisions: [0]
442 isComposite: true
443 defaultProperty: "data"
444 }
445 Component {
446 prototype: "QQuickTextField"
447 name: "QtQuick.Controls/TextField 2.0"
448 exports: ["QtQuick.Controls/TextField 2.0"]
449 exportMetaObjectRevisions: [0]
450 isComposite: true
451 defaultProperty: "data"
452 }
453 Component {
454 prototype: "QQuickToolBar"
455 name: "QtQuick.Controls/ToolBar 2.0"
456 exports: ["QtQuick.Controls/ToolBar 2.0"]
457 exportMetaObjectRevisions: [0]
458 isComposite: true
459 defaultProperty: "contentData"
460 }
461 Component {
462 prototype: "QQuickToolButton"
463 name: "QtQuick.Controls/ToolButton 2.0"
464 exports: ["QtQuick.Controls/ToolButton 2.0"]
465 exportMetaObjectRevisions: [0]
466 isComposite: true
467 defaultProperty: "data"
468 }
469 Component {
470 prototype: "QQuickToolTip"
471 name: "QtQuick.Controls/ToolTip 2.0"
472 exports: ["QtQuick.Controls/ToolTip 2.0"]
473 exportMetaObjectRevisions: [0]
474 isComposite: true
475 defaultProperty: "contentData"
476 }
477 Component {
478 prototype: "QQuickTumbler"
479 name: "QtQuick.Controls/Tumbler 2.0"
480 exports: ["QtQuick.Controls/Tumbler 2.0"]
481 exportMetaObjectRevisions: [0]
482 isComposite: true
483 defaultProperty: "data"
484 }
485 Component {
486 prototype: "QQuickItem"
487 name: "Units 1.0"
488 exports: ["Units 1.0"]
489 exportMetaObjectRevisions: [0]
490 isComposite: true
491 isCreatable: false
492 isSingleton: true
493 defaultProperty: "data"
494 Property { name: "gridUnit"; type: "int"; isReadonly: true }
495 Property { name: "smallSpacing"; type: "double"; isReadonly: true }
496 Property { name: "mediumSpacing"; type: "double"; isReadonly: true }
497 Property { name: "largeSpacing"; type: "double"; isReadonly: true }
498 Property { name: "shortDuration"; type: "int"; isReadonly: true }
499 Property { name: "mediumDuration"; type: "int"; isReadonly: true }
500 Property { name: "longDuration"; type: "int"; isReadonly: true }
501 Property { name: "iconSizes"; type: "QObject"; isReadonly: true; isPointer: true }
502 Method {
503 name: "gu"
504 type: "QVariant"
505 Parameter { name: "x"; type: "QVariant" }
506 }
507 Method {
508 name: "roundToIconSize"
509 type: "QVariant"
510 Parameter { name: "x"; type: "QVariant" }
511 }
512 }
513 Component {
514 prototype: "QObject"
515 name: "Utils 1.0"
516 exports: ["Utils 1.0"]
517 exportMetaObjectRevisions: [0]
518 isComposite: true
519 isCreatable: false
520 isSingleton: true
521 Method {
522 name: "asColor"
523 type: "QVariant"
524 Parameter { name: "color"; type: "QVariant" }
525 }
526 Method {
527 name: "alpha"
528 type: "QVariant"
529 Parameter { name: "color"; type: "QVariant" }
530 Parameter { name: "alpha"; type: "QVariant" }
531 }
532 Method {
533 name: "blendColors"
534 type: "QVariant"
535 Parameter { name: "color1"; type: "QVariant" }
536 Parameter { name: "color2"; type: "QVariant" }
537 Parameter { name: "a"; type: "QVariant" }
538 }
539 Method {
540 name: "luminance"
541 type: "QVariant"
542 Parameter { name: "color"; type: "QVariant" }
543 }
544 Method {
545 name: "lightDark"
546 type: "QVariant"
547 Parameter { name: "background"; type: "QVariant" }
548 Parameter { name: "lightColor"; type: "QVariant" }
549 Parameter { name: "darkColor"; type: "QVariant" }
550 }
551 Method {
552 name: "isDarkColor"
553 type: "QVariant"
554 Parameter { name: "color"; type: "QVariant" }
555 }
556 Method {
557 name: "getSourceForIconName"
558 type: "QVariant"
559 Parameter { name: "name"; type: "QVariant" }
560 }
561 Method {
562 name: "scale"
563 type: "QVariant"
564 Parameter { name: "percent"; type: "QVariant" }
565 Parameter { name: "start"; type: "QVariant" }
566 Parameter { name: "end"; type: "QVariant" }
567 }
568 }
569}
diff --git a/prototype_2016/third_party/fluid/controls/qmldir b/prototype_2016/third_party/fluid/controls/qmldir
new file mode 100644
index 0000000..1eb9813
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/qmldir
@@ -0,0 +1,41 @@
1module Fluid.Controls
2plugin fluidcontrols
3class FluidControlsPlugin
4typeinfo plugins.qmltypes
5
6Action 1.0 Action.qml
7AppBar 1.0 AppBar.qml
8AppToolBar 1.0 AppToolBar.qml
9BaseListItem 1.0 BaseListItem.qml
10BodyLabel 1.0 BodyLabel.qml
11CaptionLabel 1.0 CaptionLabel.qml
12Card 1.0 Card.qml
13CircleImage 1.0 CircleImage.qml
14Dialog 1.0 Dialog.qml
15DialogLabel 1.0 DialogLabel.qml
16DisplayLabel 1.0 DisplayLabel.qml
17FluidWindow 1.0 FluidWindow.qml
18HeadlineLabel 1.0 HeadlineLabel.qml
19IconButton 1.0 IconButton.qml
20Icon 1.0 Icon.qml
21InfoBar 1.0 InfoBar.qml
22ListItemDelegate 1.0 ListItemDelegate.qml
23ListItem 1.0 ListItem.qml
24Loadable 1.0 Loadable.qml
25NavigationDrawer 1.0 NavigationDrawer.qml
26NoiseBackground 1.0 NoiseBackground.qml
27Page 1.0 Page.qml
28PageStack 1.0 PageStack.qml
29Placeholder 1.0 Placeholder.qml
30Showable 1.0 Showable.qml
31Sidebar 1.0 Sidebar.qml
32SmoothFadeImage 1.0 SmoothFadeImage.qml
33SmoothFadeLoader 1.0 SmoothFadeLoader.qml
34Subheader 1.0 Subheader.qml
35SubheadingLabel 1.0 SubheadingLabel.qml
36Tab 1.0 Tab.qml
37TabbedPage 1.0 TabbedPage.qml
38ThinDivider 1.0 ThinDivider.qml
39TitleLabel 1.0 TitleLabel.qml
40singleton FluidStyle 1.0 FluidStyle.qml
41singleton Units 1.0 Units.qml
diff --git a/prototype_2016/third_party/fluid/controls/qmldir_noplugin b/prototype_2016/third_party/fluid/controls/qmldir_noplugin
new file mode 100644
index 0000000..07b7dcb
--- /dev/null
+++ b/prototype_2016/third_party/fluid/controls/qmldir_noplugin
@@ -0,0 +1,39 @@
1module Fluid.Controls
2typeinfo plugins.qmltypes
3
4Action 1.0 Action.qml
5AppBar 1.0 AppBar.qml
6AppToolBar 1.0 AppToolBar.qml
7BaseListItem 1.0 BaseListItem.qml
8BodyLabel 1.0 BodyLabel.qml
9CaptionLabel 1.0 CaptionLabel.qml
10Card 1.0 Card.qml
11CircleImage 1.0 CircleImage.qml
12Dialog 1.0 Dialog.qml
13DialogLabel 1.0 DialogLabel.qml
14DisplayLabel 1.0 DisplayLabel.qml
15FluidWindow 1.0 FluidWindow.qml
16HeadlineLabel 1.0 HeadlineLabel.qml
17IconButton 1.0 IconButton.qml
18Icon 1.0 Icon.qml
19InfoBar 1.0 InfoBar.qml
20ListItemDelegate 1.0 ListItemDelegate.qml
21ListItem 1.0 ListItem.qml
22Loadable 1.0 Loadable.qml
23NavigationDrawer 1.0 NavigationDrawer.qml
24NoiseBackground 1.0 NoiseBackground.qml
25Page 1.0 Page.qml
26PageStack 1.0 PageStack.qml
27Placeholder 1.0 Placeholder.qml
28Showable 1.0 Showable.qml
29Sidebar 1.0 Sidebar.qml
30SmoothFadeImage 1.0 SmoothFadeImage.qml
31SmoothFadeLoader 1.0 SmoothFadeLoader.qml
32Subheader 1.0 Subheader.qml
33SubheadingLabel 1.0 SubheadingLabel.qml
34Tab 1.0 Tab.qml
35TabbedPage 1.0 TabbedPage.qml
36ThinDivider 1.0 ThinDivider.qml
37TitleLabel 1.0 TitleLabel.qml
38singleton FluidStyle 1.0 FluidStyle.qml
39singleton Units 1.0 Units.qml
diff --git a/prototype_2016/third_party/fluid/core/CMakeLists.txt b/prototype_2016/third_party/fluid/core/CMakeLists.txt
new file mode 100644
index 0000000..21bd974
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/CMakeLists.txt
@@ -0,0 +1,32 @@
1include_directories(
2 "${CMAKE_CURRENT_BINARY_DIR}/../src"
3 "${CMAKE_CURRENT_BINARY_DIR}/../src/Fluid"
4)
5
6add_definitions(-DQT_PLUGIN)
7
8set(SOURCES
9 plugin.cpp
10 clipboard.cpp
11 qmldateutils.cpp
12 device.cpp
13 iconsimageprovider.cpp
14 qqmlsortfilterproxymodel.cpp
15 standardpaths.cpp
16)
17
18add_library(fluidcore SHARED ${SOURCES})
19target_link_libraries(fluidcore Qt5::Svg Qt5::Gui Qt5::Quick Fluid)
20
21set(FILES
22 plugins.qmltypes
23 qmldir
24 Object.qml
25 PlatformExtensions.qml
26 Utils.qml
27)
28
29install(TARGETS fluidcore LIBRARY
30 DESTINATION ${QML_INSTALL_DIR}/Fluid/Core)
31install(FILES ${FILES}
32 DESTINATION ${QML_INSTALL_DIR}/Fluid/Core)
diff --git a/prototype_2016/third_party/fluid/core/Object.qml b/prototype_2016/third_party/fluid/core/Object.qml
new file mode 100644
index 0000000..abfcdde
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/Object.qml
@@ -0,0 +1,38 @@
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
17/*!
18 \qmltype Object
19 \inqmlmodule Fluid.Core
20 \ingroup fluidcore
21
22 \brief A QtObject with children.
23
24 The \l Object type is a non-visual element that extends \l QtObject
25 with the ability to hold children objects.
26*/
27QtObject {
28 default property alias children: object.__children
29
30 /*!
31 \qmlproperty list<QtObject> Object::children
32
33 Children objects.
34 */
35 property list<QtObject> __children: [QtObject {}]
36
37 id: object
38}
diff --git a/prototype_2016/third_party/qml-material/src/core/PlatformExtensions.qml b/prototype_2016/third_party/fluid/core/PlatformExtensions.qml
index 8e8f4c1..ba9dcdb 100644
--- a/prototype_2016/third_party/qml-material/src/core/PlatformExtensions.qml
+++ b/prototype_2016/third_party/fluid/core/PlatformExtensions.qml
@@ -1,24 +1,27 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> 4 * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com>
5 * 5 *
6 * $BEGIN_LICENSE:MPL2$
7 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 8 * 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 9 * 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/. 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
9 */ 13 */
10 14
11import QtQuick 2.0 15import QtQuick 2.0
12import Material 0.3 16import Fluid.Core 1.0
13 17
14Object { 18Object {
15 id: platform 19 id: platform
16 20
17 property var platformExtensions 21 property var platformExtensions
18 22
19 property color decorationColor: Theme.primaryDarkColor 23 property color decorationColor
20 property var window: null 24 property var window: null
21 readonly property real multiplier: platformExtensions ? platformExtensions.multiplier : 1
22 25
23 onDecorationColorChanged: { 26 onDecorationColorChanged: {
24 if (platformExtensions && color != "#000000") { 27 if (platformExtensions && color != "#000000") {
@@ -34,8 +37,8 @@ Object {
34 37
35 Component.onCompleted: { 38 Component.onCompleted: {
36 try { 39 try {
37 var code = 'import Papyros.Material 0.1; PlatformExtensions {}' 40 var code = 'import Liri.Platform 1.0; PlatformExtensions {}'
38 platformExtensions = Qt.createQmlObject(code, platform, "PapyrosExtensions"); 41 platformExtensions = Qt.createQmlObject(code, platform, "LiriExtensions");
39 42
40 platformExtensions.window = window 43 platformExtensions.window = window
41 if (decorationColor != "#000000") 44 if (decorationColor != "#000000")
diff --git a/prototype_2016/third_party/fluid/core/Utils.qml b/prototype_2016/third_party/fluid/core/Utils.qml
new file mode 100644
index 0000000..7d3a480
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/Utils.qml
@@ -0,0 +1,106 @@
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
17
18pragma Singleton
19
20/*!
21 \qmltype Utils
22 \inqmlmodule Fluid.Core
23 \ingroup fluidcore
24
25 \brief A collection of helpful utility methods.
26
27 Currently the only utility methods are for working with colors.
28*/
29QtObject {
30 /*!
31 Make sure we have a real \l color object to work with (versus a string like "#ccc")
32 */
33 function asColor(color) {
34 return Qt.darker(color, 1)
35 }
36
37 /*!
38 A utility method for changing the alpha on colors. Returns a new object, and does not
39 modify the original color at all.
40 */
41 function alpha(color, alpha) {
42 color = asColor(color)
43
44 color.a = alpha
45
46 return color
47 }
48
49 /*!
50 Blend \a color1 and \a color2 together and set alpha to \a a.
51 */
52 function blendColors(color1, color2, a) {
53 return alpha(Qt.tint(color1, color2), a)
54 }
55
56 /*!
57 Calculate luminance of \a color.
58 */
59 function luminance(color) {
60 color = asColor(color)
61 return (color.r * 0.2126) + (color.g * 0.7152) + (color.b * 0.0722)
62 }
63
64 /*!
65 Select a color depending on whether \a background color is light or dark.
66 Returns \a lightColor if \a background is a light color, otherwise
67 returns \a darkColor.
68 */
69 function lightDark(background, lightColor, darkColor) {
70 return isDarkColor(background) ? darkColor : lightColor
71 }
72
73 /*!
74 Returns \c true if \a color is dark and should have light content on top.
75 */
76 function isDarkColor(color) {
77 color = asColor(color)
78
79 var a = 1 - (0.299 * color.r + 0.587 * color.g + 0.114 * color.b)
80
81 return color.a > 0 && a >= 0.3
82 }
83
84 /*!
85 Returns a source suitable for an \l Image from an icon name.
86 If \a name is an URL it will be returned verbatim, instead if it
87 contains a slash character an icon relative to Fluid icons/ directory
88 will be returned, otherwise an image://fluidicontheme/\a name URL.
89 */
90 function getSourceForIconName(name) {
91 return name ? name.indexOf("/") === 0 || name.indexOf("file://") === 0 || name.indexOf("qrc") === 0
92 ? name
93 : name.indexOf("/") !== -1 ? "image://fluidicons/" + name
94 : "image://fluidicontheme/" + name
95 : ""
96 }
97
98 /*!
99 Scale \a percent in the range between \a start and \a end.
100 */
101 function scale(percent, start, end) {
102 var diff = end - start
103
104 return start + percent * diff
105 }
106}
diff --git a/prototype_2016/third_party/fluid/core/clipboard.cpp b/prototype_2016/third_party/fluid/core/clipboard.cpp
new file mode 100644
index 0000000..79280d3
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/clipboard.cpp
@@ -0,0 +1,54 @@
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
16#include "clipboard.h"
17
18#include <QGuiApplication>
19
20/*!
21 \qmltype Clipboard
22 \inqmlmodule Fluid.Core
23 \ingroup fluidcore
24
25 \brief Clipboard.
26*/
27
28Clipboard::Clipboard(QObject *parent)
29 : QObject(parent)
30 , m_clipboard(QGuiApplication::clipboard())
31{
32 connect(m_clipboard, &QClipboard::dataChanged, this, &Clipboard::textChanged);
33}
34
35/*!
36 \qmlproperty string Clipboard::text
37
38 This property holds the clipboard text.
39*/
40
41QString Clipboard::text() const
42{
43 return m_clipboard->text();
44}
45
46void Clipboard::clear()
47{
48 m_clipboard->clear();
49}
50
51void Clipboard::setText(const QString &text)
52{
53 m_clipboard->setText(text);
54}
diff --git a/prototype_2016/third_party/fluid/core/clipboard.h b/prototype_2016/third_party/fluid/core/clipboard.h
new file mode 100644
index 0000000..72b19e7
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/clipboard.h
@@ -0,0 +1,41 @@
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
15#pragma once
16
17#include <QObject>
18#include <QClipboard>
19
20class Clipboard : public QObject
21{
22 Q_OBJECT
23
24 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
25
26public:
27 explicit Clipboard(QObject *parent = nullptr);
28
29 QString text() const;
30
31 Q_INVOKABLE void clear();
32
33public Q_SLOTS:
34 void setText(const QString &text);
35
36Q_SIGNALS:
37 void textChanged();
38
39private:
40 QClipboard *m_clipboard = nullptr;
41};
diff --git a/prototype_2016/third_party/fluid/core/core.pri b/prototype_2016/third_party/fluid/core/core.pri
new file mode 100644
index 0000000..16b7b9d
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/core.pri
@@ -0,0 +1,19 @@
1HEADERS += \
2 $$PWD/clipboard.h \
3 $$PWD/device.h \
4 $$PWD/iconsimageprovider.h \
5 $$PWD/qmldateutils.h \
6 $$PWD/qqmlsortfilterproxymodel.h \
7 $$PWD/standardpaths.h
8
9SOURCES += \
10 $$PWD/clipboard.cpp \
11 $$PWD/device.cpp \
12 $$PWD/iconsimageprovider.cpp \
13 $$PWD/plugin.cpp \
14 $$PWD/qmldateutils.cpp \
15 $$PWD/qqmlsortfilterproxymodel.cpp \
16 $$PWD/standardpaths.cpp
17
18RESOURCES += \
19 $$PWD/core.qrc
diff --git a/prototype_2016/third_party/fluid/core/core.qrc b/prototype_2016/third_party/fluid/core/core.qrc
new file mode 100644
index 0000000..3b17685
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/core.qrc
@@ -0,0 +1,8 @@
1<RCC>
2 <qresource prefix="/Fluid/Core">
3 <file>Object.qml</file>
4 <file>PlatformExtensions.qml</file>
5 <file>Utils.qml</file>
6 <file alias="qmldir">qmldir_noplugin</file>
7 </qresource>
8</RCC>
diff --git a/prototype_2016/third_party/qml-material/src/core/device.cpp b/prototype_2016/third_party/fluid/core/device.cpp
index 7ca842c..07046b8 100644
--- a/prototype_2016/third_party/qml-material/src/core/device.cpp
+++ b/prototype_2016/third_party/fluid/core/device.cpp
@@ -1,40 +1,33 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> 4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
5 * 7 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 8 * 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 9 * 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/. 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
9 */ 13 */
10 14
11#include "device.h" 15#include "device.h"
12 16
13Device::Device(QObject *parent) 17Device::Device(QObject *parent)
14 : QObject(parent) 18 : 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
25QObject *Device::qmlSingleton(QQmlEngine *engine, QJSEngine *scriptEngine)
26{ 19{
27 Q_UNUSED(engine) 20 m_screen = qGuiApp->primaryScreen();
28 Q_UNUSED(scriptEngine)
29 21
30 return new Device(); 22 connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &Device::screenChanged);
31} 23}
32 24
33Device::FormFactor Device::formFactor() const 25Device::FormFactor Device::formFactor() const
34{ 26{
35 float diagonal = calculateDiagonal(); 27 float diagonal = calculateDiagonal();
36 28
37 if (diagonal >= 3.5 && diagonal < 5) { //iPhone 1st generation to phablet 29 if (diagonal >= 3.5 && diagonal < 5) {
30 // iPhone 1st generation to phablet
38 return Device::Phone; 31 return Device::Phone;
39 } else if (diagonal >= 5 && diagonal < 6.5) { 32 } else if (diagonal >= 5 && diagonal < 6.5) {
40 return Device::Phablet; 33 return Device::Phablet;
@@ -52,39 +45,39 @@ Device::FormFactor Device::formFactor() const
52QString Device::name() const 45QString Device::name() const
53{ 46{
54 switch (formFactor()) { 47 switch (formFactor()) {
55 case Phone: 48 case Phone:
56 return tr("phone"); 49 return tr("phone");
57 case Phablet: 50 case Phablet:
58 return tr("phablet"); 51 return tr("phablet");
59 case Tablet: 52 case Tablet:
60 return tr("tablet"); 53 return tr("tablet");
61 case Computer: 54 case Computer:
62 return tr("computer"); 55 return tr("computer");
63 case TV: 56 case TV:
64 return tr("TV"); 57 return tr("TV");
65 case Unknown: 58 case Unknown:
66 return tr("device"); 59 return tr("device");
67 default: 60 default:
68 return tr("unknown"); 61 return tr("unknown");
69 } 62 }
70} 63}
71 64
72QString Device::iconName() const 65QString Device::iconName() const
73{ 66{
74 switch (formFactor()) { 67 switch (formFactor()) {
75 case Phone: 68 case Phone:
76 return "hardware/smartphone"; 69 return "hardware/smartphone";
77 case Phablet: 70 case Phablet:
78 return "hardware/tablet"; 71 return "hardware/tablet";
79 case Tablet: 72 case Tablet:
80 return "hardware/tablet"; 73 return "hardware/tablet";
81 case Computer: 74 case Computer:
82 return "hardware/desktop_windows"; 75 return "hardware/desktop_windows";
83 case TV: 76 case TV:
84 return "hardware/tv"; 77 return "hardware/tv";
85 case Unknown: 78 case Unknown:
86 default: 79 default:
87 return "hardware/computer"; 80 return "hardware/computer";
88 } 81 }
89} 82}
90 83
@@ -100,7 +93,7 @@ bool Device::hasTouchScreen() const
100 return true; 93 return true;
101#else 94#else
102 const auto devices = QTouchDevice::devices(); 95 const auto devices = QTouchDevice::devices();
103 foreach(const QTouchDevice *dev, devices) { 96 foreach (const QTouchDevice *dev, devices) {
104 if (dev->type() == QTouchDevice::TouchScreen) 97 if (dev->type() == QTouchDevice::TouchScreen)
105 return true; 98 return true;
106 } 99 }
@@ -110,7 +103,8 @@ bool Device::hasTouchScreen() const
110 103
111bool Device::isMobile() const 104bool Device::isMobile() const
112{ 105{
113#if defined(Q_OS_IOS) || defined(Q_OS_ANDROID) || defined(Q_OS_BLACKBERRY) || defined(Q_OS_QNX) || defined(Q_OS_WINRT) 106#if defined(Q_OS_IOS) || defined(Q_OS_ANDROID) || defined(Q_OS_BLACKBERRY) || defined(Q_OS_QNX) \
107 || defined(Q_OS_WINRT)
114 return true; 108 return true;
115#else 109#else
116 if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE")) { 110 if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE")) {
@@ -143,8 +137,7 @@ void Device::screenChanged()
143 if (m_screen) 137 if (m_screen)
144 m_screen->disconnect(this); 138 m_screen->disconnect(this);
145 139
146 QGuiApplication *app = (QGuiApplication *) QGuiApplication::instance(); 140 m_screen = qGuiApp->primaryScreen();
147 m_screen = app->primaryScreen();
148 141
149 connect(m_screen, &QScreen::geometryChanged, this, &Device::geometryChanged); 142 connect(m_screen, &QScreen::geometryChanged, this, &Device::geometryChanged);
150 143
@@ -153,6 +146,7 @@ void Device::screenChanged()
153 146
154float Device::calculateDiagonal() const 147float Device::calculateDiagonal() const
155{ 148{
156 return sqrt(pow((m_screen->physicalSize().width()), 2) + 149 return sqrt(pow((m_screen->physicalSize().width()), 2)
157 pow((m_screen->physicalSize().height()), 2)) * 0.039370; 150 + pow((m_screen->physicalSize().height()), 2))
151 * 0.039370;
158} 152}
diff --git a/prototype_2016/third_party/qml-material/src/core/device.h b/prototype_2016/third_party/fluid/core/device.h
index 682de79..113de03 100644
--- a/prototype_2016/third_party/qml-material/src/core/device.h
+++ b/prototype_2016/third_party/fluid/core/device.h
@@ -1,15 +1,18 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2016 Michael Spencer <sonrisesoftware@gmail.com> 4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
5 * 7 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 8 * 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 9 * 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/. 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
9 */ 13 */
10 14
11 #ifndef DEVICE_H 15#pragma once
12 #define DEVICE_H
13 16
14#include <QObject> 17#include <QObject>
15 18
@@ -19,7 +22,8 @@
19#include <QScreen> 22#include <QScreen>
20#include <QTouchDevice> 23#include <QTouchDevice>
21 24
22class Device : public QObject { 25class Device : public QObject
26{
23 Q_OBJECT 27 Q_OBJECT
24 28
25 Q_PROPERTY(FormFactor formFactor READ formFactor NOTIFY geometryChanged) 29 Q_PROPERTY(FormFactor formFactor READ formFactor NOTIFY geometryChanged)
@@ -34,20 +38,11 @@ class Device : public QObject {
34 Q_PROPERTY(int gridUnit READ gridUnit NOTIFY geometryChanged) 38 Q_PROPERTY(int gridUnit READ gridUnit NOTIFY geometryChanged)
35 39
36public: 40public:
37 enum FormFactor { 41 enum FormFactor { Phone, Phablet, Tablet, Computer, TV, Unknown };
38 Phone,
39 Phablet,
40 Tablet,
41 Computer,
42 TV,
43 Unknown
44 };
45 Q_ENUM(FormFactor) 42 Q_ENUM(FormFactor)
46 43
47 Device(QObject *parent = nullptr); 44 Device(QObject *parent = nullptr);
48 45
49 static QObject *qmlSingleton(QQmlEngine *engine, QJSEngine *scriptEngine);
50
51 FormFactor formFactor() const; 46 FormFactor formFactor() const;
52 QString name() const; 47 QString name() const;
53 QString iconName() const; 48 QString iconName() const;
@@ -58,12 +53,11 @@ public:
58 bool hoverEnabled() const; 53 bool hoverEnabled() const;
59 54
60 int gridUnit() const; 55 int gridUnit() const;
61 int dpMultiplier() const;
62 56
63signals: 57Q_SIGNALS:
64 void geometryChanged(); 58 void geometryChanged();
65 59
66private slots: 60private Q_SLOTS:
67 void screenChanged(); 61 void screenChanged();
68 62
69private: 63private:
@@ -71,5 +65,3 @@ private:
71 65
72 QScreen *m_screen; 66 QScreen *m_screen;
73}; 67};
74
75#endif // DEVICE_H
diff --git a/prototype_2016/third_party/fluid/core/doc/fluidcore.qdocconf b/prototype_2016/third_party/fluid/core/doc/fluidcore.qdocconf
new file mode 100644
index 0000000..ffeb2b0
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/doc/fluidcore.qdocconf
@@ -0,0 +1,47 @@
1include(../../doc/defaults.qdocconf)
2
3project = FluidCore
4description = Fluid Core Reference Documentation
5version = $FLUID_VERSION
6
7qhp.projects = FluidCore
8
9qhp.Fluid.file = fluidcore.qhp
10qhp.Fluid.namespace = io.liri.fluidcore.$FLUID_VERSION_TAG
11qhp.Fluid.virtualFolder = fluidcore
12qhp.Fluid.indexTitle = Fluid Core
13qhp.Fluid.indexRoot =
14
15qhp.Fluid.filterAttributes = fluidcore $FLUID_VERSION qtrefdoc
16qhp.Fluid.customFilters.Qt.name = FluidCore $FLUID_VERSION
17qhp.Fluid.customFilters.Qt.filterAttributes = fluidcore $FLUID_VERSION
18
19qhp.Fluid.subprojects = qmltypes classes examples
20qhp.Fluid.subprojects.qmltypes.title = QML Types
21qhp.Fluid.subprojects.qmltypes.indexTitle = Fluid Core QML Types
22qhp.Fluid.subprojects.qmltypes.selectors = qmlclass
23qhp.Fluid.subprojects.qmltypes.sortPages = true
24qhp.Fluid.subprojects.classes.title = C++ Classes
25qhp.Fluid.subprojects.classes.indexTitle = Fluid Core C++ Classes
26qhp.Fluid.subprojects.classes.selectors = class fake:headerfile
27qhp.Fluid.subprojects.classes.sortPages = true
28qhp.Fluid.subprojects.examples.title = Examples
29qhp.Fluid.subprojects.examples.indexTitle = Fluid Core Examples
30qhp.Fluid.subprojects.examples.selectors = fake:example
31
32# Specify the install path under QT_INSTALL_EXAMPLES
33# Note: paths passed to \example command must contain the parent directory, e.g.
34# \example controls/tabs
35#exampledirs += snippets
36
37#examplesinstallpath = fluid
38
39headerdirs += .
40
41sourcedirs += . src
42
43imagedirs += images
44
45navigation.landingpage = "Fluid Core"
46navigation.qmltypespage = "Fluid Core QML Types"
47navigation.cppclassespage = "Fluid Core C++ Classes"
diff --git a/prototype_2016/third_party/fluid/core/iconsimageprovider.cpp b/prototype_2016/third_party/fluid/core/iconsimageprovider.cpp
new file mode 100644
index 0000000..2ffbe10
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/iconsimageprovider.cpp
@@ -0,0 +1,67 @@
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
15#include <QtCore/QDir>
16#include <QtSvg/QSvgRenderer>
17#include <QtGui/QPainter>
18#include <QtQml/QQmlEngine>
19
20#include "iconsimageprovider.h"
21
22IconsImageProvider::IconsImageProvider()
23 : QQuickImageProvider(QQuickImageProvider::Image)
24{
25}
26
27QImage IconsImageProvider::requestImage(const QString &id, QSize *realSize,
28 const QSize &requestedSize)
29{
30 // Sanitize requested size
31 QSize size(requestedSize);
32 if (size.width() < 1)
33 size.setWidth(1);
34 if (size.height() < 1)
35 size.setHeight(1);
36
37 // Return real size
38 if (realSize)
39 *realSize = size;
40
41#ifdef FLUID_LOCAL
42 QSvgRenderer renderer(QLatin1String("qrc:/Fluid/Controls/") + id + QLatin1String(".svg"));
43 QImage image(size, QImage::Format_ARGB32);
44 image.fill(Qt::transparent);
45 QPainter painter(&image);
46 renderer.render(&painter);
47 return image;
48#else
49 const QString targetPath = QStringLiteral("Fluid/Controls/icons");
50 const QStringList importPaths = QQmlEngine().importPathList();
51
52 for (const QString &importPath: importPaths) {
53 QDir dir(importPath);
54 if (dir.exists(targetPath)) {
55 QDir targetDir(dir.absoluteFilePath(targetPath));
56 QSvgRenderer renderer(targetDir.absoluteFilePath(id + QLatin1String(".svg")));
57 QImage image(size, QImage::Format_ARGB32);
58 image.fill(Qt::transparent);
59 QPainter painter(&image);
60 renderer.render(&painter);
61 return image;
62 }
63 }
64
65 return QImage();
66#endif
67}
diff --git a/prototype_2016/third_party/fluid/core/iconsimageprovider.h b/prototype_2016/third_party/fluid/core/iconsimageprovider.h
new file mode 100644
index 0000000..f30a705
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/iconsimageprovider.h
@@ -0,0 +1,25 @@
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
15#pragma once
16
17#include <QtQuick/QQuickImageProvider>
18
19class IconsImageProvider : public QQuickImageProvider
20{
21public:
22 IconsImageProvider();
23
24 QImage requestImage(const QString &id, QSize *realSize, const QSize &requestedSize);
25};
diff --git a/prototype_2016/third_party/fluid/core/plugin.cpp b/prototype_2016/third_party/fluid/core/plugin.cpp
new file mode 100644
index 0000000..511b439
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/plugin.cpp
@@ -0,0 +1,90 @@
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
15#include <QtQml/QQmlExtensionPlugin>
16#include <QtQml/qqml.h>
17
18#include "clipboard.h"
19#include "device.h"
20#include "iconsimageprovider.h"
21#include "qmldateutils.h"
22#include "qqmlsortfilterproxymodel.h"
23#include "standardpaths.h"
24
25static QObject *dateUtilsProvider(QQmlEngine *engine, QJSEngine *jsEngine)
26{
27 Q_UNUSED(engine);
28 Q_UNUSED(jsEngine);
29
30 return new DateUtils();
31}
32
33static QObject *deviceProvider(QQmlEngine *engine, QJSEngine *jsEngine)
34{
35 Q_UNUSED(engine);
36 Q_UNUSED(jsEngine);
37
38 return new Device();
39}
40
41static QObject *standardPathsProvider(QQmlEngine *engine, QJSEngine *jsEngine)
42{
43 Q_UNUSED(engine);
44 Q_UNUSED(jsEngine);
45
46 return new StandardPaths();
47}
48
49class FluidCorePlugin : public QQmlExtensionPlugin
50{
51 Q_OBJECT
52 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
53public:
54 void initializeEngine(QQmlEngine *engine, const char *uri);
55 void registerTypes(const char *uri);
56};
57
58void FluidCorePlugin::initializeEngine(QQmlEngine *engine, const char *uri)
59{
60 Q_ASSERT(QByteArray(uri) == QByteArrayLiteral("Fluid.Core"));
61
62 engine->addImageProvider(QLatin1String("fluidicons"), new IconsImageProvider());
63}
64
65void FluidCorePlugin::registerTypes(const char *uri)
66{
67 Q_ASSERT(QByteArray("Fluid.Core") == QByteArray(uri));
68
69 // @uri Fluid.Core
70
71 qmlRegisterType<Clipboard>(uri, 1, 0, "Clipboard");
72
73 qmlRegisterType<QAbstractItemModel>();
74 qmlRegisterType<QQmlSortFilterProxyModel>(uri, 1, 0, "SortFilterProxyModel");
75
76 qmlRegisterSingletonType<DateUtils>(uri, 1, 0, "DateUtils", dateUtilsProvider);
77 qmlRegisterSingletonType<Device>(uri, 1, 0, "Device", deviceProvider);
78 qmlRegisterSingletonType<StandardPaths>(uri, 1, 0, "StandardPaths", standardPathsProvider);
79}
80
81#ifdef FLUID_LOCAL
82static void registerFluidCoreTypes() {
83 FluidCorePlugin fluidCore;
84 fluidCore.registerTypes("Fluid.Core");
85}
86
87Q_COREAPP_STARTUP_FUNCTION(registerFluidCoreTypes)
88#endif
89
90#include "plugin.moc"
diff --git a/prototype_2016/third_party/fluid/core/plugins.qmltypes b/prototype_2016/third_party/fluid/core/plugins.qmltypes
new file mode 100644
index 0000000..f8f71ef
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/plugins.qmltypes
@@ -0,0 +1,268 @@
1import QtQuick.tooling 1.2
2
3// This file describes the plugin-supplied types contained in the library.
4// It is used for QML tooling purposes only.
5//
6// This file was auto-generated by:
7// 'qmlplugindump-qt5 -nonrelocatable Fluid.Core 1.0'
8
9Module {
10 dependencies: ["QtQuick 2.0"]
11 Component {
12 name: "Clipboard"
13 prototype: "QObject"
14 exports: ["Fluid.Core/Clipboard 1.0"]
15 exportMetaObjectRevisions: [0]
16 Property { name: "text"; type: "string" }
17 Method {
18 name: "setText"
19 Parameter { name: "text"; type: "string" }
20 }
21 Method { name: "clear" }
22 }
23 Component {
24 name: "DateUtils"
25 prototype: "QObject"
26 exports: ["Fluid.Core/DateUtils 1.0"]
27 isCreatable: false
28 isSingleton: true
29 exportMetaObjectRevisions: [0]
30 Enum {
31 name: "DurationFormat"
32 values: {
33 "Long": 0,
34 "Short": 1
35 }
36 }
37 Enum {
38 name: "DurationType"
39 values: {
40 "Seconds": 0,
41 "Minutes": 1,
42 "Hours": 2,
43 "Any": 3
44 }
45 }
46 Method {
47 name: "formatDuration"
48 type: "string"
49 Parameter { name: "duration"; type: "qlonglong" }
50 Parameter { name: "format"; type: "DurationFormat" }
51 Parameter { name: "type"; type: "DurationType" }
52 }
53 Method {
54 name: "formatDuration"
55 type: "string"
56 Parameter { name: "duration"; type: "qlonglong" }
57 Parameter { name: "format"; type: "DurationFormat" }
58 }
59 Method {
60 name: "formatDuration"
61 type: "string"
62 Parameter { name: "duration"; type: "qlonglong" }
63 }
64 }
65 Component {
66 name: "Device"
67 prototype: "QObject"
68 exports: ["Fluid.Core/Device 1.0"]
69 isCreatable: false
70 isSingleton: true
71 exportMetaObjectRevisions: [0]
72 Enum {
73 name: "FormFactor"
74 values: {
75 "Phone": 0,
76 "Phablet": 1,
77 "Tablet": 2,
78 "Computer": 3,
79 "TV": 4,
80 "Unknown": 5
81 }
82 }
83 Property { name: "formFactor"; type: "FormFactor"; isReadonly: true }
84 Property { name: "name"; type: "string"; isReadonly: true }
85 Property { name: "iconName"; type: "string"; isReadonly: true }
86 Property { name: "isPortrait"; type: "bool"; isReadonly: true }
87 Property { name: "isMobile"; type: "bool"; isReadonly: true }
88 Property { name: "hasTouchScreen"; type: "bool"; isReadonly: true }
89 Property { name: "hoverEnabled"; type: "bool"; isReadonly: true }
90 Property { name: "gridUnit"; type: "int"; isReadonly: true }
91 Signal { name: "geometryChanged" }
92 }
93 Component {
94 name: "QAbstractProxyModel"
95 prototype: "QAbstractItemModel"
96 Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
97 Method {
98 name: "mapToSource"
99 type: "QModelIndex"
100 Parameter { name: "proxyIndex"; type: "QModelIndex" }
101 }
102 Method {
103 name: "mapFromSource"
104 type: "QModelIndex"
105 Parameter { name: "sourceIndex"; type: "QModelIndex" }
106 }
107 Method {
108 name: "mapSelectionToSource"
109 type: "QItemSelection"
110 Parameter { name: "selection"; type: "QItemSelection" }
111 }
112 Method {
113 name: "mapSelectionFromSource"
114 type: "QItemSelection"
115 Parameter { name: "selection"; type: "QItemSelection" }
116 }
117 }
118 Component {
119 name: "QQmlSortFilterProxyModel"
120 prototype: "QSortFilterProxyModel"
121 exports: ["Fluid.Core/SortFilterProxyModel 1.0"]
122 exportMetaObjectRevisions: [0]
123 Enum {
124 name: "PatternSyntax"
125 values: {
126 "RegExp": 0,
127 "Wildcard": 1,
128 "FixedString": 2,
129 "RegExp2": 3,
130 "WildcardUnix": 4,
131 "W3CXmlSchema11": 5
132 }
133 }
134 Property { name: "count"; type: "int"; isReadonly: true }
135 Property { name: "filterRoleName"; type: "string" }
136 Property { name: "filterPattern"; type: "string" }
137 Property { name: "filterPatternSyntax"; type: "PatternSyntax" }
138 Property { name: "filterValue"; type: "QVariant" }
139 Property { name: "filterExpression"; type: "QQmlScriptString" }
140 Property { name: "sortRoleName"; type: "string" }
141 Property { name: "sortOrder"; type: "Qt::SortOrder" }
142 Property { name: "sortExpression"; type: "QQmlScriptString" }
143 }
144 Component {
145 name: "QSortFilterProxyModel"
146 prototype: "QAbstractProxyModel"
147 Property { name: "filterRegExp"; type: "QRegExp" }
148 Property { name: "filterKeyColumn"; type: "int" }
149 Property { name: "dynamicSortFilter"; type: "bool" }
150 Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
151 Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
152 Property { name: "isSortLocaleAware"; type: "bool" }
153 Property { name: "sortRole"; type: "int" }
154 Property { name: "filterRole"; type: "int" }
155 Method {
156 name: "setFilterRegExp"
157 Parameter { name: "pattern"; type: "string" }
158 }
159 Method {
160 name: "setFilterWildcard"
161 Parameter { name: "pattern"; type: "string" }
162 }
163 Method {
164 name: "setFilterFixedString"
165 Parameter { name: "pattern"; type: "string" }
166 }
167 Method { name: "clear" }
168 Method { name: "invalidate" }
169 }
170 Component {
171 name: "StandardPaths"
172 prototype: "QObject"
173 exports: ["Fluid.Core/StandardPaths 1.0"]
174 isCreatable: false
175 isSingleton: true
176 exportMetaObjectRevisions: [0]
177 Enum {
178 name: "StandardLocation"
179 values: {
180 "DesktopLocation": 0,
181 "DocumentsLocation": 1,
182 "FontsLocation": 2,
183 "ApplicationsLocation": 3,
184 "MusicLocation": 4,
185 "MoviesLocation": 5,
186 "PicturesLocation": 6,
187 "TempLocation": 7,
188 "HomeLocation": 8,
189 "DataLocation": 9,
190 "CacheLocation": 10,
191 "GenericDataLocation": 11,
192 "RuntimeLocation": 12,
193 "ConfigLocation": 13,
194 "DownloadLocation": 14,
195 "GenericCacheLocation": 15,
196 "GenericConfigLocation": 16
197 }
198 }
199 Method {
200 name: "locateFile"
201 type: "string"
202 Parameter { name: "type"; type: "StandardLocation" }
203 Parameter { name: "fileName"; type: "string" }
204 }
205 Method {
206 name: "locateDirectory"
207 type: "string"
208 Parameter { name: "type"; type: "StandardLocation" }
209 Parameter { name: "dirName"; type: "string" }
210 }
211 }
212 Component {
213 prototype: "QObject"
214 name: "Utils 1.0"
215 exports: ["Utils 1.0"]
216 exportMetaObjectRevisions: [0]
217 isComposite: true
218 isCreatable: false
219 isSingleton: true
220 Method {
221 name: "asColor"
222 type: "QVariant"
223 Parameter { name: "color"; type: "QVariant" }
224 }
225 Method {
226 name: "alpha"
227 type: "QVariant"
228 Parameter { name: "color"; type: "QVariant" }
229 Parameter { name: "alpha"; type: "QVariant" }
230 }
231 Method {
232 name: "blendColors"
233 type: "QVariant"
234 Parameter { name: "color1"; type: "QVariant" }
235 Parameter { name: "color2"; type: "QVariant" }
236 Parameter { name: "a"; type: "QVariant" }
237 }
238 Method {
239 name: "luminance"
240 type: "QVariant"
241 Parameter { name: "color"; type: "QVariant" }
242 }
243 Method {
244 name: "lightDark"
245 type: "QVariant"
246 Parameter { name: "background"; type: "QVariant" }
247 Parameter { name: "lightColor"; type: "QVariant" }
248 Parameter { name: "darkColor"; type: "QVariant" }
249 }
250 Method {
251 name: "isDarkColor"
252 type: "QVariant"
253 Parameter { name: "color"; type: "QVariant" }
254 }
255 Method {
256 name: "getSourceForIconName"
257 type: "QVariant"
258 Parameter { name: "name"; type: "QVariant" }
259 }
260 Method {
261 name: "scale"
262 type: "QVariant"
263 Parameter { name: "percent"; type: "QVariant" }
264 Parameter { name: "start"; type: "QVariant" }
265 Parameter { name: "end"; type: "QVariant" }
266 }
267 }
268}
diff --git a/prototype_2016/third_party/fluid/core/qmldateutils.cpp b/prototype_2016/third_party/fluid/core/qmldateutils.cpp
new file mode 100644
index 0000000..a060f26
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/qmldateutils.cpp
@@ -0,0 +1,34 @@
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
16#include "qmldateutils.h"
17
18DateUtils::DateUtils(QObject *parent)
19 : QObject(parent)
20{
21}
22
23QString DateUtils::formatDuration(qlonglong duration, DurationFormat format,
24 DurationType type) const
25{
26 return Fluid::DateUtils::formatDuration(duration,
27 static_cast<Fluid::DateUtils::DurationFormat>(format),
28 static_cast<Fluid::DateUtils::DurationType>(type));
29}
30
31QString DateUtils::friendlyTime(const QDateTime &time, bool standalone) const
32{
33 return Fluid::DateUtils::friendlyTime(time, standalone);
34}
diff --git a/prototype_2016/third_party/fluid/core/qmldateutils.h b/prototype_2016/third_party/fluid/core/qmldateutils.h
new file mode 100644
index 0000000..29fffbe
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/qmldateutils.h
@@ -0,0 +1,42 @@
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
16#pragma once
17
18#ifdef FLUID_LOCAL
19 #include "../src/dateutils.h"
20#else
21 #include <Fluid/DateUtils>
22#endif
23#include <QtCore/QObject>
24
25class DateUtils : public QObject
26{
27 Q_OBJECT
28
29public:
30 enum DurationFormat { Long, Short };
31 Q_ENUM(DurationFormat)
32
33 enum DurationType { Seconds, Minutes, Hours, Any };
34 Q_ENUM(DurationType)
35
36 DateUtils(QObject *parent = nullptr);
37
38 Q_INVOKABLE QString formatDuration(qlonglong duration,
39 DurationFormat format = DurationFormat::Short,
40 DurationType type = DurationType::Any) const;
41 Q_INVOKABLE QString friendlyTime(const QDateTime &time, bool standalone) const;
42};
diff --git a/prototype_2016/third_party/fluid/core/qmldir b/prototype_2016/third_party/fluid/core/qmldir
new file mode 100644
index 0000000..07b5022
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/qmldir
@@ -0,0 +1,8 @@
1module Fluid.Core
2plugin fluidcore
3class FluidCorePlugin
4typeinfo plugins.qmltypes
5
6Object 1.0 Object.qml
7PlatformExtensions 1.0 PlatformExtensions.qml
8singleton Utils 1.0 Utils.qml
diff --git a/prototype_2016/third_party/fluid/core/qmldir_noplugin b/prototype_2016/third_party/fluid/core/qmldir_noplugin
new file mode 100644
index 0000000..c22216e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/qmldir_noplugin
@@ -0,0 +1,5 @@
1module Fluid.Core
2typeinfo plugins.qmltypes
3
4Object 1.0 Object.qml
5singleton Utils 1.0 Utils.qml
diff --git a/prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.cpp b/prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.cpp
new file mode 100644
index 0000000..0f88cc0
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.cpp
@@ -0,0 +1,283 @@
1/****************************************************************************
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pierre-Yves Siret
5 *
6 * $BEGIN_LICENSE:MIT$
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
25 *
26 * $END_LICENSE$
27 ***************************************************************************/
28
29#include "qqmlsortfilterproxymodel.h"
30#include <QtQml>
31
32QQmlSortFilterProxyModel::QQmlSortFilterProxyModel(QObject *parent)
33 : QSortFilterProxyModel(parent)
34 , m_filterExpression(0)
35 , m_compareExpression(0)
36{
37 connect(this, &QAbstractProxyModel::sourceModelChanged, this,
38 &QQmlSortFilterProxyModel::updateRoles);
39 connect(this, &QAbstractItemModel::modelReset, this, &QQmlSortFilterProxyModel::updateRoles);
40 connect(this, &QAbstractItemModel::rowsInserted, this, &QQmlSortFilterProxyModel::countChanged);
41 connect(this, &QAbstractItemModel::rowsRemoved, this, &QQmlSortFilterProxyModel::countChanged);
42 connect(this, &QAbstractItemModel::modelReset, this, &QQmlSortFilterProxyModel::countChanged);
43 connect(this, &QAbstractItemModel::layoutChanged, this,
44 &QQmlSortFilterProxyModel::countChanged);
45 setDynamicSortFilter(true);
46}
47
48int QQmlSortFilterProxyModel::count() const
49{
50 return rowCount();
51}
52
53const QString &QQmlSortFilterProxyModel::filterRoleName() const
54{
55 return m_filterRoleName;
56}
57
58void QQmlSortFilterProxyModel::setFilterRoleName(const QString &filterRoleName)
59{
60 if (m_filterRoleName == filterRoleName)
61 return;
62
63 m_filterRoleName = filterRoleName;
64 updateFilterRole();
65 emit filterRoleNameChanged();
66}
67
68QString QQmlSortFilterProxyModel::filterPattern() const
69{
70 return filterRegExp().pattern();
71}
72
73void QQmlSortFilterProxyModel::setFilterPattern(const QString &filterPattern)
74{
75 QRegExp regExp = filterRegExp();
76 if (regExp.pattern() == filterPattern)
77 return;
78
79 regExp.setPattern(filterPattern);
80 QSortFilterProxyModel::setFilterRegExp(regExp);
81 emit filterPatternChanged();
82}
83
84QQmlSortFilterProxyModel::PatternSyntax QQmlSortFilterProxyModel::filterPatternSyntax() const
85{
86 return static_cast<PatternSyntax>(filterRegExp().patternSyntax());
87}
88
89void QQmlSortFilterProxyModel::setFilterPatternSyntax(
90 QQmlSortFilterProxyModel::PatternSyntax patternSyntax)
91{
92 QRegExp regExp = filterRegExp();
93 QRegExp::PatternSyntax patternSyntaxTmp = static_cast<QRegExp::PatternSyntax>(patternSyntax);
94 if (regExp.patternSyntax() == patternSyntaxTmp)
95 return;
96
97 regExp.setPatternSyntax(patternSyntaxTmp);
98 QSortFilterProxyModel::setFilterRegExp(regExp);
99 emit filterPatternSyntaxChanged();
100}
101
102const QVariant &QQmlSortFilterProxyModel::filterValue() const
103{
104 return m_filterValue;
105}
106
107void QQmlSortFilterProxyModel::setFilterValue(const QVariant &filterValue)
108{
109 if (m_filterValue == filterValue)
110 return;
111
112 m_filterValue = filterValue;
113 invalidateFilter();
114 emit filterValueChanged();
115}
116
117const QQmlScriptString &QQmlSortFilterProxyModel::filterExpression() const
118{
119 return m_filterScriptString;
120}
121
122void QQmlSortFilterProxyModel::setFilterExpression(const QQmlScriptString &filterScriptString)
123{
124 if (m_filterScriptString == filterScriptString)
125 return;
126
127 m_filterScriptString = filterScriptString;
128 QQmlContext *context = new QQmlContext(qmlContext(this));
129
130 QVariantMap map;
131 Q_FOREACH (const QByteArray &roleName, roleNames().values())
132 map.insert(roleName, QVariant());
133
134 context->setContextProperty("model", map);
135 context->setContextProperty("index", -1);
136
137 delete (m_filterExpression);
138 m_filterExpression = new QQmlExpression(m_filterScriptString, context, 0, this);
139 connect(m_filterExpression, &QQmlExpression::valueChanged, this,
140 &QQmlSortFilterProxyModel::invalidateFilter);
141 m_filterExpression->setNotifyOnValueChanged(true);
142 m_filterExpression->evaluate();
143
144 emit filterExpressionChanged();
145}
146
147const QString &QQmlSortFilterProxyModel::sortRoleName() const
148{
149 return m_sortRoleName;
150}
151
152void QQmlSortFilterProxyModel::setSortRoleName(const QString &sortRoleName)
153{
154 if (m_sortRoleName == sortRoleName)
155 return;
156
157 m_sortRoleName = sortRoleName;
158 updateSortRole();
159 emit sortRoleNameChanged();
160}
161
162void QQmlSortFilterProxyModel::setSortOrder(Qt::SortOrder sortOrder)
163{
164 if (!m_sortRoleName.isEmpty())
165 sort(0, sortOrder);
166}
167
168const QQmlScriptString &QQmlSortFilterProxyModel::sortExpression() const
169{
170 return m_compareScriptString;
171}
172
173void QQmlSortFilterProxyModel::setSortExpression(const QQmlScriptString &compareScriptString)
174{
175 if (m_compareScriptString == compareScriptString)
176 return;
177
178 m_compareScriptString = compareScriptString;
179 QQmlContext *context = new QQmlContext(qmlContext(this));
180
181 QVariantMap map;
182 Q_FOREACH (const QByteArray &roleName, roleNames().values())
183 map.insert(roleName, QVariant());
184
185 context->setContextProperty("modelLeft", map);
186 context->setContextProperty("indexLeft", -1);
187 context->setContextProperty("modelRight", map);
188 context->setContextProperty("indexRight", -1);
189
190 delete (m_compareExpression);
191 m_compareExpression = new QQmlExpression(m_compareScriptString, context, 0, this);
192 connect(m_compareExpression, &QQmlExpression::valueChanged, this,
193 &QQmlSortFilterProxyModel::invalidate);
194 m_compareExpression->setNotifyOnValueChanged(true);
195 m_compareExpression->evaluate();
196
197 emit sortExpressionChanged();
198}
199
200bool QQmlSortFilterProxyModel::filterAcceptsRow(int source_row,
201 const QModelIndex &source_parent) const
202{
203 QModelIndex modelIndex = sourceModel()->index(source_row, 0, source_parent);
204 bool valueAccepted = !m_filterValue.isValid()
205 || (m_filterValue == sourceModel()->data(modelIndex, filterRole()));
206 bool baseAcceptsRow =
207 valueAccepted && QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
208 if (baseAcceptsRow && !m_filterScriptString.isEmpty()) {
209 QVariantMap map = modelDataMap(modelIndex);
210
211 QQmlContext context(qmlContext(this));
212 context.setContextProperty("model", map);
213 context.setContextProperty("index", source_row);
214 QQmlExpression expression(m_filterScriptString, &context, 0);
215 QVariant result = expression.evaluate();
216
217 if (!expression.hasError())
218 return result.toBool();
219 else
220 qWarning() << expression.error();
221 }
222 return baseAcceptsRow;
223}
224
225bool QQmlSortFilterProxyModel::lessThan(const QModelIndex &source_left,
226 const QModelIndex &source_right) const
227{
228 if (!m_compareScriptString.isEmpty()) {
229 QQmlContext context(qmlContext(this));
230 context.setContextProperty("modelLeft", modelDataMap(source_left));
231 context.setContextProperty("indexLeft", source_left.row());
232 context.setContextProperty("modelRight", modelDataMap(source_right));
233 context.setContextProperty("indexRight", source_right.row());
234
235 QQmlExpression expression(m_compareScriptString, &context, 0);
236 QVariant result = expression.evaluate();
237
238 if (!expression.hasError())
239 return result.toBool();
240 else
241 qWarning() << expression.error();
242 }
243 return QSortFilterProxyModel::lessThan(source_left, source_right);
244}
245
246void QQmlSortFilterProxyModel::invalidateFilter()
247{
248 QSortFilterProxyModel::invalidateFilter();
249}
250
251void QQmlSortFilterProxyModel::updateFilterRole()
252{
253 QList<int> filterRoles = roleNames().keys(m_filterRoleName.toUtf8());
254 if (!filterRoles.empty()) {
255 setFilterRole(filterRoles.first());
256 }
257}
258
259void QQmlSortFilterProxyModel::updateSortRole()
260{
261 QList<int> sortRoles = roleNames().keys(m_sortRoleName.toUtf8());
262 if (!sortRoles.empty()) {
263 setSortRole(sortRoles.first());
264 sort(0, sortOrder());
265 }
266}
267
268void QQmlSortFilterProxyModel::updateRoles()
269{
270 updateFilterRole();
271 updateSortRole();
272}
273
274QVariantMap QQmlSortFilterProxyModel::modelDataMap(const QModelIndex &modelIndex) const
275{
276 QVariantMap map;
277 QHash<int, QByteArray> roles = roleNames();
278 for (QHash<int, QByteArray>::const_iterator it = roles.begin(); it != roles.end(); ++it)
279 map.insert(it.value(), sourceModel()->data(modelIndex, it.key()));
280 return map;
281}
282
283#include "moc_qqmlsortfilterproxymodel.cpp"
diff --git a/prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.h b/prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.h
new file mode 100644
index 0000000..58f09e7
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/qqmlsortfilterproxymodel.h
@@ -0,0 +1,129 @@
1/****************************************************************************
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pierre-Yves Siret
5 *
6 * $BEGIN_LICENSE:MIT$
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
25 *
26 * $END_LICENSE$
27 ***************************************************************************/
28
29#ifndef QQMLSORTFILTERPROXYMODEL_H
30#define QQMLSORTFILTERPROXYMODEL_H
31
32#include <QSortFilterProxyModel>
33#include <QQmlExpression>
34
35class QQmlSortFilterProxyModel : public QSortFilterProxyModel
36{
37 Q_OBJECT
38 Q_PROPERTY(int count READ count NOTIFY countChanged)
39 Q_PROPERTY(QString filterRoleName READ filterRoleName WRITE setFilterRoleName NOTIFY
40 filterRoleNameChanged)
41 Q_PROPERTY(
42 QString filterPattern READ filterPattern WRITE setFilterPattern NOTIFY filterPatternChanged)
43 Q_PROPERTY(PatternSyntax filterPatternSyntax READ filterPatternSyntax WRITE
44 setFilterPatternSyntax NOTIFY filterPatternSyntaxChanged)
45 Q_PROPERTY(QVariant filterValue READ filterValue WRITE setFilterValue NOTIFY filterValueChanged)
46 Q_PROPERTY(QQmlScriptString filterExpression READ filterExpression WRITE setFilterExpression
47 NOTIFY filterExpressionChanged)
48
49 Q_PROPERTY(
50 QString sortRoleName READ sortRoleName WRITE setSortRoleName NOTIFY sortRoleNameChanged)
51 Q_PROPERTY(Qt::SortOrder sortOrder READ sortOrder WRITE setSortOrder)
52 Q_PROPERTY(QQmlScriptString sortExpression READ sortExpression WRITE setSortExpression NOTIFY
53 sortExpressionChanged)
54
55public:
56 enum PatternSyntax {
57 RegExp = QRegExp::RegExp,
58 Wildcard = QRegExp::Wildcard,
59 FixedString = QRegExp::FixedString,
60 RegExp2 = QRegExp::RegExp2,
61 WildcardUnix = QRegExp::WildcardUnix,
62 W3CXmlSchema11 = QRegExp::W3CXmlSchema11
63 };
64 Q_ENUM(PatternSyntax)
65
66 QQmlSortFilterProxyModel(QObject *parent = 0);
67
68 int count() const;
69
70 const QString &filterRoleName() const;
71 void setFilterRoleName(const QString &filterRoleName);
72
73 QString filterPattern() const;
74 void setFilterPattern(const QString &filterPattern);
75
76 PatternSyntax filterPatternSyntax() const;
77 void setFilterPatternSyntax(PatternSyntax patternSyntax);
78
79 const QVariant &filterValue() const;
80 void setFilterValue(const QVariant &filterValue);
81
82 const QQmlScriptString &filterExpression() const;
83 void setFilterExpression(const QQmlScriptString &filterScriptString);
84
85 const QString &sortRoleName() const;
86 void setSortRoleName(const QString &sortRoleName);
87
88 void setSortOrder(Qt::SortOrder sortOrder);
89
90 const QQmlScriptString &sortExpression() const;
91 void setSortExpression(const QQmlScriptString &compareScriptString);
92
93signals:
94 void countChanged();
95
96 void filterRoleNameChanged();
97 void filterPatternSyntaxChanged();
98 void filterPatternChanged();
99 void filterValueChanged();
100 void filterExpressionChanged();
101
102 void sortRoleNameChanged();
103 void sortExpressionChanged();
104
105protected:
106 bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
107 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
108
109private slots:
110 void invalidateFilter();
111 void updateFilterRole();
112 void updateSortRole();
113 void updateRoles();
114
115private:
116 QVariantMap modelDataMap(const QModelIndex &modelIndex) const;
117
118 QString m_filterRoleName;
119 QString m_sortRoleName;
120
121 QQmlScriptString m_filterScriptString;
122 QQmlExpression *m_filterExpression;
123
124 QQmlScriptString m_compareScriptString;
125 QQmlExpression *m_compareExpression;
126 QVariant m_filterValue;
127};
128
129#endif // QQMLSORTFILTERPROXYMODEL_H
diff --git a/prototype_2016/third_party/fluid/core/standardpaths.cpp b/prototype_2016/third_party/fluid/core/standardpaths.cpp
new file mode 100644
index 0000000..ec67683
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/standardpaths.cpp
@@ -0,0 +1,36 @@
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
15#include <QtCore/QStandardPaths>
16
17#include "standardpaths.h"
18
19StandardPaths::StandardPaths(QObject *parent)
20 : QObject(parent)
21{
22}
23
24QString StandardPaths::locateFile(StandardLocation type, const QString &fileName)
25{
26 QStandardPaths::StandardLocation qtype = static_cast<QStandardPaths::StandardLocation>(type);
27 return QStandardPaths::locate(qtype, fileName);
28}
29
30QString StandardPaths::locateDirectory(StandardLocation type, const QString &dirName)
31{
32 QStandardPaths::StandardLocation qtype = static_cast<QStandardPaths::StandardLocation>(type);
33 return QStandardPaths::locate(qtype, dirName, QStandardPaths::LocateDirectory);
34}
35
36#include "moc_standardpaths.cpp"
diff --git a/prototype_2016/third_party/fluid/core/standardpaths.h b/prototype_2016/third_party/fluid/core/standardpaths.h
new file mode 100644
index 0000000..6f3d0bc
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/standardpaths.h
@@ -0,0 +1,51 @@
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
15#ifndef STANDARDPATHS_H
16#define STANDARDPATHS_H
17
18#include <QtCore/QObject>
19
20class StandardPaths : public QObject
21{
22 Q_OBJECT
23public:
24 enum StandardLocation {
25 DesktopLocation,
26 DocumentsLocation,
27 FontsLocation,
28 ApplicationsLocation,
29 MusicLocation,
30 MoviesLocation,
31 PicturesLocation,
32 TempLocation,
33 HomeLocation,
34 DataLocation,
35 CacheLocation,
36 GenericDataLocation,
37 RuntimeLocation,
38 ConfigLocation,
39 DownloadLocation,
40 GenericCacheLocation,
41 GenericConfigLocation
42 };
43 Q_ENUM(StandardLocation)
44
45 StandardPaths(QObject *parent = 0);
46
47 Q_INVOKABLE QString locateFile(StandardLocation type, const QString &fileName);
48 Q_INVOKABLE QString locateDirectory(StandardLocation type, const QString &dirName);
49};
50
51#endif // STANDARDPATHS_H
diff --git a/prototype_2016/third_party/fluid/demo/+material/StyledRectangle.qml b/prototype_2016/third_party/fluid/demo/+material/StyledRectangle.qml
new file mode 100644
index 0000000..7da64ab
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/+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/third_party/fluid/demo/+universal/StyledRectangle.qml b/prototype_2016/third_party/fluid/demo/+universal/StyledRectangle.qml
new file mode 100644
index 0000000..ca1999b
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/+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/third_party/fluid/demo/BasicComponents.qml b/prototype_2016/third_party/fluid/demo/BasicComponents.qml
new file mode 100644
index 0000000..a46f083
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/CMakeLists.txt b/prototype_2016/third_party/fluid/demo/CMakeLists.txt
new file mode 100644
index 0000000..a4f9ab6
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/CompoundComponents.qml b/prototype_2016/third_party/fluid/demo/CompoundComponents.qml
new file mode 100644
index 0000000..2de7bd2
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/MaterialComponents.qml b/prototype_2016/third_party/fluid/demo/MaterialComponents.qml
new file mode 100644
index 0000000..444b049
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/NavigationComponents.qml b/prototype_2016/third_party/fluid/demo/NavigationComponents.qml
new file mode 100644
index 0000000..ce0a2fd
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Basic/BusyIndicatorPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Basic/BusyIndicatorPage.qml
new file mode 100644
index 0000000..1a6341e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Basic/ButtonPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Basic/ButtonPage.qml
new file mode 100644
index 0000000..6cf94fe
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Basic/CheckBoxPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Basic/CheckBoxPage.qml
new file mode 100644
index 0000000..6e53e73
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Basic/ProgressBarPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Basic/ProgressBarPage.qml
new file mode 100644
index 0000000..440db51
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Basic/RadioButtonPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Basic/RadioButtonPage.qml
new file mode 100644
index 0000000..80c98d5
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Basic/SliderPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Basic/SliderPage.qml
new file mode 100644
index 0000000..72d9c11
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Basic/SwitchPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Basic/SwitchPage.qml
new file mode 100644
index 0000000..15c679b
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Compound/CardPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Compound/CardPage.qml
new file mode 100644
index 0000000..ec33a3e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Compound/InfoBarPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Compound/InfoBarPage.qml
new file mode 100644
index 0000000..1830e39
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Compound/ListItemPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Compound/ListItemPage.qml
new file mode 100644
index 0000000..f86f81b
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Compound/SubPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Compound/SubPage.qml
new file mode 100644
index 0000000..8a86a28
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Material/ActionButtonPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Material/ActionButtonPage.qml
new file mode 100644
index 0000000..1fcf516
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Material/WavePage.qml b/prototype_2016/third_party/fluid/demo/Pages/Material/WavePage.qml
new file mode 100644
index 0000000..58cae01
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Navigation/NavDrawerPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Navigation/NavDrawerPage.qml
new file mode 100644
index 0000000..4c7dd21
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Style/PalettePage.qml b/prototype_2016/third_party/fluid/demo/Pages/Style/PalettePage.qml
new file mode 100644
index 0000000..bc34dab
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Style/PaletteSwatch.qml b/prototype_2016/third_party/fluid/demo/Pages/Style/PaletteSwatch.qml
new file mode 100644
index 0000000..ac5c9b3
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Pages/Style/TypographyPage.qml b/prototype_2016/third_party/fluid/demo/Pages/Style/TypographyPage.qml
new file mode 100644
index 0000000..d87d00c
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/Style.qml b/prototype_2016/third_party/fluid/demo/Style.qml
new file mode 100644
index 0000000..9f997bd
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/StyledRectangle.qml b/prototype_2016/third_party/fluid/demo/StyledRectangle.qml
new file mode 100644
index 0000000..3af12dd
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/demo/demo.pro b/prototype_2016/third_party/fluid/demo/demo.pro
new file mode 100644
index 0000000..7f6c2ba
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/demo.pro
@@ -0,0 +1,9 @@
1TEMPLATE = app
2
3QT += qml quick quickcontrols2
4CONFIG += c++11
5
6SOURCES += main.cpp
7RESOURCES += demo.qrc
8
9include(../fluid.pri)
diff --git a/prototype_2016/third_party/fluid/demo/demo.qrc b/prototype_2016/third_party/fluid/demo/demo.qrc
new file mode 100644
index 0000000..b447c47
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/demo.qrc
@@ -0,0 +1,30 @@
1<RCC>
2 <qresource prefix="/">
3 <file>main.qml</file>
4 <file>BasicComponents.qml</file>
5 <file>CompoundComponents.qml</file>
6 <file>MaterialComponents.qml</file>
7 <file>NavigationComponents.qml</file>
8 <file>Style.qml</file>
9 <file>StyledRectangle.qml</file>
10 <file>+material/StyledRectangle.qml</file>
11 <file>+universal/StyledRectangle.qml</file>
12 <file>Pages/Basic/BusyIndicatorPage.qml</file>
13 <file>Pages/Basic/ButtonPage.qml</file>
14 <file>Pages/Basic/CheckBoxPage.qml</file>
15 <file>Pages/Basic/ProgressBarPage.qml</file>
16 <file>Pages/Basic/RadioButtonPage.qml</file>
17 <file>Pages/Basic/SliderPage.qml</file>
18 <file>Pages/Basic/SwitchPage.qml</file>
19 <file>Pages/Compound/ListItemPage.qml</file>
20 <file>Pages/Compound/SubPage.qml</file>
21 <file>Pages/Compound/CardPage.qml</file>
22 <file>Pages/Compound/InfoBarPage.qml</file>
23 <file>Pages/Style/PalettePage.qml</file>
24 <file>Pages/Style/PaletteSwatch.qml</file>
25 <file>Pages/Style/TypographyPage.qml</file>
26 <file>Pages/Material/ActionButtonPage.qml</file>
27 <file>Pages/Material/WavePage.qml</file>
28 <file>Pages/Navigation/NavDrawerPage.qml</file>
29 </qresource>
30</RCC>
diff --git a/prototype_2016/third_party/fluid/demo/main.cpp b/prototype_2016/third_party/fluid/demo/main.cpp
new file mode 100644
index 0000000..055d695
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/main.cpp
@@ -0,0 +1,37 @@
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
16#include <QGuiApplication>
17#include <QQmlApplicationEngine>
18#include <QQuickStyle>
19#include <QQmlContext>
20
21int main(int argc, char *argv[])
22{
23 QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
24
25 QGuiApplication app(argc, argv);
26
27 if (QQuickStyle::name().isEmpty())
28 QQuickStyle::setStyle("Material");
29
30 QQmlApplicationEngine engine;
31#ifdef FLUID_LOCAL
32 engine.addImportPath(QStringLiteral("qrc:/"));
33#endif
34 engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
35
36 return app.exec();
37}
diff --git a/prototype_2016/third_party/fluid/demo/main.qml b/prototype_2016/third_party/fluid/demo/main.qml
new file mode 100644
index 0000000..37b0077
--- /dev/null
+++ b/prototype_2016/third_party/fluid/demo/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/third_party/fluid/doc/defaults.qdocconf b/prototype_2016/third_party/fluid/doc/defaults.qdocconf
new file mode 100644
index 0000000..39c8491
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/defaults.qdocconf
@@ -0,0 +1,23 @@
1include($QT_INSTALL_DOCS/global/macros.qdocconf)
2include($QT_INSTALL_DOCS/global/qt-cpp-defines.qdocconf)
3include($QT_INSTALL_DOCS/global/compat.qdocconf)
4include($QT_INSTALL_DOCS/global/fileextensions.qdocconf)
5include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
6include(html-footer-offline.qdocconf)
7
8outputdir = $FLUID_BUILD_DIR/doc/html
9
10dist.metadata.default.author = Fluid
11dist.metadata.default.permissions = all
12dist.metadata.default.publisher = Fluid
13dist.metadata.default.copyryear = 2016
14dist.metadata.default.copyrholder = Fluid
15dist.metadata.default.audience = programmer
16
17navigation.homepage = "Fluid $FLUID_VERSION"
18
19#sourcedirs += includes
20
21url = http://doc.liri.io/sdk
22
23buildversion = "Fluid $FLUID_VERSION Reference Documentation"
diff --git a/prototype_2016/third_party/fluid/doc/fluid.qdocconf b/prototype_2016/third_party/fluid/doc/fluid.qdocconf
new file mode 100644
index 0000000..1fee46d
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/fluid.qdocconf
@@ -0,0 +1,59 @@
1include(defaults.qdocconf)
2
3project = Fluid
4description = Fluid Reference Documentation
5version = $FLUID_VERSION
6
7qhp.projects = Fluid
8
9qhp.Fluid.file = fluid.qhp
10qhp.Fluid.namespace = io.liri.fluid.$FLUID_VERSION_TAG
11qhp.Fluid.virtualFolder = fluid
12qhp.Fluid.indexTitle = Fluid $FLUID_VERSION Reference Documentation
13qhp.Fluid.indexRoot =
14
15qhp.Fluid.filterAttributes = fluid $FLUID_VERSION qtrefdoc
16qhp.Fluid.customFilters.Qt.name = Fluid $FLUID_VERSION
17qhp.Fluid.customFilters.Qt.filterAttributes = fluid $FLUID_VERSION
18
19qhp.Fluid.subprojects = fluidcore fluidcontrols fluideffects fluidmaterial
20qhp.Fluid.subproject.fluidcore.title = Fluid Core
21qhp.Fluid.subproject.fluidcore.indexTitle = Fluid Core QML Types
22qhp.Fluid.subprojects.fluidcore.selectors = qmlclass
23qhp.Fluid.subprojects.fluidcore.sortPages = true
24qhp.Fluid.subproject.fluidcontrols.title = Fluid Controls
25qhp.Fluid.subproject.fluidcontrols.indexTitle = Fluid Controls QML Types
26qhp.Fluid.subprojects.fluidcontrols.selectors = qmlclass
27qhp.Fluid.subprojects.fluidcontrols.sortPages = true
28qhp.Fluid.subproject.fluideffects.title = Fluid Controls
29qhp.Fluid.subproject.fluideffects.indexTitle = Fluid Effects QML Types
30qhp.Fluid.subprojects.fluideffects.selectors = qmlclass
31qhp.Fluid.subprojects.fluideffects.sortPages = true
32qhp.Fluid.subproject.fluidmaterial.title = Fluid Controls
33qhp.Fluid.subproject.fluidmaterial.indexTitle = Fluid Controls QML Types
34qhp.Fluid.subprojects.fluidmaterial.selectors = qmlclass
35qhp.Fluid.subprojects.fluidmaterial.sortPages = true
36
37indexes += $QT_INSTALL_DOCS/qtcore/qtcore.index
38indexes += $QT_INSTALL_DOCS/qtgui/qtgui.index
39indexes += $QT_INSTALL_DOCS/qtqml/qtqml.index
40indexes += $QT_INSTALL_DOCS/qtquick/qtquick.index
41indexes += $QT_INSTALL_DOCS/qtquickcontrols2/qtquickcontrols2.index
42
43depends += qtcore qtgui qtqml qtquick qtquickcontrols2
44
45# Specify the install path under QT_INSTALL_EXAMPLES
46# Note: paths passed to \example command must contain the parent directory, e.g.
47# \example controls/tabs
48#exampledirs += snippets
49
50#examplesinstallpath = fluid
51
52sourcedirs += ../core ../controls ../effects ../material src
53
54headerdirs += ../core ../controls ../effects ../material src
55
56imagedirs += images
57
58navigation.landingpage = "Fluid"
59navigation.homepage = "Fluid Documentation"
diff --git a/prototype_2016/third_party/fluid/doc/html-footer-offline.qdocconf b/prototype_2016/third_party/fluid/doc/html-footer-offline.qdocconf
new file mode 100644
index 0000000..26f4557
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/html-footer-offline.qdocconf
@@ -0,0 +1,18 @@
1HTML.footer = \
2 " </div>\n" \
3 " </div>\n" \
4 " </div>\n" \
5 " </div>\n" \
6 "</div>\n" \
7 "<div class=\"footer\">\n" \
8 " <p>\n" \
9 " <acronym title=\"Copyright\">&copy;</acronym> 2016 Liri.\n" \
10 " Documentation contributions included herein are the copyrights of\n" \
11 " their respective owners.<br>" \
12 " The documentation provided herein is licensed under the terms of the" \
13 " <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU Free Documentation" \
14 " License version 1.3</a> as published by the Free Software Foundation.<br>" \
15 " Qt and respective logos are trademarks of The Qt Company Ltd. " \
16 " in Finland and/or other countries worldwide. All other trademarks are property\n" \
17 " of their respective owners. </p>\n" \
18 "</div>\n" \
diff --git a/prototype_2016/third_party/fluid/doc/src/fluidcontrols.qdoc b/prototype_2016/third_party/fluid/doc/src/fluidcontrols.qdoc
new file mode 100644
index 0000000..cde0ed5
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/src/fluidcontrols.qdoc
@@ -0,0 +1,25 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2016 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
15/*!
16 \qmlmodule Fluid.Controls 1.0
17 \title Fluid Controls QML Types
18 \ingroup fluidcontrols
19
20 \brief Provides additional controls to extend Qt Quick Controls 2.
21
22 \section1 References
23
24 Fluid Controls extends \l[QtQuickControls2]{Qt Quick Controls 2}.
25*/
diff --git a/prototype_2016/third_party/fluid/doc/src/fluidcore.qdoc b/prototype_2016/third_party/fluid/doc/src/fluidcore.qdoc
new file mode 100644
index 0000000..82294bd
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/src/fluidcore.qdoc
@@ -0,0 +1,30 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2016 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
15/*!
16 \qmlmodule Fluid.Core 1.0
17 \title Fluid Core QML Types
18 \ingroup fluidcore
19
20 \brief Provides basic QML types for Qt applications.
21
22 Basic QML types for Qt applications.
23
24 The Fluid Core QML Types can be imported into your application
25 using the following import statement:
26
27 \code
28 import Fluid.Core 1.0
29 \endcode
30*/
diff --git a/prototype_2016/third_party/fluid/doc/src/fluideffects.qdoc b/prototype_2016/third_party/fluid/doc/src/fluideffects.qdoc
new file mode 100644
index 0000000..751be11
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/src/fluideffects.qdoc
@@ -0,0 +1,21 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2016 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
15/*!
16 \qmlmodule Fluid.Effects 1.0
17 \title Fluid Effects QML Types
18 \ingroup fluideffects
19
20 \brief Provides effects for Qt applications.
21*/
diff --git a/prototype_2016/third_party/fluid/doc/src/fluidmaterial.qdoc b/prototype_2016/third_party/fluid/doc/src/fluidmaterial.qdoc
new file mode 100644
index 0000000..4423b7b
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/src/fluidmaterial.qdoc
@@ -0,0 +1,21 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2016 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
15/*!
16 \qmlmodule Fluid.Material 1.0
17 \title Fluid Material QML Types
18 \ingroup fluidmaterial
19
20 \brief Provides QML types specific to Material Design.
21*/
diff --git a/prototype_2016/third_party/fluid/doc/src/index.qdoc b/prototype_2016/third_party/fluid/doc/src/index.qdoc
new file mode 100644
index 0000000..0d87196
--- /dev/null
+++ b/prototype_2016/third_party/fluid/doc/src/index.qdoc
@@ -0,0 +1,31 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2016 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
15/*!
16 \page index.html
17 \keyword Fluid Reference Documentation
18
19 A collection of cross-platform QtQuick components for building fluid and dynamic applications.
20
21 \section1 QML Modules
22
23 Fluid is comprised of several QML modules.
24
25 \list
26 \li \l[FluidCore]{Fluid Core QML Types}
27 \li \l[FluidControls]{Fluid Controls QML Types}
28 \li \l[FluidEffects]{Fluid Effects QML Types}
29 \li \l[FluidMaterial]{Fluid Material QML Types}
30 \endlist
31*/
diff --git a/prototype_2016/third_party/fluid/effects/BoxShadow.qml b/prototype_2016/third_party/fluid/effects/BoxShadow.qml
new file mode 100644
index 0000000..2fb3616
--- /dev/null
+++ b/prototype_2016/third_party/fluid/effects/BoxShadow.qml
@@ -0,0 +1,53 @@
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 2.0
16import QtGraphicalEffects 1.0
17
18/*!
19 \qmltype BoxShadow
20 \inqmlmodule Fluid.Effects
21 \ingroup fluideffects
22
23 \brief A implementation of CSS's box-shadow.
24
25 A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design
26 elevation shadow effect.
27*/
28RectangularGlow {
29 // The 4 properties from CSS box-shadow, plus the inherited color property
30 property int offsetX
31 property int offsetY
32 property int blurRadius
33 property int spreadRadius
34
35 // The source item the shadow is being applied to, used for correctly
36 // calculating the corner radius
37 property Item source
38
39 property bool fullWidth
40 property bool fullHeight
41
42 x: (parent.width - width)/2 + offsetX
43 y: (parent.height - height)/2 + offsetY
44
45 implicitWidth: source ? source.width : parent.width
46 implicitHeight: source ? source.height : parent.height
47
48 width: implicitWidth + 2 * spreadRadius + (fullWidth ? 2 * cornerRadius : 0)
49 height: implicitHeight + 2 * spreadRadius + (fullHeight ? 2 * cornerRadius : 0)
50 glowRadius: blurRadius/2
51 spread: 0.05
52 cornerRadius: blurRadius + (source && source.radius || 0)
53}
diff --git a/prototype_2016/third_party/fluid/effects/CMakeLists.txt b/prototype_2016/third_party/fluid/effects/CMakeLists.txt
new file mode 100644
index 0000000..86ab09d
--- /dev/null
+++ b/prototype_2016/third_party/fluid/effects/CMakeLists.txt
@@ -0,0 +1,10 @@
1set(FILES
2 plugins.qmltypes
3 qmldir
4 BoxShadow.qml
5 CircleMask.qml
6 Vignette.qml
7)
8
9install(FILES ${FILES}
10 DESTINATION ${QML_INSTALL_DIR}/Fluid/Effects)
diff --git a/prototype_2016/third_party/qml-material/src/extras/CircleMask.qml b/prototype_2016/third_party/fluid/effects/CircleMask.qml
index cd92028..0a70c44 100644
--- a/prototype_2016/third_party/qml-material/src/extras/CircleMask.qml
+++ b/prototype_2016/third_party/fluid/effects/CircleMask.qml
@@ -1,16 +1,28 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> 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$
5 * 8 *
6 * This Source Code Form is subject to the terms of the Mozilla Public 9 * 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 10 * 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/. 11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
9 */ 14 */
10 15
11import QtQuick 2.4 16import QtQuick 2.4
12import QtGraphicalEffects 1.0 17import QtGraphicalEffects 1.0
13 18
19/*!
20 \qmltype CircleMask
21 \inqmlmodule Fluid.Effects
22 \ingroup fluideffects
23
24 \brief Circular mask.
25*/
14Item { 26Item {
15 id: item 27 id: item
16 28
@@ -18,7 +30,9 @@ Item {
18 30
19 Rectangle { 31 Rectangle {
20 id: circleMask 32 id: circleMask
21 anchors.fill: parent 33
34 width: parent.width
35 height: parent.height
22 36
23 smooth: true 37 smooth: true
24 visible: false 38 visible: false
@@ -29,7 +43,9 @@ Item {
29 OpacityMask { 43 OpacityMask {
30 id: mask 44 id: mask
31 45
32 anchors.fill: parent 46 width: parent.width
47 height: parent.height
48
33 maskSource: circleMask 49 maskSource: circleMask
34 } 50 }
35} 51}
diff --git a/prototype_2016/third_party/fluid/effects/Vignette.qml b/prototype_2016/third_party/fluid/effects/Vignette.qml
new file mode 100644
index 0000000..2258190
--- /dev/null
+++ b/prototype_2016/third_party/fluid/effects/Vignette.qml
@@ -0,0 +1,77 @@
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
17/*!
18 \qmltype Vignette
19 \inqmlmodule Fluid.Effects
20 \ingroup fluideffects
21
22 \brief Vignette effect.
23*/
24Item {
25 id: root
26
27 /*!
28 This property defines the source item that is going to be used as source
29 for the generated effect.
30 */
31 property variant source
32
33 /*!
34 This property defines the vignette radius.
35 */
36 property alias radius: effect.radius
37
38 /*!
39 This property defines how much brightness will be used.
40 */
41 property alias brightness: effect.brightness
42
43 ShaderEffect {
44 id: effect
45 anchors.fill: parent
46
47 property variant source: ShaderEffectSource {
48 sourceItem: root.source
49 sourceRect: Qt.rect(0, 0, 0, 0)
50 hideSource: false
51 smooth: true
52 visible: false
53 }
54
55 property real radius: 16
56 property real brightness: 0.1
57
58 fragmentShader: "
59 varying highp vec2 qt_TexCoord0;
60 uniform highp float qt_Opacity;
61 uniform highp float radius;
62 uniform highp float brightness;
63 uniform lowp sampler2D source;
64
65 void main() {
66 highp vec2 uv = qt_TexCoord0.xy;
67 highp vec2 coord = qt_TexCoord0 - 0.5;
68 lowp vec4 orig = texture2D(source, uv);
69
70 highp float vignette = 1.0 - dot(coord, coord);
71
72 lowp vec3 col = orig.rgb * clamp(pow(vignette, radius) + brightness, 0.0, 1.0);
73
74 gl_FragColor = vec4(col, 1.0);
75 }"
76 }
77}
diff --git a/prototype_2016/third_party/fluid/effects/effects.pri b/prototype_2016/third_party/fluid/effects/effects.pri
new file mode 100644
index 0000000..afb9022
--- /dev/null
+++ b/prototype_2016/third_party/fluid/effects/effects.pri
@@ -0,0 +1 @@
RESOURCES += $$PWD/effects.qrc
diff --git a/prototype_2016/third_party/fluid/effects/effects.qrc b/prototype_2016/third_party/fluid/effects/effects.qrc
new file mode 100644
index 0000000..1331e4f
--- /dev/null
+++ b/prototype_2016/third_party/fluid/effects/effects.qrc
@@ -0,0 +1,9 @@
1<RCC>
2 <qresource prefix="/Fluid/Effects">
3 <file>BoxShadow.qml</file>
4 <file>CircleMask.qml</file>
5 <file>plugins.qmltypes</file>
6 <file>qmldir</file>
7 <file>Vignette.qml</file>
8 </qresource>
9</RCC>
diff --git a/prototype_2016/third_party/fluid/effects/plugins.qmltypes b/prototype_2016/third_party/fluid/effects/plugins.qmltypes
new file mode 100644
index 0000000..85c0289
--- /dev/null
+++ b/prototype_2016/third_party/fluid/effects/plugins.qmltypes
@@ -0,0 +1,15 @@
1import QtQuick.tooling 1.2
2
3// This file describes the plugin-supplied types contained in the library.
4// It is used for QML tooling purposes only.
5//
6// This file was auto-generated by:
7// 'qmlplugindump-qt5 -nonrelocatable Fluid.Effects 1.0'
8
9Module {
10 dependencies: [
11 "QtGraphicalEffects 1.0",
12 "QtQuick 2.4",
13 "QtQuick.Window 2.1"
14 ]
15}
diff --git a/prototype_2016/third_party/fluid/effects/qmldir b/prototype_2016/third_party/fluid/effects/qmldir
new file mode 100644
index 0000000..225a435
--- /dev/null
+++ b/prototype_2016/third_party/fluid/effects/qmldir
@@ -0,0 +1,6 @@
1module Fluid.Effects
2typeinfo plugins.qmltypes
3
4BoxShadow 1.0 BoxShadow.qml
5CircleMask 1.0 CircleMask.qml
6Vignette 1.0 Vignette.qml
diff --git a/prototype_2016/third_party/fluid/fluid.pri b/prototype_2016/third_party/fluid/fluid.pri
new file mode 100644
index 0000000..af7e52a
--- /dev/null
+++ b/prototype_2016/third_party/fluid/fluid.pri
@@ -0,0 +1,8 @@
1DEFINES += FLUID_LOCAL
2include(src/src.pri)
3include(core/core.pri)
4include(controls/controls.pri)
5include(effects/effects.pri)
6include(material/material.pri)
7
8RESOURCES += $$PWD/icons/icons.qrc
diff --git a/prototype_2016/third_party/fluid/material/ActionButton.qml b/prototype_2016/third_party/fluid/material/ActionButton.qml
new file mode 100644
index 0000000..e6cdcfc
--- /dev/null
+++ b/prototype_2016/third_party/fluid/material/ActionButton.qml
@@ -0,0 +1,106 @@
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.4
17import QtQuick.Controls 2.0
18import QtQuick.Controls.Material 2.0
19import Fluid.Core 1.0
20import Fluid.Controls 1.0
21import QtGraphicalEffects 1.0
22
23/*!
24 \qmltype ActionButton
25 \inqmlmodule Fluid.Material
26
27 \brief A floating action button.
28
29 An ActionButton is a floating action button that provides a primary action
30 on the current page.
31 */
32Button {
33 id: button
34
35 /*!
36 The name of the icon to display in the action button, selected from the Material
37 Design icon collection by Google.
38 */
39 property alias iconName: icon.name
40
41 /*!
42 Floating action buttons come in two sizes:
43
44 \list
45 \li \b {Default size} - for most use cases
46 \li \b {Mini size} - only used to create visual continuity with other screen elements
47 \endlist
48 */
49 property bool isMiniSize: false
50
51 padding: 0
52
53 width: 76
54 height: 76
55
56 contentItem: Item {
57 implicitHeight: isMiniSize ? 40 : 56
58 implicitWidth: implicitHeight
59
60 Icon {
61 id: icon
62
63 anchors.centerIn: parent
64 color: Utils.lightDark(button.Material.background, "black", "white")
65 size: 24
66 }
67 }
68
69 background: Rectangle {
70 implicitWidth: 64
71 implicitHeight: 64
72
73 x: 6
74 y: 6
75
76 width: parent.width - 12
77 height: parent.height - 12
78
79 radius: width/2
80
81 color: button.Material.background
82
83 RectangularGlow {
84 anchors.centerIn: parent
85 anchors.verticalCenterOffset: button.Material.elevation === 1 ? 1.5 : 1
86
87 width: parent.width
88 height: parent.height
89
90 z: -1
91
92 glowRadius: button.Material.elevation === 1 ? 0.75 : 0.3
93 opacity: button.Material.elevation === 1 ? 0.6 : 0.3
94 spread: button.Material.elevation === 1 ? 0.7 : 0.85
95 color: "black"
96 cornerRadius: height/2
97 }
98
99 Ripple {
100 anchors.fill: parent
101 control: button
102
103 circular: true
104 }
105 }
106}
diff --git a/prototype_2016/third_party/fluid/material/CMakeLists.txt b/prototype_2016/third_party/fluid/material/CMakeLists.txt
new file mode 100644
index 0000000..04be30a
--- /dev/null
+++ b/prototype_2016/third_party/fluid/material/CMakeLists.txt
@@ -0,0 +1,11 @@
1set(FLUID_FILES
2 plugins.qmltypes
3 qmldir
4 ActionButton.qml
5 ElevationEffect.qml
6 Ripple.qml
7 Wave.qml
8)
9
10install(FILES ${FLUID_FILES}
11 DESTINATION ${QML_INSTALL_DIR}/Fluid/Material)
diff --git a/prototype_2016/third_party/fluid/material/ElevationEffect.qml b/prototype_2016/third_party/fluid/material/ElevationEffect.qml
new file mode 100644
index 0000000..e72d517
--- /dev/null
+++ b/prototype_2016/third_party/fluid/material/ElevationEffect.qml
@@ -0,0 +1,251 @@
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 2.6
16import Fluid.Effects 1.0
17
18/*!
19 An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect.
20 */
21Item {
22 id: effect
23
24 /*!
25 The source the effect is applied to.
26 */
27 property var source
28
29 /*!
30 The elevation of the \l source Item.
31 */
32 property int elevation: 0
33
34 /*!
35 Set to \c true if the \l source Item is the same width as its parent and the shadow
36 should be full width instead of rounding around the corner of the Item.
37 \sa fullHeight
38 */
39 property bool fullWidth: false
40
41 /*!
42 Set to \c true if the \l source Item is the same height as its parent and the shadow
43 should be full height instead of rounding around the corner of the Item.
44 \sa fullWidth
45 */
46 property bool fullHeight: false
47
48 /*!
49 \internal
50 The actual source Item the effect is applied to.
51 */
52 readonly property Item sourceItem: source.sourceItem
53
54 /*
55 * The following shadow values are taken from Angular Material
56 *
57 * The MIT License (MIT)
58 *
59 * Copyright (c) 2014-2016 Google, Inc. http://angularjs.org
60 *
61 * Permission is hereby granted, free of charge, to any person obtaining a copy
62 * of this software and associated documentation files (the "Software"), to deal
63 * in the Software without restriction, including without limitation the rights
64 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
65 * copies of the Software, and to permit persons to whom the Software is
66 * furnished to do so, subject to the following conditions:
67 *
68 * The above copyright notice and this permission notice shall be included in all
69 * copies or substantial portions of the Software.
70 *
71 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
73 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
74 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
75 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
76 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
77 * SOFTWARE.
78 */
79 /*!
80 \internal
81 The shadows to use for each possible elevation. There are three shadows that when combined
82 make up the elevation.
83 */
84 readonly property var _shadows: [
85 [{offset: 0, blur: 0, spread: 0},
86 {offset: 0, blur: 0, spread: 0},
87 {offset: 0, blur: 0, spread: 0}],
88
89 [{offset: 1, blur: 3, spread: 0},
90 {offset: 1, blur: 1, spread: 0},
91 {offset: 2, blur: 1, spread: -1}],
92
93 [{offset: 1, blur: 5, spread: 0},
94 {offset: 2, blur: 2, spread: 0},
95 {offset: 3, blur: 1, spread: -2}],
96
97 [{offset: 1, blur: 8, spread: 0},
98 {offset: 3, blur: 4, spread: 0},
99 {offset: 3, blur: 3, spread: -2}],
100
101 [{offset: 2, blur: 4, spread: -1},
102 {offset: 4, blur: 5, spread: 0},
103 {offset: 1, blur: 10, spread: 0}],
104
105 [{offset: 3, blur: 5, spread: -1},
106 {offset: 5, blur: 8, spread: 0},
107 {offset: 1, blur: 14, spread: 0}],
108
109 [{offset: 3, blur: 5, spread: -1},
110 {offset: 6, blur: 10, spread: 0},
111 {offset: 1, blur: 18, spread: 0}],
112
113 [{offset: 4, blur: 5, spread: -2},
114 {offset: 7, blur: 10, spread: 1},
115 {offset: 2, blur: 16, spread: 1}],
116
117 [{offset: 5, blur: 5, spread: -3},
118 {offset: 8, blur: 10, spread: 1},
119 {offset: 3, blur: 14, spread: 2}],
120
121 [{offset: 5, blur: 6, spread: -3},
122 {offset: 9, blur: 12, spread: 1},
123 {offset: 3, blur: 16, spread: 2}],
124
125 [{offset: 6, blur: 6, spread: -3},
126 {offset: 10, blur: 14, spread: 1},
127 {offset: 4, blur: 18, spread: 3}],
128
129 [{offset: 6, blur: 7, spread: -4},
130 {offset: 11, blur: 15, spread: 1},
131 {offset: 4, blur: 20, spread: 3}],
132
133 [{offset: 7, blur: 8, spread: -4},
134 {offset: 12, blur: 17, spread: 2},
135 {offset: 5, blur: 22, spread: 4}],
136
137 [{offset: 7, blur: 8, spread: -4},
138 {offset: 13, blur: 19, spread: 2},
139 {offset: 5, blur: 24, spread: 4}],
140
141 [{offset: 7, blur: 9, spread: -4},
142 {offset: 14, blur: 21, spread: 2},
143 {offset: 5, blur: 26, spread: 4}],
144
145 [{offset: 8, blur: 9, spread: -5},
146 {offset: 15, blur: 22, spread: 2},
147 {offset: 6, blur: 28, spread: 5}],
148
149 [{offset: 8, blur: 10, spread: -5},
150 {offset: 16, blur: 24, spread: 2},
151 {offset: 6, blur: 30, spread: 5}],
152
153 [{offset: 8, blur: 11, spread: -5},
154 {offset: 17, blur: 26, spread: 2},
155 {offset: 6, blur: 32, spread: 5}],
156
157 [{offset: 9, blur: 11, spread: -5},
158 {offset: 18, blur: 28, spread: 2},
159 {offset: 7, blur: 34, spread: 6}],
160
161 [{offset: 9, blur: 12, spread: -6},
162 {offset: 19, blur: 29, spread: 2},
163 {offset: 7, blur: 36, spread: 6}],
164
165 [{offset: 10, blur: 13, spread: -6},
166 {offset: 20, blur: 31, spread: 3},
167 {offset: 8, blur: 38, spread: 7}],
168
169 [{offset: 10, blur: 13, spread: -6},
170 {offset: 21, blur: 33, spread: 3},
171 {offset: 8, blur: 40, spread: 7}],
172
173 [{offset: 10, blur: 14, spread: -6},
174 {offset: 22, blur: 35, spread: 3},
175 {offset: 8, blur: 42, spread: 7}],
176
177 [{offset: 11, blur: 14, spread: -7},
178 {offset: 23, blur: 36, spread: 3},
179 {offset: 9, blur: 44, spread: 8}],
180
181 [{offset: 11, blur: 15, spread: -7},
182 {offset: 24, blur: 38, spread: 3},
183 {offset: 9, blur: 46, spread: 8}]
184 ]
185
186 /*!
187 \internal
188 The current shadow based on the elevation.
189 */
190 readonly property var _shadow: _shadows[elevation]
191
192 // Nest the shadows and source view in two items rendered as a layer
193 // so the shadow is not clipped by the bounds of the source view
194 Item {
195 property int margin: -100
196
197 x: margin
198 y: margin
199 width: parent.width - 2 * margin
200 height: parent.height - 2 * margin
201
202 // By rendering as a layer, the shadow will never show through the source item,
203 // even when the source item's opacity is less than 1
204 layer.enabled: true
205
206 // The box shadows automatically pick up the size of the source Item and not
207 // the size of the parent, so we don't need to worry about the extra padding
208 // in the parent Item
209 BoxShadow {
210 offsetY: _shadow[0].offset
211 blurRadius: _shadow[0].blur
212 spreadRadius: _shadow[0].spread
213 color: Qt.rgba(0,0,0, 0.2)
214
215 fullWidth: effect.fullWidth
216 fullHeight: effect.fullHeight
217 source: effect.sourceItem
218 }
219
220 BoxShadow {
221 offsetY: _shadow[1].offset
222 blurRadius: _shadow[1].blur
223 spreadRadius: _shadow[1].spread
224 color: Qt.rgba(0,0,0, 0.14)
225
226 fullWidth: effect.fullWidth
227 fullHeight: effect.fullHeight
228 source: effect.sourceItem
229 }
230
231 BoxShadow {
232 offsetY: _shadow[2].offset
233 blurRadius: _shadow[2].blur
234 spreadRadius: _shadow[2].spread
235 color: Qt.rgba(0,0,0, 0.12)
236
237 fullWidth: effect.fullWidth
238 fullHeight: effect.fullHeight
239 source: effect.sourceItem
240 }
241
242 ShaderEffect {
243 property alias source: effect.source
244
245 x: (parent.width - width)/2
246 y: (parent.height - height)/2
247 width: sourceItem.width
248 height: sourceItem.height
249 }
250 }
251}
diff --git a/prototype_2016/third_party/qml-material/src/core/Ink.qml b/prototype_2016/third_party/fluid/material/Ripple.qml
index af73332..b99a46a 100644
--- a/prototype_2016/third_party/qml-material/src/core/Ink.qml
+++ b/prototype_2016/third_party/fluid/material/Ripple.qml
@@ -1,97 +1,142 @@
1/* 1/*
2 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 * 3 *
4 * Copyright (C) 2014-2016 Michael Spencer <sonrisesoftware@gmail.com> 4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 * 2014 Marcin Baszczewski 5 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
6 *
7 * $BEGIN_LICENSE:MPL2$
6 * 8 *
7 * This Source Code Form is subject to the terms of the Mozilla Public 9 * 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 10 * 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/. 11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
10 */ 14 */
11 15
12import QtQuick 2.4 16import QtQuick 2.4
13import Material 0.3 17import Fluid.Core 1.0
14import Material.Extras 0.1 18import Fluid.Effects 1.0
15 19
16/*! 20/*!
17 \qmltype Ink 21 \qmltype Ripple
18 \inqmlmodule Material 22 \inqmlmodule Fluid.UI 1.0
23 \brief Represents a Material Design ripple ink animation used in various touchable components.
19 24
20 \brief Represents a ripple ink animation used in buttons and many other components. 25 This component is useful for including in Material Design-specific components, which should be implemented using the +material file selector. Eventually this should be upstreamed to QtQuick
26 Controls 2.
21 */ 27 */
22MouseArea { 28MouseArea {
23 id: view 29 id: ripple
24 30
25 clip: true 31 /*!
26 hoverEnabled: Device.hoverEnabled 32 The color of the ripple. Defaults to black with 12% opacity.
27 z: 2 33 */
28 34 property color color: Qt.rgba(0,0,0,0.12)
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
36 /*!
37 Set to \c true if the ripple is used on a circular component, such as a button in an
38 action bar or a floating action button.
39 */
35 property bool circular: false 40 property bool circular: false
41
42 /*!
43 Set to \c true if the ripple should be centered regardless of where the mouse/touch
44 input came from.
45 */
36 property bool centered: false 46 property bool centered: false
37 47
38 property int focusWidth: width - 32 * Units.dp 48 /*!
49 Set to \c true if the component is focused and should display a focus ripple.
50 */
39 property bool focused 51 property bool focused
52
53 /*!
54 The color of the focus ripple. Also used to determine the color of the focus background
55 behind the ripple.
56 \sa focused
57 */
40 property color focusColor: "transparent" 58 property color focusColor: "transparent"
41 59
42 property bool showFocus: true 60 /*!
61 The width of the focus ripple.
62 \sa focused
63 */
64 property int focusWidth: width - 32
43 65
44 onPressed: { 66 property Item control
45 createTapCircle(mouse.x, mouse.y)
46 }
47 67
48 onCanceled: { 68 clip: true
49 lastCircle.removeCircle(); 69 hoverEnabled: Device.hoverEnabled
50 }
51 70
52 onReleased: { 71 Connections {
53 lastCircle.removeCircle(); 72 target: control
73
74 onPressedChanged: {
75 if (!control.pressed)
76 __private.removeLastCircle()
77 }
54 } 78 }
55 79
56 function createTapCircle(x, y) { 80 onPressed: {
57 endRadius = centered ? width/2 : radius(x, y) 81 __private.createTapCircle(mouse.x, mouse.y)
58 showFocus = false
59 82
60 lastCircle = tapCircle.createObject(view, { 83 if (control)
61 "circleX": centered ? width/2 : x, 84 mouse.accepted = false
62 "circleY": centered ? height/2 : y
63 });
64 } 85 }
65 86
66 function radius(x, y) { 87 onReleased: __private.removeLastCircle()
67 var dist1 = Math.max(dist(x, y, 0, 0), dist(x, y, width, height)) 88 onCanceled: __private.removeLastCircle()
68 var dist2 = Math.max(dist(x, y, width, 0), dist(x, y, 0, height))
69 89
70 return Math.max(dist1, dist2) 90 QtObject {
71 } 91 id: __private
92
93 property int startRadius: circular ? width/10 : width/6
94 property int endRadius
95 property bool showFocus: true
96
97 property Item lastCircle
72 98
73 function dist(x1, y1, x2, y2) { 99 function createTapCircle(x, y) {
74 var xs = 0; 100 endRadius = centered ? width/2 : radius(x, y) + 5
75 var ys = 0; 101 showFocus = false
76 102
77 xs = x2 - x1; 103 lastCircle = tapCircle.createObject(ripple, {
78 xs = xs * xs; 104 "circleX": centered ? width/2 : x,
105 "circleY": centered ? height/2 : y
106 })
107 }
108
109 function removeLastCircle() {
110 if (lastCircle)
111 lastCircle.removeCircle()
112 }
113
114 function radius(x, y) {
115 var dist1 = Math.max(dist(x, y, 0, 0), dist(x, y, width, height))
116 var dist2 = Math.max(dist(x, y, width, 0), dist(x, y, 0, height))
117
118 return Math.max(dist1, dist2)
119 }
79 120
80 ys = y2 - y1; 121 function dist(x1, y1, x2, y2) {
81 ys = ys * ys; 122 var distX = x2 - x1
123 var distY = y2 - y1
82 124
83 return Math.sqrt( xs + ys ); 125 return Math.sqrt(distX * distX + distY * distY)
126 }
84 } 127 }
85 128
86 Rectangle { 129 Rectangle {
87 id: focusBackground 130 id: focusBackground
131 objectName: "focusBackground"
88 132
89 anchors.fill: parent 133 width: parent.width
134 height: parent.height
90 135
91 color: Theme.isDarkColor(focusColor) && focusColor.a > 0 136 color: Utils.isDarkColor(focusColor) && focusColor.a > 0
92 ? Qt.rgba(0,0,0,0.2) : Qt.rgba(0,0,0,0.1) 137 ? Qt.rgba(0,0,0,0.2) : Qt.rgba(0,0,0,0.1)
93 138
94 opacity: showFocus && focused ? 1 : 0 139 opacity: __private.showFocus && focused ? 1 : 0
95 140
96 Behavior on opacity { 141 Behavior on opacity {
97 NumberAnimation { duration: 500; easing.type: Easing.InOutQuad } 142 NumberAnimation { duration: 500; easing.type: Easing.InOutQuad }
@@ -100,18 +145,24 @@ MouseArea {
100 145
101 Rectangle { 146 Rectangle {
102 id: focusCircle 147 id: focusCircle
148 objectName: "focusRipple"
149
150 property bool focusedState
103 151
104 anchors.centerIn: parent 152 x: (parent.width - width)/2
153 y: (parent.height - height)/2
105 154
106 width: focused 155 width: focused
107 ? focusedState ? focusWidth 156 ? focusedState ? focusWidth
108 : Math.min(parent.width - 8 * Units.dp, focusWidth + 12 * Units.dp) 157 : Math.min(parent.width - 8, focusWidth + 12)
109 : parent.width/5 158 : parent.width/5
110 height: width 159 height: width
111 160
112 radius: width/2 161 radius: width/2
113 162
114 opacity: showFocus && focused ? 1 : 0 163 opacity: __private.showFocus && focused ? 1 : 0
164
165 color: focusColor.a === 0 ? Qt.rgba(1,1,1,0.4) : focusColor
115 166
116 Behavior on opacity { 167 Behavior on opacity {
117 NumberAnimation { duration: 500; easing.type: Easing.InOutQuad } 168 NumberAnimation { duration: 500; easing.type: Easing.InOutQuad }
@@ -121,10 +172,6 @@ MouseArea {
121 NumberAnimation { duration: focusTimer.interval; } 172 NumberAnimation { duration: focusTimer.interval; }
122 } 173 }
123 174
124 color: focusColor.a === 0 ? Qt.rgba(1,1,1,0.4) : focusColor
125
126 property bool focusedState
127
128 Timer { 175 Timer {
129 id: focusTimer 176 id: focusTimer
130 running: focused 177 running: focused
@@ -140,11 +187,18 @@ MouseArea {
140 187
141 Item { 188 Item {
142 id: circleItem 189 id: circleItem
143 190 objectName: "tapRipple"
144 anchors.fill: parent
145 191
146 property bool done 192 property bool done
147 193
194 property real circleX
195 property real circleY
196
197 property bool closed
198
199 width: parent.width
200 height: parent.height
201
148 function removeCircle() { 202 function removeCircle() {
149 done = true 203 done = true
150 204
@@ -154,21 +208,19 @@ MouseArea {
154 208
155 circleItem.destroy(500); 209 circleItem.destroy(500);
156 } else { 210 } else {
157 showFocus = true 211 __private.showFocus = true
158 fadeAnimation.start(); 212 fadeAnimation.start();
159 213
160 circleItem.destroy(300); 214 circleItem.destroy(300);
161 } 215 }
162 } 216 }
163 217
164 property real circleX
165 property real circleY
166
167 property bool closed
168
169 Item { 218 Item {
170 id: circleParent 219 id: circleParent
171 anchors.fill: parent 220
221 width: parent.width
222 height: parent.height
223
172 visible: !circular 224 visible: !circular
173 225
174 Rectangle { 226 Rectangle {
@@ -181,18 +233,19 @@ MouseArea {
181 height: radius * 2 233 height: radius * 2
182 234
183 opacity: 0 235 opacity: 0
184 color: view.color 236 color: ripple.color
185 237
186 NumberAnimation { 238 NumberAnimation {
187 id: fillSizeAnimation 239 id: fillSizeAnimation
188 running: true 240 running: true
189 241
190 target: circleRectangle; property: "radius"; duration: 500; 242 target: circleRectangle; property: "radius"; duration: 500;
191 from: startRadius; to: endRadius; easing.type: Easing.InOutQuad 243 from: __private.startRadius; to: __private.endRadius;
244 easing.type: Easing.InOutQuad
192 245
193 onStopped: { 246 onStopped: {
194 if (done) 247 if (done)
195 showFocus = true 248 __private.showFocus = true
196 } 249 }
197 } 250 }
198 251
diff --git a/prototype_2016/third_party/qml-material/src/components/Wave.qml b/prototype_2016/third_party/fluid/material/Wave.qml
index 3a0afb4..50ea8ae 100644
--- a/prototype_2016/third_party/qml-material/src/components/Wave.qml
+++ b/prototype_2016/third_party/fluid/material/Wave.qml
@@ -1,29 +1,23 @@
1/***** THIS FILE CANNOT BE RELICENSED UNDER THE MPL YET *****/
2
3/* 1/*
4 * QML Material - An application framework implementing Material Design. 2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
5 * Copyright (C) 2014 Bogdan Cuza <bogdan.cuza@hotmail.com> 5 * Copyright (C) 2014 Bogdan Cuza <bogdan.cuza@hotmail.com>
6 * 6 *
7 * This program is free software: you can redistribute it and/or modify 7 * $BEGIN_LICENSE:MPL2$
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 * 8 *
12 * This program is distributed in the hope that it will be useful, 9 * This Source Code Form is subject to the terms of the Mozilla Public
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * License, v. 2.0. If a copy of the MPL was not distributed with this
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 * GNU Lesser General Public License for more details.
16 * 12 *
17 * You should have received a copy of the GNU Lesser General Public License 13 * $END_LICENSE$
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */ 14 */
20 15
21import QtQuick 2.4 16import QtQuick 2.4
22 17
23/*! 18/*!
24 \qmltype Wave 19 \qmltype Wave
25 \inqmlmodule Material 20 \inqmlmodule Fluid.Material 1.0
26
27 \brief Provides a wave animation for transitioning between views of content. 21 \brief Provides a wave animation for transitioning between views of content.
28 */ 22 */
29Rectangle { 23Rectangle {
@@ -35,19 +29,20 @@ Rectangle {
35 property real initialY 29 property real initialY
36 property real abstractWidth: parent.width 30 property real abstractWidth: parent.width
37 property real abstractHeight: parent.height 31 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)) 32 property real diameter: 2 * Math.sqrt(Math.pow(Math.max(initialX, abstractWidth - initialX), 2)
33 + Math.pow(Math.max(initialY, abstractHeight - initialY), 2))
39 34
40 signal finished(bool opened) 35 signal finished(bool opened)
41 36
42 function open(x, y) { 37 function open(x, y) {
43 wave.initialX = x; 38 wave.initialX = x || parent.width/2;
44 wave.initialY = y; 39 wave.initialY = y || parent.height/2;
45 wave.opened = true; 40 wave.opened = true;
46 } 41 }
47 42
48 function close(x, y) { 43 function close(x, y) {
49 wave.initialX = x; 44 wave.initialX = x || parent.width/2;
50 wave.initialY = y; 45 wave.initialY = y || parent.height/2;
51 wave.opened = false; 46 wave.opened = false;
52 } 47 }
53 48
diff --git a/prototype_2016/third_party/fluid/material/material.pri b/prototype_2016/third_party/fluid/material/material.pri
new file mode 100644
index 0000000..6016f5f
--- /dev/null
+++ b/prototype_2016/third_party/fluid/material/material.pri
@@ -0,0 +1,2 @@
1RESOURCES += \
2 $$PWD/material.qrc
diff --git a/prototype_2016/third_party/fluid/material/material.qrc b/prototype_2016/third_party/fluid/material/material.qrc
new file mode 100644
index 0000000..7ea8ecb
--- /dev/null
+++ b/prototype_2016/third_party/fluid/material/material.qrc
@@ -0,0 +1,10 @@
1<RCC>
2 <qresource prefix="/Fluid/Material">
3 <file>ActionButton.qml</file>
4 <file>ElevationEffect.qml</file>
5 <file>plugins.qmltypes</file>
6 <file>qmldir</file>
7 <file>Ripple.qml</file>
8 <file>Wave.qml</file>
9 </qresource>
10</RCC>
diff --git a/prototype_2016/third_party/fluid/material/plugins.qmltypes b/prototype_2016/third_party/fluid/material/plugins.qmltypes
new file mode 100644
index 0000000..238ccfe
--- /dev/null
+++ b/prototype_2016/third_party/fluid/material/plugins.qmltypes
@@ -0,0 +1,569 @@
1import QtQuick.tooling 1.2
2
3// This file describes the plugin-supplied types contained in the library.
4// It is used for QML tooling purposes only.
5//
6// This file was auto-generated by:
7// 'qmlplugindump-qt5 -nonrelocatable Fluid.Material 1.0'
8
9Module {
10 dependencies: [
11 "Fluid.Controls 1.0",
12 "Fluid.Core 1.0",
13 "Fluid.Effects 1.0",
14 "QtGraphicalEffects 1.0",
15 "QtQml 2.2",
16 "QtQuick 2.7",
17 "QtQuick.Controls 2.0",
18 "QtQuick.Controls.Material 2.0",
19 "QtQuick.Controls.Material.impl 2.0",
20 "QtQuick.Controls.Universal 2.0",
21 "QtQuick.Controls.Universal.impl 2.0",
22 "QtQuick.Controls.impl 2.0",
23 "QtQuick.Layouts 1.1",
24 "QtQuick.Templates 2.0",
25 "QtQuick.Window 2.2"
26 ]
27 Component {
28 prototype: "QQuickApplicationWindow"
29 name: "QtQuick.Controls/ApplicationWindow 2.0"
30 exports: ["QtQuick.Controls/ApplicationWindow 2.0"]
31 exportMetaObjectRevisions: [0]
32 isComposite: true
33 defaultProperty: "data"
34 }
35 Component {
36 prototype: "QQuickItem"
37 name: "QtQuick.Controls.Material.impl/BoxShadow 2.0"
38 exports: ["QtQuick.Controls.Material.impl/BoxShadow 2.0"]
39 exportMetaObjectRevisions: [0]
40 isComposite: true
41 defaultProperty: "data"
42 Property { name: "offsetX"; type: "int" }
43 Property { name: "offsetY"; type: "int" }
44 Property { name: "blurRadius"; type: "int" }
45 Property { name: "spreadRadius"; type: "int" }
46 Property { name: "source"; type: "QQuickItem"; isPointer: true }
47 Property { name: "fullWidth"; type: "bool" }
48 Property { name: "fullHeight"; type: "bool" }
49 Property { name: "glowRadius"; type: "double" }
50 Property { name: "spread"; type: "double" }
51 Property { name: "color"; type: "QColor" }
52 Property { name: "cornerRadius"; type: "double" }
53 Property { name: "cached"; type: "bool" }
54 }
55 Component {
56 prototype: "QQuickBusyIndicator"
57 name: "QtQuick.Controls/BusyIndicator 2.0"
58 exports: ["QtQuick.Controls/BusyIndicator 2.0"]
59 exportMetaObjectRevisions: [0]
60 isComposite: true
61 defaultProperty: "data"
62 }
63 Component {
64 prototype: "QQuickButton"
65 name: "QtQuick.Controls/Button 2.0"
66 exports: ["QtQuick.Controls/Button 2.0"]
67 exportMetaObjectRevisions: [0]
68 isComposite: true
69 defaultProperty: "data"
70 }
71 Component {
72 prototype: "QQuickCheckBox"
73 name: "QtQuick.Controls/CheckBox 2.0"
74 exports: ["QtQuick.Controls/CheckBox 2.0"]
75 exportMetaObjectRevisions: [0]
76 isComposite: true
77 defaultProperty: "data"
78 }
79 Component {
80 prototype: "QQuickCheckDelegate"
81 name: "QtQuick.Controls/CheckDelegate 2.0"
82 exports: ["QtQuick.Controls/CheckDelegate 2.0"]
83 exportMetaObjectRevisions: [0]
84 isComposite: true
85 defaultProperty: "data"
86 }
87 Component {
88 prototype: "QQuickRectangle"
89 name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0"
90 exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"]
91 exportMetaObjectRevisions: [0]
92 isComposite: true
93 defaultProperty: "data"
94 Property { name: "control"; type: "QQuickItem"; isPointer: true }
95 }
96 Component {
97 prototype: "QQuickRectangle"
98 name: "QtQuick.Controls.impl/CheckIndicator 2.0"
99 exports: ["QtQuick.Controls.impl/CheckIndicator 2.0"]
100 exportMetaObjectRevisions: [0]
101 isComposite: true
102 defaultProperty: "data"
103 Property { name: "control"; type: "QQuickItem"; isPointer: true }
104 }
105 Component {
106 prototype: "QQuickComboBox"
107 name: "QtQuick.Controls/ComboBox 2.0"
108 exports: ["QtQuick.Controls/ComboBox 2.0"]
109 exportMetaObjectRevisions: [0]
110 isComposite: true
111 defaultProperty: "data"
112 }
113 Component {
114 prototype: "QQuickDial"
115 name: "QtQuick.Controls/Dial 2.0"
116 exports: ["QtQuick.Controls/Dial 2.0"]
117 exportMetaObjectRevisions: [0]
118 isComposite: true
119 defaultProperty: "data"
120 }
121 Component {
122 prototype: "QQuickDrawer"
123 name: "QtQuick.Controls/Drawer 2.0"
124 exports: ["QtQuick.Controls/Drawer 2.0"]
125 exportMetaObjectRevisions: [0]
126 isComposite: true
127 defaultProperty: "contentData"
128 }
129 Component {
130 prototype: "QQuickItem"
131 name: "QtQuick.Controls.Material.impl/ElevationEffect 2.0"
132 exports: ["QtQuick.Controls.Material.impl/ElevationEffect 2.0"]
133 exportMetaObjectRevisions: [0]
134 isComposite: true
135 defaultProperty: "data"
136 Property { name: "source"; type: "QVariant" }
137 Property { name: "elevation"; type: "int" }
138 Property { name: "fullWidth"; type: "bool" }
139 Property { name: "fullHeight"; type: "bool" }
140 Property { name: "sourceItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
141 Property { name: "_shadows"; type: "QVariant"; isReadonly: true }
142 Property { name: "_shadow"; type: "QVariant"; isReadonly: true }
143 }
144 Component {
145 prototype: "QObject"
146 name: "FluidStyle 1.0"
147 exports: ["FluidStyle 1.0"]
148 exportMetaObjectRevisions: [0]
149 isComposite: true
150 isCreatable: false
151 isSingleton: true
152 Property { name: "iconColorLight"; type: "QColor"; isReadonly: true }
153 Property { name: "iconColorDark"; type: "QColor"; isReadonly: true }
154 Property { name: "display4Font"; type: "QFont"; isReadonly: true }
155 Property { name: "display3Font"; type: "QFont"; isReadonly: true }
156 Property { name: "display2Font"; type: "QFont"; isReadonly: true }
157 Property { name: "display1Font"; type: "QFont"; isReadonly: true }
158 Property { name: "headlineFont"; type: "QFont"; isReadonly: true }
159 Property { name: "titleFont"; type: "QFont"; isReadonly: true }
160 Property { name: "subheadingFont"; type: "QFont"; isReadonly: true }
161 Property { name: "body2Font"; type: "QFont"; isReadonly: true }
162 Property { name: "body1Font"; type: "QFont"; isReadonly: true }
163 Property { name: "captionFont"; type: "QFont"; isReadonly: true }
164 Property { name: "buttonFont"; type: "QFont"; isReadonly: true }
165 Property { name: "subheaderFont"; type: "QFont"; isReadonly: true }
166 Property { name: "dialogFont"; type: "QFont"; isReadonly: true }
167 }
168 Component {
169 prototype: "QQuickFrame"
170 name: "QtQuick.Controls/Frame 2.0"
171 exports: ["QtQuick.Controls/Frame 2.0"]
172 exportMetaObjectRevisions: [0]
173 isComposite: true
174 defaultProperty: "contentData"
175 }
176 Component {
177 prototype: "QQuickGroupBox"
178 name: "QtQuick.Controls/GroupBox 2.0"
179 exports: ["QtQuick.Controls/GroupBox 2.0"]
180 exportMetaObjectRevisions: [0]
181 isComposite: true
182 defaultProperty: "contentData"
183 }
184 Component {
185 prototype: "QQuickItemDelegate"
186 name: "QtQuick.Controls/ItemDelegate 2.0"
187 exports: ["QtQuick.Controls/ItemDelegate 2.0"]
188 exportMetaObjectRevisions: [0]
189 isComposite: true
190 defaultProperty: "data"
191 }
192 Component {
193 prototype: "QQuickLabel"
194 name: "QtQuick.Controls/Label 2.0"
195 exports: ["QtQuick.Controls/Label 2.0"]
196 exportMetaObjectRevisions: [0]
197 isComposite: true
198 defaultProperty: "data"
199 }
200 Component {
201 prototype: "QQuickMenu"
202 name: "QtQuick.Controls/Menu 2.0"
203 exports: ["QtQuick.Controls/Menu 2.0"]
204 exportMetaObjectRevisions: [0]
205 isComposite: true
206 defaultProperty: "contentData"
207 }
208 Component {
209 prototype: "QQuickMenuItem"
210 name: "QtQuick.Controls/MenuItem 2.0"
211 exports: ["QtQuick.Controls/MenuItem 2.0"]
212 exportMetaObjectRevisions: [0]
213 isComposite: true
214 defaultProperty: "data"
215 }
216 Component {
217 prototype: "QQuickPage"
218 name: "QtQuick.Controls/Page 2.0"
219 exports: ["QtQuick.Controls/Page 2.0"]
220 exportMetaObjectRevisions: [0]
221 isComposite: true
222 defaultProperty: "contentData"
223 }
224 Component {
225 prototype: "QQuickPageIndicator"
226 name: "QtQuick.Controls/PageIndicator 2.0"
227 exports: ["QtQuick.Controls/PageIndicator 2.0"]
228 exportMetaObjectRevisions: [0]
229 isComposite: true
230 defaultProperty: "data"
231 }
232 Component {
233 prototype: "QQuickPane"
234 name: "QtQuick.Controls/Pane 2.0"
235 exports: ["QtQuick.Controls/Pane 2.0"]
236 exportMetaObjectRevisions: [0]
237 isComposite: true
238 defaultProperty: "contentData"
239 }
240 Component {
241 prototype: "QQuickPopup"
242 name: "QtQuick.Controls/Popup 2.0"
243 exports: ["QtQuick.Controls/Popup 2.0"]
244 exportMetaObjectRevisions: [0]
245 isComposite: true
246 defaultProperty: "contentData"
247 }
248 Component {
249 prototype: "QQuickProgressBar"
250 name: "QtQuick.Controls/ProgressBar 2.0"
251 exports: ["QtQuick.Controls/ProgressBar 2.0"]
252 exportMetaObjectRevisions: [0]
253 isComposite: true
254 defaultProperty: "data"
255 }
256 Component {
257 prototype: "QQuickRadioButton"
258 name: "QtQuick.Controls/RadioButton 2.0"
259 exports: ["QtQuick.Controls/RadioButton 2.0"]
260 exportMetaObjectRevisions: [0]
261 isComposite: true
262 defaultProperty: "data"
263 }
264 Component {
265 prototype: "QQuickRadioDelegate"
266 name: "QtQuick.Controls/RadioDelegate 2.0"
267 exports: ["QtQuick.Controls/RadioDelegate 2.0"]
268 exportMetaObjectRevisions: [0]
269 isComposite: true
270 defaultProperty: "data"
271 }
272 Component {
273 prototype: "QQuickRectangle"
274 name: "QtQuick.Controls.impl/RadioIndicator 2.0"
275 exports: ["QtQuick.Controls.impl/RadioIndicator 2.0"]
276 exportMetaObjectRevisions: [0]
277 isComposite: true
278 defaultProperty: "data"
279 Property { name: "control"; type: "QQuickItem"; isPointer: true }
280 }
281 Component {
282 prototype: "QQuickRectangle"
283 name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0"
284 exports: ["QtQuick.Controls.Universal.impl/RadioIndicator 2.0"]
285 exportMetaObjectRevisions: [0]
286 isComposite: true
287 defaultProperty: "data"
288 Property { name: "control"; type: "QVariant" }
289 }
290 Component {
291 prototype: "QQuickRangeSlider"
292 name: "QtQuick.Controls/RangeSlider 2.0"
293 exports: ["QtQuick.Controls/RangeSlider 2.0"]
294 exportMetaObjectRevisions: [0]
295 isComposite: true
296 defaultProperty: "data"
297 }
298 Component {
299 prototype: "QQuickRectangle"
300 name: "QtQuick.Controls.Material.impl/Ripple 2.0"
301 exports: ["QtQuick.Controls.Material.impl/Ripple 2.0"]
302 exportMetaObjectRevisions: [0]
303 isComposite: true
304 defaultProperty: "data"
305 Property { name: "control"; type: "QQuickItem"; isPointer: true }
306 Property { name: "colored"; type: "bool" }
307 }
308 Component {
309 prototype: "QQuickScrollBar"
310 name: "QtQuick.Controls/ScrollBar 2.0"
311 exports: ["QtQuick.Controls/ScrollBar 2.0"]
312 exportMetaObjectRevisions: [0]
313 isComposite: true
314 defaultProperty: "data"
315 }
316 Component {
317 prototype: "QQuickScrollIndicator"
318 name: "QtQuick.Controls/ScrollIndicator 2.0"
319 exports: ["QtQuick.Controls/ScrollIndicator 2.0"]
320 exportMetaObjectRevisions: [0]
321 isComposite: true
322 defaultProperty: "data"
323 }
324 Component {
325 prototype: "QQuickSlider"
326 name: "QtQuick.Controls/Slider 2.0"
327 exports: ["QtQuick.Controls/Slider 2.0"]
328 exportMetaObjectRevisions: [0]
329 isComposite: true
330 defaultProperty: "data"
331 }
332 Component {
333 prototype: "QQuickItem"
334 name: "QtQuick.Controls.Material.impl/SliderHandle 2.0"
335 exports: ["QtQuick.Controls.Material.impl/SliderHandle 2.0"]
336 exportMetaObjectRevisions: [0]
337 isComposite: true
338 defaultProperty: "data"
339 Property { name: "value"; type: "double" }
340 Property { name: "handleHasFocus"; type: "bool" }
341 Property { name: "handlePressed"; type: "bool" }
342 Property { name: "initialSize"; type: "int"; isReadonly: true }
343 Property { name: "horizontal"; type: "bool"; isReadonly: true }
344 Property { name: "control"; type: "QVariant"; isReadonly: true }
345 }
346 Component {
347 prototype: "QQuickSpinBox"
348 name: "QtQuick.Controls/SpinBox 2.0"
349 exports: ["QtQuick.Controls/SpinBox 2.0"]
350 exportMetaObjectRevisions: [0]
351 isComposite: true
352 defaultProperty: "data"
353 }
354 Component {
355 prototype: "QQuickStackView"
356 name: "QtQuick.Controls/StackView 2.0"
357 exports: ["QtQuick.Controls/StackView 2.0"]
358 exportMetaObjectRevisions: [0]
359 isComposite: true
360 defaultProperty: "data"
361 }
362 Component {
363 prototype: "QQuickSwipeDelegate"
364 name: "QtQuick.Controls/SwipeDelegate 2.0"
365 exports: ["QtQuick.Controls/SwipeDelegate 2.0"]
366 exportMetaObjectRevisions: [0]
367 isComposite: true
368 defaultProperty: "data"
369 }
370 Component {
371 prototype: "QQuickSwipeView"
372 name: "QtQuick.Controls/SwipeView 2.0"
373 exports: ["QtQuick.Controls/SwipeView 2.0"]
374 exportMetaObjectRevisions: [0]
375 isComposite: true
376 defaultProperty: "contentData"
377 }
378 Component {
379 prototype: "QQuickSwitch"
380 name: "QtQuick.Controls/Switch 2.0"
381 exports: ["QtQuick.Controls/Switch 2.0"]
382 exportMetaObjectRevisions: [0]
383 isComposite: true
384 defaultProperty: "data"
385 }
386 Component {
387 prototype: "QQuickSwitchDelegate"
388 name: "QtQuick.Controls/SwitchDelegate 2.0"
389 exports: ["QtQuick.Controls/SwitchDelegate 2.0"]
390 exportMetaObjectRevisions: [0]
391 isComposite: true
392 defaultProperty: "data"
393 }
394 Component {
395 prototype: "QQuickRectangle"
396 name: "QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"
397 exports: ["QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"]
398 exportMetaObjectRevisions: [0]
399 isComposite: true
400 defaultProperty: "data"
401 Property { name: "control"; type: "QQuickItem"; isPointer: true }
402 }
403 Component {
404 prototype: "QQuickItem"
405 name: "QtQuick.Controls.impl/SwitchIndicator 2.0"
406 exports: ["QtQuick.Controls.impl/SwitchIndicator 2.0"]
407 exportMetaObjectRevisions: [0]
408 isComposite: true
409 defaultProperty: "data"
410 Property { name: "control"; type: "QQuickItem"; isPointer: true }
411 }
412 Component {
413 prototype: "QQuickItem"
414 name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0"
415 exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"]
416 exportMetaObjectRevisions: [0]
417 isComposite: true
418 defaultProperty: "data"
419 Property { name: "control"; type: "QQuickItem"; isPointer: true }
420 }
421 Component {
422 prototype: "QQuickTabBar"
423 name: "QtQuick.Controls/TabBar 2.0"
424 exports: ["QtQuick.Controls/TabBar 2.0"]
425 exportMetaObjectRevisions: [0]
426 isComposite: true
427 defaultProperty: "contentData"
428 }
429 Component {
430 prototype: "QQuickTabButton"
431 name: "QtQuick.Controls/TabButton 2.0"
432 exports: ["QtQuick.Controls/TabButton 2.0"]
433 exportMetaObjectRevisions: [0]
434 isComposite: true
435 defaultProperty: "data"
436 }
437 Component {
438 prototype: "QQuickTextArea"
439 name: "QtQuick.Controls/TextArea 2.0"
440 exports: ["QtQuick.Controls/TextArea 2.0"]
441 exportMetaObjectRevisions: [0]
442 isComposite: true
443 defaultProperty: "data"
444 }
445 Component {
446 prototype: "QQuickTextField"
447 name: "QtQuick.Controls/TextField 2.0"
448 exports: ["QtQuick.Controls/TextField 2.0"]
449 exportMetaObjectRevisions: [0]
450 isComposite: true
451 defaultProperty: "data"
452 }
453 Component {
454 prototype: "QQuickToolBar"
455 name: "QtQuick.Controls/ToolBar 2.0"
456 exports: ["QtQuick.Controls/ToolBar 2.0"]
457 exportMetaObjectRevisions: [0]
458 isComposite: true
459 defaultProperty: "contentData"
460 }
461 Component {
462 prototype: "QQuickToolButton"
463 name: "QtQuick.Controls/ToolButton 2.0"
464 exports: ["QtQuick.Controls/ToolButton 2.0"]
465 exportMetaObjectRevisions: [0]
466 isComposite: true
467 defaultProperty: "data"
468 }
469 Component {
470 prototype: "QQuickToolTip"
471 name: "QtQuick.Controls/ToolTip 2.0"
472 exports: ["QtQuick.Controls/ToolTip 2.0"]
473 exportMetaObjectRevisions: [0]
474 isComposite: true
475 defaultProperty: "contentData"
476 }
477 Component {
478 prototype: "QQuickTumbler"
479 name: "QtQuick.Controls/Tumbler 2.0"
480 exports: ["QtQuick.Controls/Tumbler 2.0"]
481 exportMetaObjectRevisions: [0]
482 isComposite: true
483 defaultProperty: "data"
484 }
485 Component {
486 prototype: "QQuickItem"
487 name: "Units 1.0"
488 exports: ["Units 1.0"]
489 exportMetaObjectRevisions: [0]
490 isComposite: true
491 isCreatable: false
492 isSingleton: true
493 defaultProperty: "data"
494 Property { name: "gridUnit"; type: "int"; isReadonly: true }
495 Property { name: "smallSpacing"; type: "double"; isReadonly: true }
496 Property { name: "mediumSpacing"; type: "double"; isReadonly: true }
497 Property { name: "largeSpacing"; type: "double"; isReadonly: true }
498 Property { name: "shortDuration"; type: "int"; isReadonly: true }
499 Property { name: "mediumDuration"; type: "int"; isReadonly: true }
500 Property { name: "longDuration"; type: "int"; isReadonly: true }
501 Property { name: "iconSizes"; type: "QObject"; isReadonly: true; isPointer: true }
502 Method {
503 name: "gu"
504 type: "QVariant"
505 Parameter { name: "x"; type: "QVariant" }
506 }
507 Method {
508 name: "roundToIconSize"
509 type: "QVariant"
510 Parameter { name: "x"; type: "QVariant" }
511 }
512 }
513 Component {
514 prototype: "QObject"
515 name: "Utils 1.0"
516 exports: ["Utils 1.0"]
517 exportMetaObjectRevisions: [0]
518 isComposite: true
519 isCreatable: false
520 isSingleton: true
521 Method {
522 name: "asColor"
523 type: "QVariant"
524 Parameter { name: "color"; type: "QVariant" }
525 }
526 Method {
527 name: "alpha"
528 type: "QVariant"
529 Parameter { name: "color"; type: "QVariant" }
530 Parameter { name: "alpha"; type: "QVariant" }
531 }
532 Method {
533 name: "blendColors"
534 type: "QVariant"
535 Parameter { name: "color1"; type: "QVariant" }
536 Parameter { name: "color2"; type: "QVariant" }
537 Parameter { name: "a"; type: "QVariant" }
538 }
539 Method {
540 name: "luminance"
541 type: "QVariant"
542 Parameter { name: "color"; type: "QVariant" }
543 }
544 Method {
545 name: "lightDark"
546 type: "QVariant"
547 Parameter { name: "background"; type: "QVariant" }
548 Parameter { name: "lightColor"; type: "QVariant" }
549 Parameter { name: "darkColor"; type: "QVariant" }
550 }
551 Method {
552 name: "isDarkColor"
553 type: "QVariant"
554 Parameter { name: "color"; type: "QVariant" }
555 }
556 Method {
557 name: "getSourceForIconName"
558 type: "QVariant"
559 Parameter { name: "name"; type: "QVariant" }
560 }
561 Method {
562 name: "scale"
563 type: "QVariant"
564 Parameter { name: "percent"; type: "QVariant" }
565 Parameter { name: "start"; type: "QVariant" }
566 Parameter { name: "end"; type: "QVariant" }
567 }
568 }
569}
diff --git a/prototype_2016/third_party/fluid/material/qmldir b/prototype_2016/third_party/fluid/material/qmldir
new file mode 100644
index 0000000..6aff2c1
--- /dev/null
+++ b/prototype_2016/third_party/fluid/material/qmldir
@@ -0,0 +1,7 @@
1module Fluid.Material
2typeinfo plugins.qmltypes
3
4ActionButton 1.0 ActionButton.qml
5ElevationEffect 1.0 ElevationEffect.qml
6Ripple 1.0 Ripple.qml
7Wave 1.0 Wave.qml
diff --git a/prototype_2016/third_party/fluid/scripts/fetch_icons.sh b/prototype_2016/third_party/fluid/scripts/fetch_icons.sh
new file mode 100755
index 0000000..9c452db
--- /dev/null
+++ b/prototype_2016/third_party/fluid/scripts/fetch_icons.sh
@@ -0,0 +1,39 @@
1#! /bin/bash
2
3GIT_DIR=material-design-icons
4TARGET_DIR=icons
5QRC_FILE=$TARGET_DIR/icons.qrc
6
7CATEGORIES=(action av communication device file image maps notification social toggle alert content editor hardware navigation)
8
9if [ -d $GIT_DIR ]; then
10 pushd $GIT_DIR; git pull; popd
11else
12 git clone https://github.com/google/material-design-icons.git $GIT_DIR
13fi
14
15mkdir -p $TARGET_DIR
16
17echo "<RCC>
18 <qresource prefix=\"/Fluid/Controls/\">" > $QRC_FILE
19for CATEGORY in ${CATEGORIES[*]}; do
20 if [ -d $TARGET_DIR/$CATEGORY ]; then
21 rm -r $TARGET_DIR/$CATEGORY
22 fi
23
24 mkdir $TARGET_DIR/$CATEGORY
25
26 ICONS=$(ls $GIT_DIR/$CATEGORY/svg/production/*48px*)
27
28
29 for FILE in $ICONS; do
30 ICON=$(basename $FILE)
31 NEW_NAME=$(echo $ICON | sed -E 's/ic_(.*)_48px.svg/\1.svg/')
32 cp $FILE $TARGET_DIR/$CATEGORY/$NEW_NAME
33 echo " <file>$CATEGORY/$NEW_NAME</file>" >> $QRC_FILE
34 done
35done
36
37echo " </qresource>
38</RCC>
39" >> $QRC_FILE \ No newline at end of file
diff --git a/prototype_2016/third_party/fluid/src/CMakeLists.txt b/prototype_2016/third_party/fluid/src/CMakeLists.txt
new file mode 100644
index 0000000..dacd2e0
--- /dev/null
+++ b/prototype_2016/third_party/fluid/src/CMakeLists.txt
@@ -0,0 +1,79 @@
1include(GenerateExportHeader)
2include(CMakePackageConfigHelpers)
3include(ECMSetupVersion)
4include(ECMGenerateHeaders)
5
6ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX FLUID
7 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/Fluid/fluid/fluidversion.h"
8 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/FluidConfigVersion.cmake"
9 SOVERSION ${PROJECT_SOVERSION})
10
11set(FLUID_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/Fluid")
12
13set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Fluid")
14
15configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/FluidConfig.cmake.in"
16 "${CMAKE_CURRENT_BINARY_DIR}/FluidConfig.cmake"
17 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
18
19install(FILES "${CMAKE_CURRENT_BINARY_DIR}/FluidConfig.cmake"
20 "${CMAKE_CURRENT_BINARY_DIR}/FluidConfigVersion.cmake"
21 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
22 COMPONENT Devel)
23install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Fluid/fluid/fluidversion.h
24 DESTINATION ${FLUID_INCLUDEDIR}/fluid COMPONENT Devel)
25
26###################################
27
28add_definitions(-DQT_NO_KEYWORDS)
29
30set(SOURCES
31 dateutils.cpp
32)
33
34add_library(Fluid SHARED ${SOURCES})
35
36target_link_libraries(Fluid
37 PUBLIC
38 Qt5::Core
39)
40
41##################################################
42
43generate_export_header(Fluid EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/Fluid/fluid/fluid_export.h)
44
45target_include_directories(Fluid INTERFACE "$<INSTALL_INTERFACE:${FLUID_INCLUDEDIR}>")
46
47set_target_properties(Fluid PROPERTIES
48 VERSION ${PROJECT_VERSION}
49 SOVERSION ${PROJECT_SOVERSION})
50
51ecm_generate_headers(Fluid_CamelCase_HEADERS
52 HEADER_NAMES
53 DateUtils
54 REQUIRED_HEADERS
55 Fluid_HEADERS
56 PREFIX
57 Fluid
58 OUTPUT_DIR
59 ${CMAKE_CURRENT_BINARY_DIR}/Fluid
60)
61install(FILES ${Fluid_CamelCase_HEADERS}
62 DESTINATION ${FLUID_INCLUDEDIR}/Fluid
63 COMPONENT Devel)
64
65install(TARGETS Fluid EXPORT FluidTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
66
67install(
68 FILES
69 ${CMAKE_CURRENT_BINARY_DIR}/Fluid/fluid/fluid_export.h
70 dateutils.h
71 DESTINATION
72 ${FLUID_INCLUDEDIR}/fluid
73 COMPONENT
74 Devel
75)
76
77install(EXPORT FluidTargets
78 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
79 FILE FluidTargets.cmake NAMESPACE Fluid::)
diff --git a/prototype_2016/third_party/fluid/src/FluidConfig.cmake.in b/prototype_2016/third_party/fluid/src/FluidConfig.cmake.in
new file mode 100644
index 0000000..8cbfe85
--- /dev/null
+++ b/prototype_2016/third_party/fluid/src/FluidConfig.cmake.in
@@ -0,0 +1,11 @@
1@PACKAGE_INIT@
2
3find_dependency(Qt5Core @REQUIRED_QT_VERSION@)
4find_dependency(Qt5Gui @REQUIRED_QT_VERSION@)
5find_dependency(Qt5Qml @REQUIRED_QT_VERSION@)
6find_dependency(Qt5Quick @REQUIRED_QT_VERSION@)
7find_dependency(Qt5QuickControls2 @REQUIRED_QT_VERSION@)
8
9set(FLUID_CMAKE_MODULES_DIR "${CMAKE_CURRENT_LIST_DIR}")
10
11include("${FLUID_CMAKE_MODULES_DIR}/FluidTargets.cmake")
diff --git a/prototype_2016/third_party/fluid/src/dateutils.cpp b/prototype_2016/third_party/fluid/src/dateutils.cpp
new file mode 100644
index 0000000..62e6903
--- /dev/null
+++ b/prototype_2016/third_party/fluid/src/dateutils.cpp
@@ -0,0 +1,82 @@
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
16#include "dateutils.h"
17
18using namespace Fluid;
19
20QString DateUtils::formatDuration(qlonglong duration, DurationFormat format, DurationType type)
21{
22 int hours = duration / (1000 * 60 * 60);
23 int minutes = duration / (1000 * 60) - 60 * hours;
24 int seconds = duration / 1000 - 60 * minutes - 60 * 60 * hours;
25
26 QString string;
27
28 if (type == Any || type == Seconds) {
29 if (format == Short)
30 string = QStringLiteral("%1").arg(seconds, 2, 10, QChar('0'));
31 else
32 string = QStringLiteral("%1s").arg(seconds);
33 }
34
35 if (type == Seconds || type == Minutes || (type == Any && (minutes >= 1 || hours >= 1))) {
36 if (format == Short) {
37 if (string.length() > 0)
38 string = QStringLiteral("%1:%2").arg(minutes, 2, 10, QChar('0')).arg(string);
39 else
40 string = QStringLiteral("%1").arg(minutes, 2, 10, QChar('0'));
41 } else {
42 string = QStringLiteral("%1m %2").arg(minutes).arg(string);
43 }
44 }
45
46 if (type == Seconds || type == Minutes || type == Hours || (type == Any && (hours >= 1))) {
47 if (format == Short) {
48 if (string.length() > 0)
49 string = QStringLiteral("%1:%2").arg(hours).arg(string);
50 else
51 string = QStringLiteral("%1").arg(hours);
52 } else {
53 string = QStringLiteral("%1h %2").arg(hours).arg(string);
54 }
55 }
56
57 return string.trimmed();
58}
59
60QString DateUtils::friendlyTime(const QDateTime &time, bool standalone)
61{
62 QDateTime now = QDateTime::currentDateTime();
63 qint64 minutes = qRound64(time.secsTo(now) / 60.0f);
64 if (minutes < 1)
65 return standalone ? tr("Now") : "now";
66 else if (minutes == 1)
67 return tr("1 minute ago");
68 else if (minutes < 60)
69 return tr("%1 minutes ago").arg(minutes);
70 qint64 hours = qRound64(minutes / 60.0f);
71 if (hours == 1)
72 return tr("1 hour ago");
73 else if (hours < 24)
74 return tr("%1 hours ago").arg(hours);
75 qint64 days = qRound64(hours / 24.0f);
76 if (days == 1)
77 return tr("1 day ago");
78 else if (days <= 10)
79 return tr("%1 days ago").arg(days);
80 QString string = time.toString();
81 return standalone ? string : tr("on %1").arg(string);
82}
diff --git a/prototype_2016/third_party/fluid/src/dateutils.h b/prototype_2016/third_party/fluid/src/dateutils.h
new file mode 100644
index 0000000..e49cbac
--- /dev/null
+++ b/prototype_2016/third_party/fluid/src/dateutils.h
@@ -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 * 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
16#pragma once
17
18#ifdef FLUID_LOCAL
19 #define FLUID_EXPORT
20#else
21 #include <Fluid/fluid/fluid_export.h>
22#endif
23#include <QtCore/QObject>
24#include <QtCore/QDateTime>
25
26namespace Fluid {
27
28class FLUID_EXPORT DateUtils : public QObject
29{
30 Q_OBJECT
31
32public:
33 enum DurationFormat { Long, Short };
34 Q_ENUM(DurationFormat)
35
36 enum DurationType { Seconds, Minutes, Hours, Any };
37 Q_ENUM(DurationType)
38
39 static QString formatDuration(qlonglong duration, DurationFormat format = Short,
40 DurationType type = Any);
41 static QString friendlyTime(const QDateTime &time, bool standalone);
42};
43
44} // namespace Fluid
diff --git a/prototype_2016/third_party/fluid/src/src.pri b/prototype_2016/third_party/fluid/src/src.pri
new file mode 100644
index 0000000..6b73833
--- /dev/null
+++ b/prototype_2016/third_party/fluid/src/src.pri
@@ -0,0 +1,5 @@
1HEADERS += \
2 $$PWD/dateutils.h
3
4SOURCES += \
5 $$PWD/dateutils.cpp
diff --git a/prototype_2016/third_party/fluid/tests/CMakeLists.txt b/prototype_2016/third_party/fluid/tests/CMakeLists.txt
new file mode 100644
index 0000000..0653827
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/CMakeLists.txt
@@ -0,0 +1 @@
add_subdirectory(auto)
diff --git a/prototype_2016/third_party/fluid/tests/auto/CMakeLists.txt b/prototype_2016/third_party/fluid/tests/auto/CMakeLists.txt
new file mode 100644
index 0000000..27e47a2
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/CMakeLists.txt
@@ -0,0 +1,7 @@
1if(NOT USE_SUPERBUILD)
2 add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -VV)
3endif()
4
5add_subdirectory(controls)
6add_subdirectory(core)
7add_subdirectory(material)
diff --git a/prototype_2016/third_party/fluid/tests/auto/controls/CMakeLists.txt b/prototype_2016/third_party/fluid/tests/auto/controls/CMakeLists.txt
new file mode 100644
index 0000000..ee473f8
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/controls/CMakeLists.txt
@@ -0,0 +1,10 @@
1set(SOURCES controls.cpp)
2
3set(CMAKE_MACOSX_BUNDLE FALSE)
4
5add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
6
7add_executable(tst_controls ${SOURCES})
8target_link_libraries(tst_controls Qt5::Qml Qt5::Test Qt5::QuickTest)
9add_test(tst_controls tst_controls)
10add_dependencies(check tst_controls)
diff --git a/prototype_2016/third_party/fluid/tests/auto/controls/controls.cpp b/prototype_2016/third_party/fluid/tests/auto/controls/controls.cpp
new file mode 100644
index 0000000..1d14afc
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/controls/controls.cpp
@@ -0,0 +1,16 @@
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
15#include <QtQuickTest/QtQuickTest>
16QUICK_TEST_MAIN(tst_controls)
diff --git a/prototype_2016/third_party/fluid/tests/auto/controls/tst_icon.qml b/prototype_2016/third_party/fluid/tests/auto/controls/tst_icon.qml
new file mode 100644
index 0000000..6d3fc26
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/controls/tst_icon.qml
@@ -0,0 +1,83 @@
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 2.4
16import QtTest 1.0
17import Fluid.Controls 1.0
18import QtQuick.Controls.Material 2.0
19
20Icon {
21 id: icon
22
23 TestCase {
24 name: "IconTests"
25 when: windowShown
26
27 function test_source_should_use_desktop_provider_for_freedesktop_icon() {
28 icon.name = 'edit-cut-symbolic'
29
30 compare(icon.source, 'image://fluidicontheme/edit-cut-symbolic')
31 }
32
33 function test_source_should_use_icon_prefix_for_material_icon() {
34 icon.name = 'action/settings'
35
36 compare(icon.source, 'image://fluidicons/action/settings')
37 }
38
39 function test_source_should_use_file_url_for_file_name() {
40 icon.name = '/path/to/icon.png'
41
42 compare(icon.source, 'file:///path/to/icon.png')
43 }
44
45 function test_source_should_use_file_url_for_file_url() {
46 icon.name = 'file:///path/to/icon.png'
47
48 compare(icon.source, 'file:///path/to/icon.png')
49 }
50
51 function test_colorize_should_be_true_for_material_icon() {
52 icon.name = 'action/settings'
53
54 compare(icon.colorize, true)
55 }
56
57 function test_colorize_should_be_true_for_symbolic_icon() {
58 icon.name = 'edit-cut-symbolic'
59
60 compare(icon.colorize, true)
61 }
62
63 function test_colorize_should_be_false_for_regular_icon() {
64 icon.name = 'gimp'
65
66 compare(icon.colorize, false)
67 }
68
69 function test_color_should_be_light_icon_color_for_light_theme() {
70 icon.Material.theme = Material.Light
71
72 // Colors must be converted to strings for compare to work
73 compare(String(icon.color), String(FluidStyle.iconColorLight))
74 }
75
76 function test_color_should_be_dark_icon_color_for_dark_theme() {
77 icon.Material.theme = Material.Dark
78
79 // Colors must be converted to strings for compare to work
80 compare(String(icon.color), String(FluidStyle.iconColorDark))
81 }
82 }
83}
diff --git a/prototype_2016/third_party/fluid/tests/auto/controls/tst_listitem.qml b/prototype_2016/third_party/fluid/tests/auto/controls/tst_listitem.qml
new file mode 100644
index 0000000..1f10ee1
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/controls/tst_listitem.qml
@@ -0,0 +1,123 @@
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 2.4
16import QtQuick.Controls 2.0
17import QtTest 1.0
18import Fluid.Controls 1.0
19
20Item {
21 width: 400
22 height: 400
23
24 Column {
25 anchors.fill: parent
26
27 ListItem {
28 id: listItem
29
30 width: 200
31
32 SignalSpy {
33 id: clickedSpy
34 target: listItem
35 signalName: "clicked"
36 }
37 }
38
39 ListItem {
40 id: listItemWithSubtext1
41
42 maximumLineCount: 2
43 subText: "Random Text"
44 }
45
46 ListItem {
47 id: listItemWithSubtext2
48
49 maximumLineCount: 3
50 subText: "Random Text"
51 }
52
53 ListItem {
54 id: listItemWithSecondaryItem
55
56 secondaryItem: Button {}
57 }
58
59 ListItem {
60 id: listItemWithoutSecondaryItem
61 }
62
63 ListItem {
64 id: listItemWithLeftItem
65
66 iconName: "action/settings"
67 }
68
69 ListItem {
70 id: listItemWithRightItem
71
72 text: "Random Text"
73 rightItem: ComboBox {
74 anchors.centerIn: parent
75 textRole: "text"
76 model: ListModel {
77 ListElement { text: "One"; value: 1 }
78 ListElement { text: "Two"; value: 2 }
79 }
80 }
81 }
82 }
83
84 TestCase {
85 name: "ListItemTests"
86 when: windowShown
87
88 function test_leftItem_shows_when_iconName_is_set() {
89 var leftItem = findChild(listItem, "leftItem")
90
91 compare(leftItem.showing, false)
92
93 listItem.iconName = "action/settings"
94
95 compare(leftItem.showing, true)
96 }
97
98 function test_click_isnt_eaten_by_ripple() {
99 clickedSpy.clear()
100
101 mouseClick(listItem)
102
103 compare(clickedSpy.count, 1)
104 }
105
106 function test_implicit_height() {
107 compare(listItemWithSubtext1.implicitHeight, 72)
108
109 compare(listItemWithSubtext2.implicitHeight, 88)
110
111 var secondaryItem = findChild(listItemWithSecondaryItem, "secondaryItem")
112 compare(listItemWithSecondaryItem.implicitHeight, secondaryItem.childrenRect.height + Units.smallSpacing * 2)
113
114 compare(listItemWithoutSecondaryItem.implicitHeight, 48)
115
116 var leftItem = findChild(listItemWithLeftItem, "leftItem")
117 compare(listItemWithLeftItem.implicitHeight, 48)
118
119 var rightItem = findChild(listItemWithRightItem, "rightItem")
120 compare(listItemWithRightItem.implicitHeight, rightItem.childrenRect.height + Units.smallSpacing * 2)
121 }
122 }
123}
diff --git a/prototype_2016/third_party/fluid/tests/auto/core/CMakeLists.txt b/prototype_2016/third_party/fluid/tests/auto/core/CMakeLists.txt
new file mode 100644
index 0000000..dbe79a9
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/core/CMakeLists.txt
@@ -0,0 +1,10 @@
1set(SOURCES core.cpp)
2
3set(CMAKE_MACOSX_BUNDLE FALSE)
4
5add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
6
7add_executable(tst_core ${SOURCES})
8target_link_libraries(tst_core Qt5::Qml Qt5::Test Qt5::QuickTest)
9add_test(tst_core tst_core)
10add_dependencies(check tst_core)
diff --git a/prototype_2016/third_party/fluid/tests/auto/core/core.cpp b/prototype_2016/third_party/fluid/tests/auto/core/core.cpp
new file mode 100644
index 0000000..7983d3e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/core/core.cpp
@@ -0,0 +1,16 @@
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
15#include <QtQuickTest/QtQuickTest>
16QUICK_TEST_MAIN(tst_core)
diff --git a/prototype_2016/third_party/fluid/tests/auto/core/tst_clipboard.qml b/prototype_2016/third_party/fluid/tests/auto/core/tst_clipboard.qml
new file mode 100644
index 0000000..9c99cd6
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/core/tst_clipboard.qml
@@ -0,0 +1,59 @@
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 2.4
16import QtTest 1.0
17import Fluid.Core 1.0
18
19TestCase {
20 name: "ClipboardTests"
21
22 Clipboard {
23 id: clipboard
24 }
25
26 SignalSpy {
27 id: textChangedSpy
28 target: clipboard
29 signalName: "textChanged"
30 }
31
32 function test_clipboard_works() {
33 var text = "Hello World"
34
35 clipboard.text = text
36
37 compare(clipboard.text, text)
38 }
39
40 function tests_setting_text_should_fire_textChanged() {
41 clipboard.text = ""
42
43 textChangedSpy.clear()
44
45 clipboard.text = "Random Text"
46
47 compare(textChangedSpy.count, 1)
48 }
49
50 function test_clear_should_fire_textChanged() {
51 clipboard.text = "Non empty text"
52
53 textChangedSpy.clear()
54
55 clipboard.clear()
56
57 compare(textChangedSpy.count, 1)
58 }
59}
diff --git a/prototype_2016/third_party/fluid/tests/auto/core/tst_utils.qml b/prototype_2016/third_party/fluid/tests/auto/core/tst_utils.qml
new file mode 100644
index 0000000..9d977a9
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/core/tst_utils.qml
@@ -0,0 +1,38 @@
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.4
17import QtTest 1.0
18import Fluid.Core 1.0
19
20TestCase {
21 name: "UtilsTests"
22
23 function test_blendColors() {
24 compare(Utils.blendColors("lightsteelblue", "#10FF0000", 0.5), "#80b5b8d0")
25 }
26
27 function test_luminance() {
28 compare(Utils.luminance("lightsteelblue"), 0.7593254230563821)
29 }
30
31 function test_isDarkColor_should_return_true_for_dark_color() {
32 compare(Utils.isDarkColor("#455A64"), true)
33 }
34
35 function test_isDarkColor_should_return_false_for_light_color() {
36 compare(Utils.isDarkColor("#B0BEC5"), false)
37 }
38}
diff --git a/prototype_2016/third_party/fluid/tests/auto/material/CMakeLists.txt b/prototype_2016/third_party/fluid/tests/auto/material/CMakeLists.txt
new file mode 100644
index 0000000..78db8aa
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/material/CMakeLists.txt
@@ -0,0 +1,12 @@
1set(SOURCES material.cpp)
2
3set(CMAKE_MACOSX_BUNDLE FALSE)
4
5add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
6
7qt5_add_resources(RESOURCES material.qrc)
8
9add_executable(tst_material ${SOURCES} ${RESOURCES})
10target_link_libraries(tst_material Qt5::Qml Qt5::QuickControls2 Qt5::Test Qt5::QuickTest)
11add_test(tst_material tst_material)
12add_dependencies(check tst_material)
diff --git a/prototype_2016/third_party/fluid/tests/auto/material/material.cpp b/prototype_2016/third_party/fluid/tests/auto/material/material.cpp
new file mode 100644
index 0000000..0d0bd81
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/material/material.cpp
@@ -0,0 +1,16 @@
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
15#include <QtQuickTest/QtQuickTest>
16QUICK_TEST_MAIN(tst_material)
diff --git a/prototype_2016/third_party/fluid/tests/auto/material/material.qrc b/prototype_2016/third_party/fluid/tests/auto/material/material.qrc
new file mode 100644
index 0000000..e313f5e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/material/material.qrc
@@ -0,0 +1,5 @@
1<!DOCTYPE RCC><RCC version="1.0">
2<qresource prefix="/">
3 <file>qtquickcontrols2.conf</file>
4</qresource>
5</RCC>
diff --git a/prototype_2016/third_party/fluid/tests/auto/material/qtquickcontrols2.conf b/prototype_2016/third_party/fluid/tests/auto/material/qtquickcontrols2.conf
new file mode 100644
index 0000000..b6c7c87
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/material/qtquickcontrols2.conf
@@ -0,0 +1,2 @@
1[Controls]
2Style=Material
diff --git a/prototype_2016/third_party/fluid/tests/auto/material/tst_ripple.qml b/prototype_2016/third_party/fluid/tests/auto/material/tst_ripple.qml
new file mode 100644
index 0000000..b79b18e
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/material/tst_ripple.qml
@@ -0,0 +1,88 @@
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 2.4
16import QtTest 1.0
17import Fluid.Material 1.0
18
19Ripple {
20 id: ripple
21
22 width: 100
23 height: 100
24
25 TestCase {
26 name: "RippleTests"
27 when: windowShown
28
29 function test_mouse_press_shows_ripple() {
30 compare(getRipples().length, 0)
31 mousePress(ripple)
32 compare(getRipples().length, 1)
33 mouseRelease(ripple)
34 wait(1000)
35 }
36
37 function test_mouse_up_hides_ripple() {
38 mouseClick(ripple)
39 compare(getRipples().length, 1)
40 wait(1000)
41 compare(getRipples().length, 0)
42 }
43
44 function test_focused_ripple_shows_focus_background() {
45 var focusBackground = findChild(ripple, "focusBackground")
46 compare(focusBackground.opacity, 0)
47
48 ripple.focused = true
49 wait(1000)
50
51 compare(focusBackground.opacity, 1)
52
53 ripple.focused = false
54 wait(1000)
55 }
56
57 function test_focused_ripple_shows_focus_ripple() {
58 var focusRipple = findChild(ripple, "focusRipple")
59 compare(focusRipple.opacity, 0)
60
61 ripple.focused = true
62 wait(1000)
63
64 compare(focusRipple.opacity, 1)
65
66 ripple.focused = false
67 wait(1000)
68 }
69
70 function getRipples() {
71 return filteredChildren("tapRipple")
72 }
73
74 function filteredChildren(objectName) {
75 var filtered = []
76
77 for (var i = 0; i < ripple.children.length; i++) {
78 var child = ripple.children[i]
79
80 if (child.objectName == objectName) {
81 filtered.push(child)
82 }
83 }
84
85 return filtered
86 }
87 }
88}
diff --git a/prototype_2016/third_party/fluid/tests/auto/material/tst_typography.qml b/prototype_2016/third_party/fluid/tests/auto/material/tst_typography.qml
new file mode 100644
index 0000000..3a328fb
--- /dev/null
+++ b/prototype_2016/third_party/fluid/tests/auto/material/tst_typography.qml
@@ -0,0 +1,166 @@
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.4
16import QtTest 1.0
17import Fluid.Core 1.0
18import Fluid.Controls 1.0
19import QtQuick.Controls 2.0
20
21TestCase {
22 id: testCase
23 name: "TypographyTests"
24 width: 200
25 height: 200
26 visible: true
27 when: windowShown
28
29 Component {
30 id: displayLabelComponent
31 DisplayLabel {}
32 }
33
34 Component {
35 id: bodyLabelComponent
36 BodyLabel {}
37 }
38
39 Component {
40 id: captionLabelComponent
41 CaptionLabel {}
42 }
43
44 Component {
45 id: headlineLabelComponent
46 HeadlineLabel {}
47 }
48
49 Component {
50 id: subheadingLabelComponent
51 SubheadingLabel {}
52 }
53
54 Component {
55 id: titleLabelComponent
56 TitleLabel {}
57 }
58
59 function test_display_label() {
60 var displayLabel = displayLabelComponent.createObject(testCase)
61 verify(displayLabel)
62
63 // FIXME: We can't apparently access +material from tests,
64 // hence these test will fail
65 return
66
67 displayLabel.level = 1
68 compare(displayLabel.font.pixelSize, 34)
69 compare(displayLabel.font.weight, Font.Normal)
70 displayLabel.level = 2
71 compare(displayLabel.font.pixelSize, 45)
72 compare(displayLabel.font.weight, Font.Normal)
73 displayLabel.level = 3
74 compare(displayLabel.font.pixelSize, 56)
75 compare(displayLabel.font.weight, Font.Normal)
76 displayLabel.level = 4
77 compare(displayLabel.font.pixelSize, 112)
78 compare(displayLabel.font.weight, Font.Light)
79 }
80
81 function test_body_label() {
82 var bodyLabel = bodyLabelComponent.createObject(testCase)
83 verify(bodyLabel)
84
85 // FIXME: We can't apparently access +material from tests,
86 // hence these test will fail
87 return
88
89 bodyLabel.level = 1
90 if (Device.isMobile)
91 compare(bodyLabel.font.pixelSize, 14)
92 else
93 compare(bodyLabel.font.pixelSize, 13)
94 compare(bodyLabel.lineHeight, 20.0)
95 compare(bodyLabel.lineHeightMode, Text.FixedHeight)
96
97 bodyLabel.level = 2
98 if (Device.isMobile)
99 compare(bodyLabel.font.pixelSize, 14)
100 else
101 compare(bodyLabel.font.pixelSize, 13)
102 compare(bodyLabel.lineHeight, 24.0)
103 compare(bodyLabel.lineHeightMode, Text.FixedHeight)
104 }
105
106 function test_caption_label() {
107 var captionLabel = captionLabelComponent.createObject(testCase)
108 verify(captionLabel)
109
110 // FIXME: We can't apparently access +material from tests,
111 // hence these test will fail
112 return
113
114 compare(captionLabel.font.pixelSize, 12)
115 }
116
117 function test_headline_label() {
118 var headlineLabel = headlineLabelComponent.createObject(testCase)
119 verify(headlineLabel)
120
121 // FIXME: We can't apparently access +material from tests,
122 // hence these test will fail
123 return
124
125 compare(headlineLabel.font.pixelSize, 24)
126 compare(headlineLabel.lineHeight, 32.0)
127 compare(headlineLabel.lineHeightMode, Text.FixedHeight)
128 }
129
130 function test_subheading_label() {
131 var subheadingLabel = subheadingLabelComponent.createObject(testCase)
132 verify(subheadingLabel)
133
134 // FIXME: We can't apparently access +material from tests,
135 // hence these test will fail
136 return
137
138 subheadingLabel.level = 1
139 if (Device.isMobile)
140 compare(subheadingLabel.font.pixelSize, 16)
141 else
142 compare(subheadingLabel.font.pixelSize, 15)
143 compare(subheadingLabel.lineHeight, 24.0)
144 compare(subheadingLabel.lineHeightMode, Text.FixedHeight)
145
146 subheadingLabel.level = 2
147 if (Device.isMobile)
148 compare(subheadingLabel.font.pixelSize, 16)
149 else
150 compare(subheadingLabel.font.pixelSize, 15)
151 compare(subheadingLabel.lineHeight, 28.0)
152 compare(subheadingLabel.lineHeightMode, Text.FixedHeight)
153 }
154
155 function test_title_label() {
156 var titleLabel = titleLabelComponent.createObject(testCase)
157 verify(titleLabel)
158
159 // FIXME: We can't apparently access +material from tests,
160 // hence these test will fail
161 return
162
163 compare(titleLabel.font.pixelSize, 20)
164 compare(titleLabel.font.weight, Font.Medium)
165 }
166}
diff --git a/prototype_2016/third_party/qml-material/.builder.yml b/prototype_2016/third_party/qml-material/.builder.yml
deleted file mode 100644
index ad8a1cc..0000000
--- a/prototype_2016/third_party/qml-material/.builder.yml
+++ /dev/null
@@ -1,12 +0,0 @@
1dependencies:
2 - qt5-base
3 - qt5-declarative
4 - qt5-quickcontrols
5 - qt5-svg
6 - qt5-graphicaleffects
7 - cmake
8 - extra-cmake-modules
9build:
10 - cmake {srcdir}
11 - make
12 - make test
diff --git a/prototype_2016/third_party/qml-material/.gitignore b/prototype_2016/third_party/qml-material/.gitignore
deleted file mode 100644
index d3027d1..0000000
--- a/prototype_2016/third_party/qml-material/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
1.qmake.stash
2Makefile
3tests/tst_material
4*.o
5*.pro.user*
6build
7*.qmlproject.user*
8*~
9
10deploy_key
11deploy_key.pub
12documentation/ditaxml
13.DS_Store
diff --git a/prototype_2016/third_party/qml-material/.travis.yml b/prototype_2016/third_party/qml-material/.travis.yml
deleted file mode 100644
index 934302a..0000000
--- a/prototype_2016/third_party/qml-material/.travis.yml
+++ /dev/null
@@ -1,27 +0,0 @@
1sudo: required
2dist: trusty
3language: generic
4
5install:
6 - sudo add-apt-repository -y ppa:beineri/opt-qt551-trusty
7 - sudo add-apt-repository -y ppa:beineri/opt-qt561-trusty
8 - sudo apt-get update
9 - sudo apt-get -y install pep8 pyflakes python python-pip npm nodejs nodejs-legacy
10 - sudo apt-get -y install qt55declarative qt55quickcontrols qt55graphicaleffects qt55tools qt55svg
11 - sudo apt-get -y install qt56declarative qt56quickcontrols qt56graphicaleffects qt56tools qt56svg
12 - sudo apt-get -y install xvfb
13 - sudo npm install -g jshint
14
15script:
16 - source /opt/qt55/bin/qt55-env.sh
17 - qmake . && make && sudo make install
18 - xvfb-run -a -s "-screen 0 800x600x24" make check
19 - sudo git clean -xfd
20 - source /opt/qt56/bin/qt56-env.sh
21 - qmake . && make && sudo make install
22 - xvfb-run -a -s "-screen 0 800x600x24" make check
23 - sudo git clean -xfd
24 - ./scripts/lint.sh
25
26notifications:
27 slack: papyros:Z7PeY2Y4mh0GWPoypZZNLd3D
diff --git a/prototype_2016/third_party/qml-material/CHANGELOG.md b/prototype_2016/third_party/qml-material/CHANGELOG.md
deleted file mode 100644
index 4d82f88..0000000
--- a/prototype_2016/third_party/qml-material/CHANGELOG.md
+++ /dev/null
@@ -1,200 +0,0 @@
1QML Material CHANGELOG
2======================
3
4### Version 0.2.0 (January 16, 2016)
5
6**Features**
7 * General:
8 * Add a showError() function for easily displaying errors
9 * Import the Material.Extras module from a separate git repository
10 * Add details about Material.Extras
11 * Use Settings from QtQuick.Controls for mobile characteristics
12 * Support using simple names for theme colors
13 * Action: Have Action extend QtQuick's Action object
14 * ActionButton: Follow Action iconName & visible
15 * CircleImage: Expose the fillMode property
16 * DatePicker: Initial add of the Material DatePicker
17 * Platform extensions:
18 * Implement platform extensions for Papyros
19 * Material Design window decorations for Papyros
20 * Demo:
21 * Use the new-style simple color names for the theme
22 * Replace account_child with account_circle in the form demo
23 * Modify snackbar demo to show wide and multi-line examples
24 * Set the window title of the demo app
25 * Use async loader for demo components for better performance
26 * Use Flow instead of Grid with variable columns for the icon demo
27 * Add date picker to demo
28 * Change between list and icon view on the icon demo
29 * Update dialog demo to show better examples
30 * Add example customized slider to demo
31 * Dialog:
32 * Allow hiding the primary button
33 * Update dialog to latest MD spec
34 * Icons:
35 * Add all the new and updated Material icons
36 * Add new and updated Material icons
37 * Update the FontAwesome icons to 4.5.0
38 * Update the Material Design icons
39 * ListItem: Expose the list item labels to allow customization
40 * MenuField: Simple implementation of a textRole
41 * NavigationDrawer: Add NavigationDrawerPage for easy use of nav drawers
42 * PageStack:
43 * Add a goBack signal to Page to allow overriding the default back behavior
44 * Allow the page stack to be popped to an arbitrary page
45 * ProgressCircle: HiDPI support for ProgressCircle
46 * RadioButton and CheckBox: Trigger the click event
47 * Slider:
48 * Add customization options to the slider's label knob
49 * Support custom slider tooltips via a valueInfo function
50 * Tabs:
51 * Improved tabs support using a TabbedPage
52 * Support disabled tabs
53 * TextField:
54 * Support borderless textfields
55 * Update to latest MD spec, add multi-line support
56 * TimePicker: Implement a time picker component
57 * Tooltip: Improve the tooltip class and split it into a base Popover
58
59**Bug Fixes**
60 * General: Fix a bug causing units to be calculated incorrectly
61 * ActionBar: Only support plain text in the action bar title
62 * BottomSheet: Fix wrong ID
63 * Button:
64 * Fix the style of disabled buttons
65 * Fix typo in button width calculation
66 * CheckBox: Update the size of the checkbox
67 * Demo:
68 * Don't load the demo page twice initially
69 * Properly display the demo window when loading from C++
70 * Dropdown:
71 * Close an open dropdown when resizing the app window
72 * Fix Dropdown positioning in window edges
73 * IconButton: Fix alignment of the icon in the icon button
74 * Ink: Allow concurrent Ink animations
75 * ListItem:
76 * Fix content item not showing when it should
77 * Fix divider insets on subtitled list items
78 * Show the list item's sub text when the content item is hidden
79 * Subtitled - Fix invisible secondary item
80 * MenuField:
81 * Fix bug that MenuField cannot scroll menu items
82 * Fix TypeError when no item is selected
83 * PageSidebar: Properly push and pop the right sidebar actionbar
84 * Page: Disable the left action when it is hidden
85 * ProgressBar: Fixup style to allow use in async loader
86 * ProgressCircle:
87 * Fixup style to allow use in async loader
88 * Fix a incorrect reference to the canvas
89 * Suppress meaningless error
90 * RadioButton: centered the checked indicator
91 * SimpleMenu: Fix all the binding loop warnings
92 * Switch: Fix the groove background to match the spec
93 * Tabs:
94 * Fix tabbar when navigating back up the page stack
95 * Initialize tabs to empty
96 * Properly support changing the number of tabs in a TabbedPage
97 * TextField:
98 * Fix errors in the text field style
99 * Fixes bad Roboto font rendering on Windows
100
101
102### Version 0.1.0 (May 6, 2015)
103
104 * Create a style for theming QtQuick.Controls apps
105 * Components
106 * [ActionBar] Control the overflow menu with Android hardware keys
107 * [ActionBar] Elide titles displayed in the action bar
108 * [ActionBar] Hide non-visible actions in the action bar
109 * [ActionBar] Support disabling actions in the action bar
110 * [ActionButton] Add support for the mini and default FAB sizes
111 * [Button] Properly handle dark background for flat buttons
112 * [Dialog] Active focus is passed off when Dialog closes
113 * [Dialog] Add support for full-width content
114 * [Dialog] Correctly handle back button on Android devices
115 * [Icon] Add a valid property to Icon and AwesomeIcon
116 * [Icon] Support custom icons with an iconSource property
117 * [Icon] Update the FontAwesome icon table
118 * [Icon] Update the FontAwesome parsing script to pull from the website
119 * [IconButton] Add animation on mouse over
120 * [InputDialog] Expose the text field and input method
121 * [ListItem] Add a new expandable section header list item
122 * [ListItem] Correctly calculate the width of a simple menu item
123 * [NavigationDrawer] Update the nav drawer to work properly
124 * [PageStack] Pop pages when the Android back button is tapped
125 * [Popup] Support preventing a popup from being dismissed
126 * [RadioButton] Improve selection support
127 * [Tabs] Allow switching tabs programmatically in a page
128 * [Tabs] Capitalize tab titles
129 * [Tabs] Implement the MD spec for coloring tab text
130 * [TextField] Port to QtQuick.Controls
131 * Documentation
132 * Publish documentation to http://papyros.io/qml-material
133 * Write brief summaries for all the components
134 * Fix qdoc warnings
135 * Demo
136 * Add a Typography section to the demo
137 * Organize the different demos into tabs
138 * Display all the Material Design icons in the Icons demo
139 * Update radio button demo with grouping
140 * Testing
141 * Add UI tests for the ActionBar component
142
143
144### Version 0.0.6 (April 16, 2015)
145
146 * Add a ProgressCircle component following the Google spec
147 * Add a tooltip component and use it in the ActionBar
148 * Add an OverlayView component for view transitions
149 * [Snackbar] Bug fixes and style improvements
150 * [Button] Remove default Qt Quick Controls padding
151 * [SimpleMenu/MenuField] Fixes some binding loops
152 * [TextField] Fixes floating label behavior on devices
153 * [Action] Support for keybindings in Action
154 * [ListItem] Fix bug with Subtitled action not showing
155 * [ListItem] Add support for a custom view in the subtitled list item
156 * [Button] Add disabled state to button
157 * General bug fixing and code refactoring
158
159
160### Version 0.0.5 (March 4, 2015)
161
162 * Move popovers as necessary to prevent them being clipped by the window
163 * [PageStack] Add support for a divided page and toolbar
164 * Rename list item and IconButton onTriggered to onClicked
165 * [Toolbar] Add support for custom and extended content in the toolbar
166 * [PageStack] Make Page a FocusScope
167 * [Dialog] Refactor the dialog code to use anchors
168 * [Snackbar] Improve the snackbar and add support for mobile layouts
169 * [PageStack] Fix going back from a pushed page
170 * [ListItems] Add direct support for icons to Standard
171 * [Ink] Polished the ink animations
172 * [Dialog] Improved the dialog component
173 * [Icon] Switch to using SVGs instead of PNGs
174 * [Demo] Add the color palette to the demo
175 * [ProgressBar] Port ProgressBar to inherit from QtQuick Controls
176 * Minor bug fixes and code improvements
177 * [BottomSheet] Add a basic bottom sheet and an action list subclass
178
179
180### Version 0.0.4 (February 20, 2015)
181
182 * Hide the CSD window controls when client-side decorations are disabled
183 * Improve the dialog component to better follow Material Design
184 * Add the Material Design Checkbox component
185 * Support replacing the current page in a PageStack
186 * Improve the layout of the Subtitled list item
187 * Add the Material Design menu field component
188 * Improve the layout of the Standard list item
189 * Add an equals symbol to the "extra" icon collection
190 * Add a right mode to the navigation drawer
191 * Allow pages to customize the action count in the toolbar
192 * [Palette] Update with color swatches from Material Design
193 * [Demo] Add color picker to change theme colors
194 * [Dialog] Fix an issue preventing popovers from working
195 * [MenuField] Fix issues with the menu not being the right size
196 * [Demo] Clean up and refactor the demo
197 * [Slider] change check for activeFocus to focus so we can set it
198 * [Ink] Remove PRESSED debug message
199 * [Theme] Add a method for determining if a color is dark or light
200 * [PageStack] Fixes and improvements to the page stack and toolbar
diff --git a/prototype_2016/third_party/qml-material/CONTRIBUTING.md b/prototype_2016/third_party/qml-material/CONTRIBUTING.md
deleted file mode 100644
index 11a51fe..0000000
--- a/prototype_2016/third_party/qml-material/CONTRIBUTING.md
+++ /dev/null
@@ -1,22 +0,0 @@
1Contributing to QML Material
2----------------------------
3
4We welcome contributions to QML Material! This is what makes open source so awesome. We have a few simple guidelines for contributing outlined below.
5
6### Submitting Code
7
8We welcome code contributions via pull requests. Here are some guidelines to follow:
9
10 * If your change is more than a simple fix, make sure there is an [issue](https://github.com/quantum-os/qml-material/issues) open for the change you are making, and that there has been discussion and approval of the correct solution.
11
12 * When working on code, try to keep your commits as clean as possible. We have a [commit checklist](https://github.com/quantum-os/quantum-os/wiki/Commit-Checklist) with some guidelines for writing great commits.
13
14 * We use [GitFlow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) for a strict workflow to ensure that our code remains stable and neatly versioned for end users. So make sure you create your working branch off of `develop`, and submit the pull request back to `develop`.
15
16 * Before submitting the pull request, make sure you run the unit tests. Travis CI will test your branch anyway, and we won't merge a pull request until the tests pass, so you should fix them before submitting the pull request.
17
18 * Make sure all relevant documentation is updated for the change. If you're adding a new component, please document it.
19
20 * If you are adding new features, please add new unit tests that test the changes you added.
21
22 * If you're adding a new component, make sure you link to the [Material Design spec](http://www.google.com/design/spec/components/) for it, along with a screenshot of your component.
diff --git a/prototype_2016/third_party/qml-material/LICENSE b/prototype_2016/third_party/qml-material/LICENSE
deleted file mode 100644
index 4362b49..0000000
--- a/prototype_2016/third_party/qml-material/LICENSE
+++ /dev/null
@@ -1,502 +0,0 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 2.1, February 1999
3
4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9[This is the first released version of the Lesser GPL. It also counts
10 as the successor of the GNU Library Public License, version 2, hence
11 the version number 2.1.]
12
13 Preamble
14
15 The licenses for most software are designed to take away your
16freedom to share and change it. By contrast, the GNU General Public
17Licenses are intended to guarantee your freedom to share and change
18free software--to make sure the software is free for all its users.
19
20 This license, the Lesser General Public License, applies to some
21specially designated software packages--typically libraries--of the
22Free Software Foundation and other authors who decide to use it. You
23can use it too, but we suggest you first think carefully about whether
24this license or the ordinary General Public License is the better
25strategy to use in any particular case, based on the explanations below.
26
27 When we speak of free software, we are referring to freedom of use,
28not price. Our General Public Licenses are designed to make sure that
29you have the freedom to distribute copies of free software (and charge
30for this service if you wish); that you receive source code or can get
31it if you want it; that you can change the software and use pieces of
32it in new free programs; and that you are informed that you can do
33these things.
34
35 To protect your rights, we need to make restrictions that forbid
36distributors to deny you these rights or to ask you to surrender these
37rights. These restrictions translate to certain responsibilities for
38you if you distribute copies of the library or if you modify it.
39
40 For example, if you distribute copies of the library, whether gratis
41or for a fee, you must give the recipients all the rights that we gave
42you. You must make sure that they, too, receive or can get the source
43code. If you link other code with the library, you must provide
44complete object files to the recipients, so that they can relink them
45with the library after making changes to the library and recompiling
46it. And you must show them these terms so they know their rights.
47
48 We protect your rights with a two-step method: (1) we copyright the
49library, and (2) we offer you this license, which gives you legal
50permission to copy, distribute and/or modify the library.
51
52 To protect each distributor, we want to make it very clear that
53there is no warranty for the free library. Also, if the library is
54modified by someone else and passed on, the recipients should know
55that what they have is not the original version, so that the original
56author's reputation will not be affected by problems that might be
57introduced by others.
58
59 Finally, software patents pose a constant threat to the existence of
60any free program. We wish to make sure that a company cannot
61effectively restrict the users of a free program by obtaining a
62restrictive license from a patent holder. Therefore, we insist that
63any patent license obtained for a version of the library must be
64consistent with the full freedom of use specified in this license.
65
66 Most GNU software, including some libraries, is covered by the
67ordinary GNU General Public License. This license, the GNU Lesser
68General Public License, applies to certain designated libraries, and
69is quite different from the ordinary General Public License. We use
70this license for certain libraries in order to permit linking those
71libraries into non-free programs.
72
73 When a program is linked with a library, whether statically or using
74a shared library, the combination of the two is legally speaking a
75combined work, a derivative of the original library. The ordinary
76General Public License therefore permits such linking only if the
77entire combination fits its criteria of freedom. The Lesser General
78Public License permits more lax criteria for linking other code with
79the library.
80
81 We call this license the "Lesser" General Public License because it
82does Less to protect the user's freedom than the ordinary General
83Public License. It also provides other free software developers Less
84of an advantage over competing non-free programs. These disadvantages
85are the reason we use the ordinary General Public License for many
86libraries. However, the Lesser license provides advantages in certain
87special circumstances.
88
89 For example, on rare occasions, there may be a special need to
90encourage the widest possible use of a certain library, so that it becomes
91a de-facto standard. To achieve this, non-free programs must be
92allowed to use the library. A more frequent case is that a free
93library does the same job as widely used non-free libraries. In this
94case, there is little to gain by limiting the free library to free
95software only, so we use the Lesser General Public License.
96
97 In other cases, permission to use a particular library in non-free
98programs enables a greater number of people to use a large body of
99free software. For example, permission to use the GNU C Library in
100non-free programs enables many more people to use the whole GNU
101operating system, as well as its variant, the GNU/Linux operating
102system.
103
104 Although the Lesser General Public License is Less protective of the
105users' freedom, it does ensure that the user of a program that is
106linked with the Library has the freedom and the wherewithal to run
107that program using a modified version of the Library.
108
109 The precise terms and conditions for copying, distribution and
110modification follow. Pay close attention to the difference between a
111"work based on the library" and a "work that uses the library". The
112former contains code derived from the library, whereas the latter must
113be combined with the library in order to run.
114
115 GNU LESSER GENERAL PUBLIC LICENSE
116 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
118 0. This License Agreement applies to any software library or other
119program which contains a notice placed by the copyright holder or
120other authorized party saying it may be distributed under the terms of
121this Lesser General Public License (also called "this License").
122Each licensee is addressed as "you".
123
124 A "library" means a collection of software functions and/or data
125prepared so as to be conveniently linked with application programs
126(which use some of those functions and data) to form executables.
127
128 The "Library", below, refers to any such software library or work
129which has been distributed under these terms. A "work based on the
130Library" means either the Library or any derivative work under
131copyright law: that is to say, a work containing the Library or a
132portion of it, either verbatim or with modifications and/or translated
133straightforwardly into another language. (Hereinafter, translation is
134included without limitation in the term "modification".)
135
136 "Source code" for a work means the preferred form of the work for
137making modifications to it. For a library, complete source code means
138all the source code for all modules it contains, plus any associated
139interface definition files, plus the scripts used to control compilation
140and installation of the library.
141
142 Activities other than copying, distribution and modification are not
143covered by this License; they are outside its scope. The act of
144running a program using the Library is not restricted, and output from
145such a program is covered only if its contents constitute a work based
146on the Library (independent of the use of the Library in a tool for
147writing it). Whether that is true depends on what the Library does
148and what the program that uses the Library does.
149
150 1. You may copy and distribute verbatim copies of the Library's
151complete source code as you receive it, in any medium, provided that
152you conspicuously and appropriately publish on each copy an
153appropriate copyright notice and disclaimer of warranty; keep intact
154all the notices that refer to this License and to the absence of any
155warranty; and distribute a copy of this License along with the
156Library.
157
158 You may charge a fee for the physical act of transferring a copy,
159and you may at your option offer warranty protection in exchange for a
160fee.
161
162 2. You may modify your copy or copies of the Library or any portion
163of it, thus forming a work based on the Library, and copy and
164distribute such modifications or work under the terms of Section 1
165above, provided that you also meet all of these conditions:
166
167 a) The modified work must itself be a software library.
168
169 b) You must cause the files modified to carry prominent notices
170 stating that you changed the files and the date of any change.
171
172 c) You must cause the whole of the work to be licensed at no
173 charge to all third parties under the terms of this License.
174
175 d) If a facility in the modified Library refers to a function or a
176 table of data to be supplied by an application program that uses
177 the facility, other than as an argument passed when the facility
178 is invoked, then you must make a good faith effort to ensure that,
179 in the event an application does not supply such function or
180 table, the facility still operates, and performs whatever part of
181 its purpose remains meaningful.
182
183 (For example, a function in a library to compute square roots has
184 a purpose that is entirely well-defined independent of the
185 application. Therefore, Subsection 2d requires that any
186 application-supplied function or table used by this function must
187 be optional: if the application does not supply it, the square
188 root function must still compute square roots.)
189
190These requirements apply to the modified work as a whole. If
191identifiable sections of that work are not derived from the Library,
192and can be reasonably considered independent and separate works in
193themselves, then this License, and its terms, do not apply to those
194sections when you distribute them as separate works. But when you
195distribute the same sections as part of a whole which is a work based
196on the Library, the distribution of the whole must be on the terms of
197this License, whose permissions for other licensees extend to the
198entire whole, and thus to each and every part regardless of who wrote
199it.
200
201Thus, it is not the intent of this section to claim rights or contest
202your rights to work written entirely by you; rather, the intent is to
203exercise the right to control the distribution of derivative or
204collective works based on the Library.
205
206In addition, mere aggregation of another work not based on the Library
207with the Library (or with a work based on the Library) on a volume of
208a storage or distribution medium does not bring the other work under
209the scope of this License.
210
211 3. You may opt to apply the terms of the ordinary GNU General Public
212License instead of this License to a given copy of the Library. To do
213this, you must alter all the notices that refer to this License, so
214that they refer to the ordinary GNU General Public License, version 2,
215instead of to this License. (If a newer version than version 2 of the
216ordinary GNU General Public License has appeared, then you can specify
217that version instead if you wish.) Do not make any other change in
218these notices.
219
220 Once this change is made in a given copy, it is irreversible for
221that copy, so the ordinary GNU General Public License applies to all
222subsequent copies and derivative works made from that copy.
223
224 This option is useful when you wish to copy part of the code of
225the Library into a program that is not a library.
226
227 4. You may copy and distribute the Library (or a portion or
228derivative of it, under Section 2) in object code or executable form
229under the terms of Sections 1 and 2 above provided that you accompany
230it with the complete corresponding machine-readable source code, which
231must be distributed under the terms of Sections 1 and 2 above on a
232medium customarily used for software interchange.
233
234 If distribution of object code is made by offering access to copy
235from a designated place, then offering equivalent access to copy the
236source code from the same place satisfies the requirement to
237distribute the source code, even though third parties are not
238compelled to copy the source along with the object code.
239
240 5. A program that contains no derivative of any portion of the
241Library, but is designed to work with the Library by being compiled or
242linked with it, is called a "work that uses the Library". Such a
243work, in isolation, is not a derivative work of the Library, and
244therefore falls outside the scope of this License.
245
246 However, linking a "work that uses the Library" with the Library
247creates an executable that is a derivative of the Library (because it
248contains portions of the Library), rather than a "work that uses the
249library". The executable is therefore covered by this License.
250Section 6 states terms for distribution of such executables.
251
252 When a "work that uses the Library" uses material from a header file
253that is part of the Library, the object code for the work may be a
254derivative work of the Library even though the source code is not.
255Whether this is true is especially significant if the work can be
256linked without the Library, or if the work is itself a library. The
257threshold for this to be true is not precisely defined by law.
258
259 If such an object file uses only numerical parameters, data
260structure layouts and accessors, and small macros and small inline
261functions (ten lines or less in length), then the use of the object
262file is unrestricted, regardless of whether it is legally a derivative
263work. (Executables containing this object code plus portions of the
264Library will still fall under Section 6.)
265
266 Otherwise, if the work is a derivative of the Library, you may
267distribute the object code for the work under the terms of Section 6.
268Any executables containing that work also fall under Section 6,
269whether or not they are linked directly with the Library itself.
270
271 6. As an exception to the Sections above, you may also combine or
272link a "work that uses the Library" with the Library to produce a
273work containing portions of the Library, and distribute that work
274under terms of your choice, provided that the terms permit
275modification of the work for the customer's own use and reverse
276engineering for debugging such modifications.
277
278 You must give prominent notice with each copy of the work that the
279Library is used in it and that the Library and its use are covered by
280this License. You must supply a copy of this License. If the work
281during execution displays copyright notices, you must include the
282copyright notice for the Library among them, as well as a reference
283directing the user to the copy of this License. Also, you must do one
284of these things:
285
286 a) Accompany the work with the complete corresponding
287 machine-readable source code for the Library including whatever
288 changes were used in the work (which must be distributed under
289 Sections 1 and 2 above); and, if the work is an executable linked
290 with the Library, with the complete machine-readable "work that
291 uses the Library", as object code and/or source code, so that the
292 user can modify the Library and then relink to produce a modified
293 executable containing the modified Library. (It is understood
294 that the user who changes the contents of definitions files in the
295 Library will not necessarily be able to recompile the application
296 to use the modified definitions.)
297
298 b) Use a suitable shared library mechanism for linking with the
299 Library. A suitable mechanism is one that (1) uses at run time a
300 copy of the library already present on the user's computer system,
301 rather than copying library functions into the executable, and (2)
302 will operate properly with a modified version of the library, if
303 the user installs one, as long as the modified version is
304 interface-compatible with the version that the work was made with.
305
306 c) Accompany the work with a written offer, valid for at
307 least three years, to give the same user the materials
308 specified in Subsection 6a, above, for a charge no more
309 than the cost of performing this distribution.
310
311 d) If distribution of the work is made by offering access to copy
312 from a designated place, offer equivalent access to copy the above
313 specified materials from the same place.
314
315 e) Verify that the user has already received a copy of these
316 materials or that you have already sent this user a copy.
317
318 For an executable, the required form of the "work that uses the
319Library" must include any data and utility programs needed for
320reproducing the executable from it. However, as a special exception,
321the materials to be distributed need not include anything that is
322normally distributed (in either source or binary form) with the major
323components (compiler, kernel, and so on) of the operating system on
324which the executable runs, unless that component itself accompanies
325the executable.
326
327 It may happen that this requirement contradicts the license
328restrictions of other proprietary libraries that do not normally
329accompany the operating system. Such a contradiction means you cannot
330use both them and the Library together in an executable that you
331distribute.
332
333 7. You may place library facilities that are a work based on the
334Library side-by-side in a single library together with other library
335facilities not covered by this License, and distribute such a combined
336library, provided that the separate distribution of the work based on
337the Library and of the other library facilities is otherwise
338permitted, and provided that you do these two things:
339
340 a) Accompany the combined library with a copy of the same work
341 based on the Library, uncombined with any other library
342 facilities. This must be distributed under the terms of the
343 Sections above.
344
345 b) Give prominent notice with the combined library of the fact
346 that part of it is a work based on the Library, and explaining
347 where to find the accompanying uncombined form of the same work.
348
349 8. You may not copy, modify, sublicense, link with, or distribute
350the Library except as expressly provided under this License. Any
351attempt otherwise to copy, modify, sublicense, link with, or
352distribute the Library is void, and will automatically terminate your
353rights under this License. However, parties who have received copies,
354or rights, from you under this License will not have their licenses
355terminated so long as such parties remain in full compliance.
356
357 9. You are not required to accept this License, since you have not
358signed it. However, nothing else grants you permission to modify or
359distribute the Library or its derivative works. These actions are
360prohibited by law if you do not accept this License. Therefore, by
361modifying or distributing the Library (or any work based on the
362Library), you indicate your acceptance of this License to do so, and
363all its terms and conditions for copying, distributing or modifying
364the Library or works based on it.
365
366 10. Each time you redistribute the Library (or any work based on the
367Library), the recipient automatically receives a license from the
368original licensor to copy, distribute, link with or modify the Library
369subject to these terms and conditions. You may not impose any further
370restrictions on the recipients' exercise of the rights granted herein.
371You are not responsible for enforcing compliance by third parties with
372this License.
373
374 11. If, as a consequence of a court judgment or allegation of patent
375infringement or for any other reason (not limited to patent issues),
376conditions are imposed on you (whether by court order, agreement or
377otherwise) that contradict the conditions of this License, they do not
378excuse you from the conditions of this License. If you cannot
379distribute so as to satisfy simultaneously your obligations under this
380License and any other pertinent obligations, then as a consequence you
381may not distribute the Library at all. For example, if a patent
382license would not permit royalty-free redistribution of the Library by
383all those who receive copies directly or indirectly through you, then
384the only way you could satisfy both it and this License would be to
385refrain entirely from distribution of the Library.
386
387If any portion of this section is held invalid or unenforceable under any
388particular circumstance, the balance of the section is intended to apply,
389and the section as a whole is intended to apply in other circumstances.
390
391It is not the purpose of this section to induce you to infringe any
392patents or other property right claims or to contest validity of any
393such claims; this section has the sole purpose of protecting the
394integrity of the free software distribution system which is
395implemented by public license practices. Many people have made
396generous contributions to the wide range of software distributed
397through that system in reliance on consistent application of that
398system; it is up to the author/donor to decide if he or she is willing
399to distribute software through any other system and a licensee cannot
400impose that choice.
401
402This section is intended to make thoroughly clear what is believed to
403be a consequence of the rest of this License.
404
405 12. If the distribution and/or use of the Library is restricted in
406certain countries either by patents or by copyrighted interfaces, the
407original copyright holder who places the Library under this License may add
408an explicit geographical distribution limitation excluding those countries,
409so that distribution is permitted only in or among countries not thus
410excluded. In such case, this License incorporates the limitation as if
411written in the body of this License.
412
413 13. The Free Software Foundation may publish revised and/or new
414versions of the Lesser General Public License from time to time.
415Such new versions will be similar in spirit to the present version,
416but may differ in detail to address new problems or concerns.
417
418Each version is given a distinguishing version number. If the Library
419specifies a version number of this License which applies to it and
420"any later version", you have the option of following the terms and
421conditions either of that version or of any later version published by
422the Free Software Foundation. If the Library does not specify a
423license version number, you may choose any version ever published by
424the Free Software Foundation.
425
426 14. If you wish to incorporate parts of the Library into other free
427programs whose distribution conditions are incompatible with these,
428write to the author to ask for permission. For software which is
429copyrighted by the Free Software Foundation, write to the Free
430Software Foundation; we sometimes make exceptions for this. Our
431decision will be guided by the two goals of preserving the free status
432of all derivatives of our free software and of promoting the sharing
433and reuse of software generally.
434
435 NO WARRANTY
436
437 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
447 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456DAMAGES.
457
458 END OF TERMS AND CONDITIONS
459
460 How to Apply These Terms to Your New Libraries
461
462 If you develop a new library, and you want it to be of the greatest
463possible use to the public, we recommend making it free software that
464everyone can redistribute and change. You can do so by permitting
465redistribution under these terms (or, alternatively, under the terms of the
466ordinary General Public License).
467
468 To apply these terms, attach the following notices to the library. It is
469safest to attach them to the start of each source file to most effectively
470convey the exclusion of warranty; and each file should have at least the
471"copyright" line and a pointer to where the full notice is found.
472
473 <one line to give the library's name and a brief idea of what it does.>
474 Copyright (C) <year> <name of author>
475
476 This library is free software; you can redistribute it and/or
477 modify it under the terms of the GNU Lesser General Public
478 License as published by the Free Software Foundation; either
479 version 2.1 of the License, or (at your option) any later version.
480
481 This library is distributed in the hope that it will be useful,
482 but WITHOUT ANY WARRANTY; without even the implied warranty of
483 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 Lesser General Public License for more details.
485
486 You should have received a copy of the GNU Lesser General Public
487 License along with this library; if not, write to the Free Software
488 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489
490Also add information on how to contact you by electronic and paper mail.
491
492You should also get your employer (if you work as a programmer) or your
493school, if any, to sign a "copyright disclaimer" for the library, if
494necessary. Here is a sample; alter the names:
495
496 Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
499 <signature of Ty Coon>, 1 April 1990
500 Ty Coon, President of Vice
501
502That's all there is to it!
diff --git a/prototype_2016/third_party/qml-material/LICENSE.CC-BY b/prototype_2016/third_party/qml-material/LICENSE.CC-BY
deleted file mode 100644
index dc8853a..0000000
--- a/prototype_2016/third_party/qml-material/LICENSE.CC-BY
+++ /dev/null
@@ -1,393 +0,0 @@
1Attribution 4.0 International
2
3=======================================================================
4
5Creative Commons Corporation ("Creative Commons") is not a law firm and
6does not provide legal services or legal advice. Distribution of
7Creative Commons public licenses does not create a lawyer-client or
8other relationship. Creative Commons makes its licenses and related
9information available on an "as-is" basis. Creative Commons gives no
10warranties regarding its licenses, any material licensed under their
11terms and conditions, or any related information. Creative Commons
12disclaims all liability for damages resulting from their use to the
13fullest extent possible.
14
15Using Creative Commons Public Licenses
16
17Creative Commons public licenses provide a standard set of terms and
18conditions that creators and other rights holders may use to share
19original works of authorship and other material subject to copyright
20and certain other rights specified in the public license below. The
21following considerations are for informational purposes only, are not
22exhaustive, and do not form part of our licenses.
23
24 Considerations for licensors: Our public licenses are
25 intended for use by those authorized to give the public
26 permission to use material in ways otherwise restricted by
27 copyright and certain other rights. Our licenses are
28 irrevocable. Licensors should read and understand the terms
29 and conditions of the license they choose before applying it.
30 Licensors should also secure all rights necessary before
31 applying our licenses so that the public can reuse the
32 material as expected. Licensors should clearly mark any
33 material not subject to the license. This includes other CC-
34 licensed material, or material used under an exception or
35 limitation to copyright. More considerations for licensors:
36 wiki.creativecommons.org/Considerations_for_licensors
37
38 Considerations for the public: By using one of our public
39 licenses, a licensor grants the public permission to use the
40 licensed material under specified terms and conditions. If
41 the licensor's permission is not necessary for any reason--for
42 example, because of any applicable exception or limitation to
43 copyright--then that use is not regulated by the license. Our
44 licenses grant only permissions under copyright and certain
45 other rights that a licensor has authority to grant. Use of
46 the licensed material may still be restricted for other
47 reasons, including because others have copyright or other
48 rights in the material. A licensor may make special requests,
49 such as asking that all changes be marked or described.
50 Although not required by our licenses, you are encouraged to
51 respect those requests where reasonable. More_considerations
52 for the public:
53 wiki.creativecommons.org/Considerations_for_licensees
54
55=======================================================================
56
57Creative Commons Attribution 4.0 International Public License
58
59By exercising the Licensed Rights (defined below), You accept and agree
60to be bound by the terms and conditions of this Creative Commons
61Attribution 4.0 International Public License ("Public License"). To the
62extent this Public License may be interpreted as a contract, You are
63granted the Licensed Rights in consideration of Your acceptance of
64these terms and conditions, and the Licensor grants You such rights in
65consideration of benefits the Licensor receives from making the
66Licensed Material available under these terms and conditions.
67
68
69Section 1 -- Definitions.
70
71 a. Adapted Material means material subject to Copyright and Similar
72 Rights that is derived from or based upon the Licensed Material
73 and in which the Licensed Material is translated, altered,
74 arranged, transformed, or otherwise modified in a manner requiring
75 permission under the Copyright and Similar Rights held by the
76 Licensor. For purposes of this Public License, where the Licensed
77 Material is a musical work, performance, or sound recording,
78 Adapted Material is always produced where the Licensed Material is
79 synched in timed relation with a moving image.
80
81 b. Adapter's License means the license You apply to Your Copyright
82 and Similar Rights in Your contributions to Adapted Material in
83 accordance with the terms and conditions of this Public License.
84
85 c. Copyright and Similar Rights means copyright and/or similar rights
86 closely related to copyright including, without limitation,
87 performance, broadcast, sound recording, and Sui Generis Database
88 Rights, without regard to how the rights are labeled or
89 categorized. For purposes of this Public License, the rights
90 specified in Section 2(b)(1)-(2) are not Copyright and Similar
91 Rights.
92
93 d. Effective Technological Measures means those measures that, in the
94 absence of proper authority, may not be circumvented under laws
95 fulfilling obligations under Article 11 of the WIPO Copyright
96 Treaty adopted on December 20, 1996, and/or similar international
97 agreements.
98
99 e. Exceptions and Limitations means fair use, fair dealing, and/or
100 any other exception or limitation to Copyright and Similar Rights
101 that applies to Your use of the Licensed Material.
102
103 f. Licensed Material means the artistic or literary work, database,
104 or other material to which the Licensor applied this Public
105 License.
106
107 g. Licensed Rights means the rights granted to You subject to the
108 terms and conditions of this Public License, which are limited to
109 all Copyright and Similar Rights that apply to Your use of the
110 Licensed Material and that the Licensor has authority to license.
111
112 h. Licensor means the individual(s) or entity(ies) granting rights
113 under this Public License.
114
115 i. Share means to provide material to the public by any means or
116 process that requires permission under the Licensed Rights, such
117 as reproduction, public display, public performance, distribution,
118 dissemination, communication, or importation, and to make material
119 available to the public including in ways that members of the
120 public may access the material from a place and at a time
121 individually chosen by them.
122
123 j. Sui Generis Database Rights means rights other than copyright
124 resulting from Directive 96/9/EC of the European Parliament and of
125 the Council of 11 March 1996 on the legal protection of databases,
126 as amended and/or succeeded, as well as other essentially
127 equivalent rights anywhere in the world.
128
129 k. You means the individual or entity exercising the Licensed Rights
130 under this Public License. Your has a corresponding meaning.
131
132
133Section 2 -- Scope.
134
135 a. License grant.
136
137 1. Subject to the terms and conditions of this Public License,
138 the Licensor hereby grants You a worldwide, royalty-free,
139 non-sublicensable, non-exclusive, irrevocable license to
140 exercise the Licensed Rights in the Licensed Material to:
141
142 a. reproduce and Share the Licensed Material, in whole or
143 in part; and
144
145 b. produce, reproduce, and Share Adapted Material.
146
147 2. Exceptions and Limitations. For the avoidance of doubt, where
148 Exceptions and Limitations apply to Your use, this Public
149 License does not apply, and You do not need to comply with
150 its terms and conditions.
151
152 3. Term. The term of this Public License is specified in Section
153 6(a).
154
155 4. Media and formats; technical modifications allowed. The
156 Licensor authorizes You to exercise the Licensed Rights in
157 all media and formats whether now known or hereafter created,
158 and to make technical modifications necessary to do so. The
159 Licensor waives and/or agrees not to assert any right or
160 authority to forbid You from making technical modifications
161 necessary to exercise the Licensed Rights, including
162 technical modifications necessary to circumvent Effective
163 Technological Measures. For purposes of this Public License,
164 simply making modifications authorized by this Section 2(a)
165 (4) never produces Adapted Material.
166
167 5. Downstream recipients.
168
169 a. Offer from the Licensor -- Licensed Material. Every
170 recipient of the Licensed Material automatically
171 receives an offer from the Licensor to exercise the
172 Licensed Rights under the terms and conditions of this
173 Public License.
174
175 b. No downstream restrictions. You may not offer or impose
176 any additional or different terms or conditions on, or
177 apply any Effective Technological Measures to, the
178 Licensed Material if doing so restricts exercise of the
179 Licensed Rights by any recipient of the Licensed
180 Material.
181
182 6. No endorsement. Nothing in this Public License constitutes or
183 may be construed as permission to assert or imply that You
184 are, or that Your use of the Licensed Material is, connected
185 with, or sponsored, endorsed, or granted official status by,
186 the Licensor or others designated to receive attribution as
187 provided in Section 3(a)(1)(A)(i).
188
189 b. Other rights.
190
191 1. Moral rights, such as the right of integrity, are not
192 licensed under this Public License, nor are publicity,
193 privacy, and/or other similar personality rights; however, to
194 the extent possible, the Licensor waives and/or agrees not to
195 assert any such rights held by the Licensor to the limited
196 extent necessary to allow You to exercise the Licensed
197 Rights, but not otherwise.
198
199 2. Patent and trademark rights are not licensed under this
200 Public License.
201
202 3. To the extent possible, the Licensor waives any right to
203 collect royalties from You for the exercise of the Licensed
204 Rights, whether directly or through a collecting society
205 under any voluntary or waivable statutory or compulsory
206 licensing scheme. In all other cases the Licensor expressly
207 reserves any right to collect such royalties.
208
209
210Section 3 -- License Conditions.
211
212Your exercise of the Licensed Rights is expressly made subject to the
213following conditions.
214
215 a. Attribution.
216
217 1. If You Share the Licensed Material (including in modified
218 form), You must:
219
220 a. retain the following if it is supplied by the Licensor
221 with the Licensed Material:
222
223 i. identification of the creator(s) of the Licensed
224 Material and any others designated to receive
225 attribution, in any reasonable manner requested by
226 the Licensor (including by pseudonym if
227 designated);
228
229 ii. a copyright notice;
230
231 iii. a notice that refers to this Public License;
232
233 iv. a notice that refers to the disclaimer of
234 warranties;
235
236 v. a URI or hyperlink to the Licensed Material to the
237 extent reasonably practicable;
238
239 b. indicate if You modified the Licensed Material and
240 retain an indication of any previous modifications; and
241
242 c. indicate the Licensed Material is licensed under this
243 Public License, and include the text of, or the URI or
244 hyperlink to, this Public License.
245
246 2. You may satisfy the conditions in Section 3(a)(1) in any
247 reasonable manner based on the medium, means, and context in
248 which You Share the Licensed Material. For example, it may be
249 reasonable to satisfy the conditions by providing a URI or
250 hyperlink to a resource that includes the required
251 information.
252
253 3. If requested by the Licensor, You must remove any of the
254 information required by Section 3(a)(1)(A) to the extent
255 reasonably practicable.
256
257 4. If You Share Adapted Material You produce, the Adapter's
258 License You apply must not prevent recipients of the Adapted
259 Material from complying with this Public License.
260
261
262Section 4 -- Sui Generis Database Rights.
263
264Where the Licensed Rights include Sui Generis Database Rights that
265apply to Your use of the Licensed Material:
266
267 a. for the avoidance of doubt, Section 2(a)(1) grants You the right
268 to extract, reuse, reproduce, and Share all or a substantial
269 portion of the contents of the database;
270
271 b. if You include all or a substantial portion of the database
272 contents in a database in which You have Sui Generis Database
273 Rights, then the database in which You have Sui Generis Database
274 Rights (but not its individual contents) is Adapted Material; and
275
276 c. You must comply with the conditions in Section 3(a) if You Share
277 all or a substantial portion of the contents of the database.
278
279For the avoidance of doubt, this Section 4 supplements and does not
280replace Your obligations under this Public License where the Licensed
281Rights include other Copyright and Similar Rights.
282
283
284Section 5 -- Disclaimer of Warranties and Limitation of Liability.
285
286 a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
287 EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
288 AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
289 ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
290 IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
291 WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
292 PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
293 ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
294 KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
295 ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
296
297 b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
298 TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
299 NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
300 INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
301 COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
302 USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
303 ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
304 DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
305 IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
306
307 c. The disclaimer of warranties and limitation of liability provided
308 above shall be interpreted in a manner that, to the extent
309 possible, most closely approximates an absolute disclaimer and
310 waiver of all liability.
311
312
313Section 6 -- Term and Termination.
314
315 a. This Public License applies for the term of the Copyright and
316 Similar Rights licensed here. However, if You fail to comply with
317 this Public License, then Your rights under this Public License
318 terminate automatically.
319
320 b. Where Your right to use the Licensed Material has terminated under
321 Section 6(a), it reinstates:
322
323 1. automatically as of the date the violation is cured, provided
324 it is cured within 30 days of Your discovery of the
325 violation; or
326
327 2. upon express reinstatement by the Licensor.
328
329 For the avoidance of doubt, this Section 6(b) does not affect any
330 right the Licensor may have to seek remedies for Your violations
331 of this Public License.
332
333 c. For the avoidance of doubt, the Licensor may also offer the
334 Licensed Material under separate terms or conditions or stop
335 distributing the Licensed Material at any time; however, doing so
336 will not terminate this Public License.
337
338 d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
339 License.
340
341
342Section 7 -- Other Terms and Conditions.
343
344 a. The Licensor shall not be bound by any additional or different
345 terms or conditions communicated by You unless expressly agreed.
346
347 b. Any arrangements, understandings, or agreements regarding the
348 Licensed Material not stated herein are separate from and
349 independent of the terms and conditions of this Public License.
350
351
352Section 8 -- Interpretation.
353
354 a. For the avoidance of doubt, this Public License does not, and
355 shall not be interpreted to, reduce, limit, restrict, or impose
356 conditions on any use of the Licensed Material that could lawfully
357 be made without permission under this Public License.
358
359 b. To the extent possible, if any provision of this Public License is
360 deemed unenforceable, it shall be automatically reformed to the
361 minimum extent necessary to make it enforceable. If the provision
362 cannot be reformed, it shall be severed from this Public License
363 without affecting the enforceability of the remaining terms and
364 conditions.
365
366 c. No term or condition of this Public License will be waived and no
367 failure to comply consented to unless expressly agreed to by the
368 Licensor.
369
370 d. Nothing in this Public License constitutes or may be interpreted
371 as a limitation upon, or waiver of, any privileges and immunities
372 that apply to the Licensor or You, including from the legal
373 processes of any jurisdiction or authority.
374
375
376=======================================================================
377
378Creative Commons is not a party to its public licenses.
379Notwithstanding, Creative Commons may elect to apply one of its public
380licenses to material it publishes and in those instances will be
381considered the "Licensor." Except for the limited purpose of indicating
382that material is shared under a Creative Commons public license or as
383otherwise permitted by the Creative Commons policies published at
384creativecommons.org/policies, Creative Commons does not authorize the
385use of the trademark "Creative Commons" or any other trademark or logo
386of Creative Commons without its prior written consent including,
387without limitation, in connection with any unauthorized modifications
388to any of its public licenses or any other arrangements,
389understandings, or agreements concerning use of licensed material. For
390the avoidance of doubt, this paragraph does not form part of the public
391licenses.
392
393Creative Commons may be contacted at creativecommons.org.
diff --git a/prototype_2016/third_party/qml-material/LICENSE.MPL b/prototype_2016/third_party/qml-material/LICENSE.MPL
deleted file mode 100644
index e69de29..0000000
--- a/prototype_2016/third_party/qml-material/LICENSE.MPL
+++ /dev/null
diff --git a/prototype_2016/third_party/qml-material/README.md b/prototype_2016/third_party/qml-material/README.md
deleted file mode 100644
index 7c5eb5b..0000000
--- a/prototype_2016/third_party/qml-material/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
1Material Design implemented in QtQuick
2======================================
3
4[![Join the chat at https://gitter.im/papyros/qml-material](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/papyros/qml-material?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
6[![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)
7[![GitHub release](https://img.shields.io/github/release/papyros/qml-material.svg)](https://github.com/papyros/qml-material)
8[![Build Status](https://travis-ci.org/papyros/qml-material.svg?branch=develop)](https://travis-ci.org/papyros/qml-material)
9[![GitHub issues](https://img.shields.io/github/issues/papyros/qml-material.svg)](https://github.com/papyros/qml-material/issues)
10[![Bountysource](https://img.shields.io/bountysource/team/papyros/activity.svg)](https://www.bountysource.com/teams/papyros)
11
12This is a library of QML widgets implementing Google's [Material Design](https://www.google.com/design/spec). It is completely cross platform, and runs on Linux, OS X, and Windows. It may also run on iOS and Android, though those platforms have not been tested and are not currently officially supported.
13
14Brought to you by the [Papyros development team](https://github.com/papyros/qml-material/graphs/contributors).
15
16### Dependencies
17
18 * Qt 5.5 or higher
19
20### Per-project installation using QPM
21
22QPM package coming soon!
23
24Just install using:
25
26 qpm install io.papyros.material
27
28If you want to bundle the Roboto fonts in your project, file **ABOVE** the `include(vendor/vendor.pri)` line, add the following line:
29
30 OPTIONS += roboto
31
32### Per-project installation using git submodules and QMake
33
34Add the submodule:
35
36 git submodule add git@github.com:papyros/qml-material.git material
37
38Add the following DEFINE and `.pri` file to your project:
39
40 DEFINES += QPM_INIT\\(E\\)=\"E.addImportPath(QStringLiteral(\\\"qrc:/\\\"));\"
41
42 include(material/material.pri)
43
44Then, in your `main.cpp` file or wherever you set up a `QQmlApplicationEngine`, call `QPM_INIT` on the engine like this:
45
46 QQmlApplicationEngine engine;
47 QPM_INIT(engine)
48 engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
49
50You should then be able to `import Material 0.3` from your QML.
51
52To optionally bundle the Roboto fonts in your project, add this line **ABOVE** the previously added `include()`:
53
54 OPTIONS += roboto
55
56### Per-project installation using git submodules and CMake
57
58Add the submodule:
59
60 git submodule add git@github.com:papyros/qml-material.git material
61
62Add the following lines to your project's `CMakeLists.txt`, and make sure you add `${VENDOR_SOURCES}` to your `add_executable` line:
63
64 add_definitions("-DQPM_INIT\\(E\\)=E.addImportPath\\(QStringLiteral\\(\\\"qrc:/\\\"\\)\\)\\;")
65
66 include(material/vendor.cmake)
67
68Then, in your `main.cpp` file or wherever you set up a `QQmlApplicationEngine`, call `QPM_INIT` on the engine like this:
69
70 QQmlApplicationEngine engine;
71 QPM_INIT(engine)
72 engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
73
74You should then be able to `import Material 0.3` from your QML.
75
76Check out [this example](https://github.com/iBeliever/bible-app) of an app using QML Material and CMake if you need further guidance.
77
78### System-wide installation
79
80From the root of the repository, run:
81
82 mkdir build; cd build
83 qmake ..
84 make
85 make install # use sudo if necessary
86
87Now check out the `demo` folder to see how to use Material Design from QtQuick!
88
89### Icons usage
90
91When using the `Icon` component or the `iconName` property, qml-material looks for icons in the form of `qrc:/icons/<category>/<name>.svg`. Only a core set of icons used by qml-material icons are actually bundled with qml-material. To use icons in your own programs, you can either manually create a qrc file, or you can create `icons.yml` file and use the `icons.py` script from qml-material.
92
93To use the `icons.py` script, create a file called `icons.yml` that looks like this:
94
95 icons:
96 - action/settings
97 - alert/warning
98 - ...
99
100Run `icons.py`, located in the `scripts` folder of the repository. This will download the latest version of all the icons listed in this file, storing them in a folder called `icons`. It also generates a resource file called `icons/icons.qrc`, which you should add to your QMake or CMake project.
101
102Now whenever you add icons to the `icons.yml` file, just rerun `icons.py` and the new icons will be downloaded. To update your icons, just delete the `icons` folder and rerun `icons.py`.
103
104### Licensing
105
106QML Material is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
107
108The Material Design icons by Google are released under an [Attribution 4.0 International](http://creativecommons.org/licenses/by/4.0/) license. The icons are directly copied from Google's GitHub repository at https://github.com/google/material-design-icons.
diff --git a/prototype_2016/third_party/qml-material/demo/BottomSheetDemo.qml b/prototype_2016/third_party/qml-material/demo/BottomSheetDemo.qml
deleted file mode 100644
index e73344c..0000000
--- a/prototype_2016/third_party/qml-material/demo/BottomSheetDemo.qml
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2015 Steve Coffey <scoffey@barracuda.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18import QtQuick 2.4
19import Material 0.2
20import Material.ListItems 0.1
21
22Item {
23 anchors.fill: parent
24 id: bottomSheetDemo
25
26 Button {
27 anchors.centerIn: parent
28 elevation: 1
29 text: "Open Bottom Sheet"
30 onClicked: {
31 actionSheet.open()
32 }
33 }
34
35 BottomActionSheet {
36 id: actionSheet
37
38 title: "Demo!"
39
40 actions: [
41 Action {
42 iconName: "social/share"
43 name: "Share"
44 },
45
46 Action {
47 iconName: "file/file_download"
48 name: "Download (Disabled)"
49 enabled: false
50 },
51
52 Action {
53 iconName: "action/autorenew"
54 name: "THIS SHOULD BE HIDDEN"
55 visible: false
56 },
57
58 Action {
59 iconName: "action/settings"
60 name: "Details"
61 hasDividerAfter: true
62 },
63
64 Action {
65 iconName: "content/forward"
66 name: "Move"
67 },
68
69 Action {
70 iconName: "action/delete"
71 name: "Delete"
72 },
73
74 Action {
75 iconName: "content/create"
76 name: "Rename"
77 }
78 ]
79 }
80}
81
diff --git a/prototype_2016/third_party/qml-material/demo/ButtonDemo.qml b/prototype_2016/third_party/qml-material/demo/ButtonDemo.qml
deleted file mode 100644
index df74e45..0000000
--- a/prototype_2016/third_party/qml-material/demo/ButtonDemo.qml
+++ /dev/null
@@ -1,89 +0,0 @@
1import QtQuick 2.4
2import Material 0.2
3import QtQuick.Controls 1.3 as Controls
4
5Item {
6
7 Column {
8 anchors.centerIn: parent
9 spacing: dp(20)
10
11 Button {
12 text: "Simple Button"
13 anchors.horizontalCenter: parent.horizontalCenter
14 onClicked: snackbar.open("Simple, isn't it?")
15 }
16
17 Button {
18 text: "Raised Button"
19 elevation: 1
20 anchors.horizontalCenter: parent.horizontalCenter
21 onClicked: snackbar.open("This is a snackbar")
22 }
23
24 Button {
25 text: "Disabled Raised Button"
26 elevation: 1
27 enabled: false
28 anchors.horizontalCenter: parent.horizontalCenter
29 }
30
31 Button {
32 text: "Wide Button"
33
34 width: dp(200)
35 elevation: 1
36 anchors.horizontalCenter: parent.horizontalCenter
37
38 onClicked: snackbar.open("That button is wide, and so is this snackbar!")
39 }
40
41 Button {
42 id: focusableButton
43 text: "Focusable with really long text"
44 elevation: 1
45 activeFocusOnPress: true
46 anchors.horizontalCenter: parent.horizontalCenter
47
48 onClicked: snackbar.open("The text is really very very very very very long and now it needs to wrap, so this should show as two lines!")
49 }
50
51 Button {
52 text: "Colored button"
53 textColor: Theme.accentColor
54 anchors.horizontalCenter: parent.horizontalCenter
55
56 onClicked: snackbar.open("That button is colored!")
57 }
58
59 Button {
60 text: "Focusable button #2"
61 elevation: 1
62 activeFocusOnPress: true
63 backgroundColor: Theme.primaryColor
64 anchors.horizontalCenter: parent.horizontalCenter
65
66 onClicked: snackbar.open("That button is colored!")
67 }
68 }
69
70 ActionButton {
71 anchors {
72 right: parent.right
73 bottom: snackbar.top
74 margins: dp(32)
75 }
76
77 action: Action {
78 id: addContent
79 text: "&Copy"
80 shortcut: "Ctrl+C"
81 onTriggered: snackbar.open("We do actions too!")
82 }
83 iconName: "content/add"
84 }
85
86 Snackbar {
87 id: snackbar
88 }
89}
diff --git a/prototype_2016/third_party/qml-material/demo/CheckBoxDemo.qml b/prototype_2016/third_party/qml-material/demo/CheckBoxDemo.qml
deleted file mode 100644
index 27f626e..0000000
--- a/prototype_2016/third_party/qml-material/demo/CheckBoxDemo.qml
+++ /dev/null
@@ -1,74 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4
5ColumnLayout {
6 spacing: 0
7
8 Repeater {
9 model: 2
10
11 Rectangle {
12 Layout.fillHeight: true
13 Layout.fillWidth: true
14 Layout.minimumHeight: grid.height + dp(80)
15 Layout.minimumWidth: grid.width + dp(80)
16 color: index == 0 ? "#EEE" : "#333"
17
18 GridLayout {
19 id: grid
20 anchors.centerIn: parent
21 columns: 3
22
23 // Empty filler
24 Item { width: 1; height: 1 }
25
26 Label {
27 Layout.alignment : Qt.AlignHCenter
28 text: "Normal"
29 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
30 }
31
32 Label {
33 Layout.alignment : Qt.AlignHCenter
34 text: "Disabled"
35 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
36 }
37
38 Label {
39 text: "On"
40 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
41 }
42
43 CheckBox {
44 checked: true
45 text: "On"
46 darkBackground: index == 1
47 }
48
49 CheckBox {
50 checked: true
51 enabled: false
52 text: "Disabled"
53 darkBackground: index == 1
54 }
55
56 Label {
57 text: "Off"
58 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
59 }
60
61 CheckBox {
62 text: "Off"
63 darkBackground: index == 1
64 }
65
66 CheckBox {
67 text: "Disabled"
68 enabled: false
69 darkBackground: index == 1
70 }
71 }
72 }
73 }
74}
diff --git a/prototype_2016/third_party/qml-material/demo/ColorPaletteDemo.qml b/prototype_2016/third_party/qml-material/demo/ColorPaletteDemo.qml
deleted file mode 100644
index 0f8a748..0000000
--- a/prototype_2016/third_party/qml-material/demo/ColorPaletteDemo.qml
+++ /dev/null
@@ -1,159 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2015 Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import QtQuick.Layouts 1.1
21import Material 0.2
22
23Item {
24 implicitHeight: palette.height
25
26 GridLayout {
27 id: palette
28 anchors.centerIn: parent
29 width: parent.width
30 columns: parseInt(parent.width / dp(300)) || 1
31 rowSpacing: dp(20)
32
33 Repeater {
34 model: [ "Red", "Pink", "Purple", "Deep Purple", "Indigo",
35 "Blue", "Light Blue", "Cyan", "Teal", "Green",
36 "Light Green", "Lime", "Yellow", "Amber", "Orange",
37 "Deep Orange", "Grey", "Blue Grey", "Brown" ]
38
39 ColumnLayout {
40 Layout.alignment: Qt.AlignCenter
41 spacing: dp(5)
42 property var currentColor: modelData.charAt(0).toLowerCase() +
43 modelData.slice(1).replace(" ", "")
44
45 Rectangle {
46 width: dp(300)
47 height: dp(126)
48 color: Palette.colors[currentColor]["500"]
49
50 Label {
51 anchors.top: parent.top
52 anchors.left: parent.left
53 anchors.margins: dp(16)
54 text: modelData
55 style: "body2"
56 color: Theme.lightDark(parent.color,
57 Theme.light.textColor,
58 Theme.dark.textColor)
59 }
60
61 Label {
62 anchors.left: parent.left
63 anchors.bottom: parent.bottom
64 anchors.margins: dp(16)
65 text: "500"
66 style: "body2"
67 color: Theme.lightDark(parent.color,
68 Theme.light.textColor,
69 Theme.dark.textColor)
70 }
71
72 Label {
73 anchors.right: parent.right
74 anchors.bottom: parent.bottom
75 anchors.margins: dp(16)
76 text: Palette.colors[currentColor]["500"]
77 style: "body2"
78 color: Theme.lightDark(parent.color,
79 Theme.light.textColor,
80 Theme.dark.textColor)
81 }
82 }
83
84 ColumnLayout {
85 spacing: 0
86
87 Repeater {
88 model: ["100", "200", "300", "400", "600", "700", "800", "900"]
89
90 Rectangle {
91 width: dp(300)
92 height: dp(46)
93 color: Palette.colors[currentColor][modelData]
94
95 Label {
96 anchors.left: parent.left
97 anchors.margins: dp(16)
98 anchors.verticalCenter: parent.verticalCenter
99 text: modelData
100 style: "body2"
101 color: Theme.lightDark(parent.color,
102 Theme.light.textColor,
103 Theme.dark.textColor)
104 }
105
106 Label {
107 anchors.right: parent.right
108 anchors.margins: dp(16)
109 anchors.verticalCenter: parent.verticalCenter
110 text: Palette.colors[currentColor][modelData]
111 style: "body2"
112 color: Theme.lightDark(parent.color,
113 Theme.light.textColor,
114 Theme.dark.textColor)
115 }
116 }
117 }
118 }
119
120 ColumnLayout {
121 spacing: 0
122 visible: typeof Palette.colors[currentColor]["A100"] != 'undefined'
123
124 Repeater {
125 model: visible ? ["A100", "A200", "A400", "A700"] : 0
126
127 Rectangle {
128 width: dp(300)
129 height: dp(46)
130 color: Palette.colors[currentColor][modelData]
131
132 Label {
133 anchors.left: parent.left
134 anchors.margins: dp(16)
135 anchors.verticalCenter: parent.verticalCenter
136 text: modelData
137 style: "body2"
138 color: Theme.lightDark(parent.color,
139 Theme.light.textColor,
140 Theme.dark.textColor)
141 }
142
143 Label {
144 anchors.right: parent.right
145 anchors.margins: dp(16)
146 anchors.verticalCenter: parent.verticalCenter
147 text: Palette.colors[currentColor][modelData]
148 style: "body2"
149 color: Theme.lightDark(parent.color,
150 Theme.light.textColor,
151 Theme.dark.textColor)
152 }
153 }
154 }
155 }
156 }
157 }
158 }
159}
diff --git a/prototype_2016/third_party/qml-material/demo/CustomIconsDemo.qml b/prototype_2016/third_party/qml-material/demo/CustomIconsDemo.qml
deleted file mode 100644
index 06355d9..0000000
--- a/prototype_2016/third_party/qml-material/demo/CustomIconsDemo.qml
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2015 Michael Spencer <sonrisesoftware@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18import QtQuick 2.4
19import Material 0.2
20import Material.ListItems 0.1 as ListItem
21
22Column {
23 id: column
24
25 anchors.fill: parent
26
27 ListItem.Subheader {
28 text: "Custom icons with different colors"
29 }
30
31 Row {
32 Item {
33 width: dp(56)
34 height: dp(56)
35
36 Icon {
37 anchors.centerIn: parent
38 source: Qt.resolvedUrl("images/weather-sunset.svg")
39 color: Theme.light.iconColor
40 }
41 }
42
43 Item {
44 width: dp(56)
45 height: dp(56)
46
47 Icon {
48 anchors.centerIn: parent
49 source: Qt.resolvedUrl("images/weather-pouring.svg")
50 color: Theme.light.iconColor
51 }
52 }
53
54 Rectangle {
55 width: dp(56)
56 height: dp(56)
57 color: "#333"
58 Icon {
59 anchors.centerIn: parent
60 source: Qt.resolvedUrl("images/weather-sunset.svg")
61 color: Theme.dark.iconColor
62 }
63 }
64
65 Rectangle {
66 width: dp(56)
67 height: dp(56)
68 color: "#333"
69 Icon {
70 anchors.centerIn: parent
71 source: Qt.resolvedUrl("images/weather-pouring.svg")
72 color: Theme.dark.iconColor
73 }
74 }
75 }
76
77 ListItem.Subheader {
78 text: "Non-colorized custom icons"
79 }
80
81 Row {
82 Item {
83 width: dp(56)
84 height: dp(40)
85
86 Icon {
87 anchors.centerIn: parent
88 source: Qt.resolvedUrl("images/go-last.color.svg")
89 color: Theme.light.iconColor
90 }
91 }
92
93 Item {
94 width: dp(56)
95 height: dp(40)
96
97 Icon {
98 anchors.centerIn: parent
99 source: Qt.resolvedUrl("images/list-add.color.svg")
100 color: Theme.light.iconColor
101 }
102 }
103 }
104
105 ListItem.Subheader {
106 text: "Custom icons in IconButtons"
107 }
108
109 Row {
110 Item {
111 width: dp(56)
112 height: dp(40)
113
114 IconButton {
115 anchors.centerIn: parent
116 iconSource: Qt.resolvedUrl("images/weather-sunset.svg")
117 color: Theme.light.iconColor
118 }
119 }
120
121 Item {
122 width: dp(56)
123 height: dp(40)
124
125 IconButton {
126 anchors.centerIn: parent
127 iconSource: Qt.resolvedUrl("images/list-add.color.svg")
128 color: Theme.light.iconColor
129 }
130 }
131 }
132}
diff --git a/prototype_2016/third_party/qml-material/demo/DatePickerDemo.qml b/prototype_2016/third_party/qml-material/demo/DatePickerDemo.qml
deleted file mode 100644
index 20509be..0000000
--- a/prototype_2016/third_party/qml-material/demo/DatePickerDemo.qml
+++ /dev/null
@@ -1,67 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4import Material.ListItems 0.1 as ListItem
5import Material.Extras 0.1
6
7ColumnLayout {
8
9 Dialog {
10 id: datePickerDialog
11 hasActions: true
12 contentMargins: 0
13 floatingActions: true
14
15 DatePicker {
16 frameVisible: false
17 dayAreaBottomMargin : dp(48)
18 }
19
20 }
21
22 Dialog {
23 id: landscapeDatePickerDialog
24 hasActions: true
25 contentMargins: 0
26 floatingActions: true
27
28 DatePicker {
29 frameVisible: false
30 dayAreaBottomMargin : dp(48)
31 isLandscape: true
32 }
33
34 }
35
36 ColumnLayout {
37 anchors.centerIn: parent
38 spacing: dp(16)
39
40 Button {
41 Layout.alignment: Qt.AlignCenter
42 text: "Show DatePicker Dialog"
43 elevation: 1
44 onClicked: {
45 datePickerDialog.show()
46 }
47 }
48
49 Button {
50 Layout.alignment: Qt.AlignCenter
51 text: "Show Landscape DatePicker Dialog"
52 elevation: 1
53 onClicked: {
54 landscapeDatePickerDialog.show()
55 }
56 }
57
58 DatePicker {
59 Layout.alignment: Qt.AlignCenter
60 }
61
62 DatePicker {
63 Layout.alignment: Qt.AlignCenter
64 isLandscape: true
65 }
66 }
67}
diff --git a/prototype_2016/third_party/qml-material/demo/DialogDemo.qml b/prototype_2016/third_party/qml-material/demo/DialogDemo.qml
deleted file mode 100644
index 7c909d4..0000000
--- a/prototype_2016/third_party/qml-material/demo/DialogDemo.qml
+++ /dev/null
@@ -1,134 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Controls 1.3 as QuickControls
3import Material 0.2
4import Material.Extras 0.1
5
6Item {
7
8 Dialog {
9 id: alertNoTitleBar
10 width: dp(300)
11 text: "Discard draft?"
12 hasActions: true
13 positiveButtonText: "discard"
14 negativeButtonText: "cancel"
15 }
16
17 Dialog {
18 id: alertWithTitleBar
19 width: dp(300)
20 title: "Use Google's location service?"
21 text: "Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running."
22 hasActions: true
23 positiveButtonText: "agree"
24 negativeButtonText: "disagree"
25 }
26
27 Dialog {
28 id: textFieldDialog
29 title: "Change Text"
30 hasActions: true
31
32 TextField {
33 id: optionText
34 width: parent.width
35 placeholderText: "New Option to Confirm"
36 }
37
38 onAccepted: {
39 dialogSnackBar.open("You entered: %1".arg(optionText.text))
40 }
41 }
42
43 Dialog {
44 id: scrollingDialog
45 title: "Phone ringtone"
46
47 QuickControls.ExclusiveGroup {
48 id: optionGroup
49 }
50
51 RadioButton {
52 text: "None"
53 checked: true
54 exclusiveGroup: optionGroup
55 }
56 RadioButton {
57 text: "Callisto"
58 exclusiveGroup: optionGroup
59 }
60 RadioButton {
61 text: "Dione"
62 exclusiveGroup: optionGroup
63 }
64 RadioButton {
65 text: "Ganymede"
66 exclusiveGroup: optionGroup
67 }
68 RadioButton {
69 text: "Hangouts Call"
70 exclusiveGroup: optionGroup
71 }
72 RadioButton {
73 text: "Luna"
74 exclusiveGroup: optionGroup
75 }
76 RadioButton {
77 text: "Oberon"
78 exclusiveGroup: optionGroup
79 }
80 RadioButton {
81 text: "Phobos"
82 exclusiveGroup: optionGroup
83 }
84 RadioButton {
85 text: "Pyxis"
86 exclusiveGroup: optionGroup
87 }
88 }
89
90 Column {
91 anchors.centerIn: parent
92 spacing: dp(20)
93
94 Button {
95 text: "Show alert without title bar"
96 anchors.horizontalCenter: parent.horizontalCenter
97 elevation: 1
98 onClicked: {
99 alertNoTitleBar.show()
100 }
101 }
102
103 Button {
104 text: "Show alert with title bar"
105 anchors.horizontalCenter: parent.horizontalCenter
106 elevation: 1
107 onClicked: {
108 alertWithTitleBar.show()
109 }
110 }
111
112 Button {
113 text: "Show text field dialog"
114 anchors.horizontalCenter: parent.horizontalCenter
115 elevation: 1
116 onClicked: {
117 textFieldDialog.show()
118 }
119 }
120
121 Button {
122 text: "Show scrolling dialog"
123 anchors.horizontalCenter: parent.horizontalCenter
124 elevation: 1
125 onClicked: {
126 scrollingDialog.show()
127 }
128 }
129 }
130
131 Snackbar {
132 id: dialogSnackBar
133 }
134}
diff --git a/prototype_2016/third_party/qml-material/demo/FormsDemo.qml b/prototype_2016/third_party/qml-material/demo/FormsDemo.qml
deleted file mode 100644
index 4a764c8..0000000
--- a/prototype_2016/third_party/qml-material/demo/FormsDemo.qml
+++ /dev/null
@@ -1,142 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4import Material.ListItems 0.1 as ListItem
5import Material.Extras 0.1
6
7Item {
8 View {
9 anchors.centerIn: parent
10
11 width: dp(350)
12 height: column.implicitHeight + dp(32)
13
14 elevation: 1
15 radius: dp(2)
16
17 ColumnLayout {
18 id: column
19
20 anchors {
21 fill: parent
22 topMargin: dp(16)
23 bottomMargin: dp(16)
24 }
25
26 Label {
27 id: titleLabel
28
29 anchors {
30 left: parent.left
31 right: parent.right
32 margins: dp(16)
33 }
34
35 style: "title"
36 text: "Edit shipping info"
37 }
38
39 Item {
40 Layout.fillWidth: true
41 Layout.preferredHeight: dp(8)
42 }
43
44 ListItem.Standard {
45 action: Icon {
46 anchors.centerIn: parent
47 name: "action/account_circle"
48 }
49
50 content: TextField {
51 anchors.centerIn: parent
52 width: parent.width
53
54 text: "Alex Nelson"
55 }
56 }
57
58 ListItem.Standard {
59 action: Icon {
60 anchors.centerIn: parent
61 name: "maps/place"
62 }
63
64 content: TextField {
65 anchors.centerIn: parent
66 width: parent.width
67
68 text: "100 Main Street"
69 }
70 }
71
72 ListItem.Standard {
73 action: Item {}
74
75 content: RowLayout {
76 anchors.centerIn: parent
77 width: parent.width
78
79 TextField {
80 Layout.alignment: Qt.AlignVCenter
81 Layout.preferredWidth: 0.4 * parent.width
82
83 text: "New York"
84 }
85
86 MenuField {
87 Layout.alignment: Qt.AlignVCenter
88 Layout.preferredWidth: 0.2 * parent.width
89
90 model: ["NY", "NC", "ND"]
91 }
92
93 TextField {
94 Layout.alignment: Qt.AlignVCenter
95 Layout.preferredWidth: 0.3 * parent.width
96
97 text: "10011"
98 }
99 }
100 }
101
102 ListItem.Standard {
103 action: Icon {
104 anchors.centerIn: parent
105 name: "communication/email"
106 }
107
108 content: TextField {
109 anchors.centerIn: parent
110 width: parent.width
111
112 placeholderText: "Email"
113 }
114 }
115
116 Item {
117 Layout.fillWidth: true
118 Layout.preferredHeight: dp(8)
119 }
120
121 RowLayout {
122 Layout.alignment: Qt.AlignRight
123 spacing: dp(8)
124
125 anchors {
126 right: parent.right
127 margins: dp(16)
128 }
129
130 Button {
131 text: "Cancel"
132 textColor: Theme.primaryColor
133 }
134
135 Button {
136 text: "Done"
137 textColor: Theme.primaryColor
138 }
139 }
140 }
141 }
142}
diff --git a/prototype_2016/third_party/qml-material/demo/ListItemsDemo.qml b/prototype_2016/third_party/qml-material/demo/ListItemsDemo.qml
deleted file mode 100644
index 7061b40..0000000
--- a/prototype_2016/third_party/qml-material/demo/ListItemsDemo.qml
+++ /dev/null
@@ -1,62 +0,0 @@
1import QtQuick 2.4
2import Material 0.2
3import Material.ListItems 0.1 as ListItem
4import Material.Extras 0.1
5
6Item {
7 View {
8 anchors {
9 fill: parent
10 margins: dp(32)
11 }
12
13 elevation: 1
14
15 Column {
16 anchors.fill: parent
17
18 ListItem.Subheader {
19 text: "Section Subheader"
20 }
21
22 ListItem.Standard {
23 text: "Standard list item"
24 }
25
26 ListItem.Subtitled {
27 text: "Subtitled list item"
28 subText: "With some subtext!"
29 }
30
31 ListItem.Subtitled {
32 text: "Subtitled list item"
33 subText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec eleifend arcu, eu convallis nisi."
34 valueText: "2h ago"
35
36 maximumLineCount: 3
37 }
38
39 ListItem.Subtitled {
40 text: "Subtitled list item"
41 subText: "With some subtext, icon, and secondary item!"
42 secondaryItem: Switch {
43 id: enablingSwitch
44 anchors.verticalCenter: parent.verticalCenter
45 }
46
47 onClicked: enablingSwitch.checked = !enablingSwitch.checked
48
49 action: Icon {
50 anchors.centerIn: parent
51 name: "device/access_alarm"
52 size: dp(32)
53 }
54 }
55
56 ListItem.SimpleMenu {
57 text: "Subtitled list item"
58 model: ["A", "B and some long text that should not clip", "C"]
59 }
60 }
61 }
62}
diff --git a/prototype_2016/third_party/qml-material/demo/PageStackDemo.qml b/prototype_2016/third_party/qml-material/demo/PageStackDemo.qml
deleted file mode 100644
index cc5f446..0000000
--- a/prototype_2016/third_party/qml-material/demo/PageStackDemo.qml
+++ /dev/null
@@ -1,91 +0,0 @@
1import QtQuick 2.4
2import Material 0.2
3import Material.Extras 0.1
4
5Item {
6
7 Column {
8 anchors.centerIn: parent
9 spacing: dp(20)
10
11 Button {
12 anchors.horizontalCenter: parent.horizontalCenter
13
14 text: "Push subpage"
15 elevation: 1
16 onClicked: pageStack.push(Qt.resolvedUrl("SubPage.qml"))
17 }
18
19 Button {
20 anchors.horizontalCenter: parent.horizontalCenter
21
22 text: "Push subpage with sidebar"
23 elevation: 1
24 onClicked: pageStack.push(Qt.resolvedUrl("SidebarPage.qml"))
25 }
26
27 Image {
28 id: image
29
30 anchors.horizontalCenter: parent.horizontalCenter
31
32 source: Qt.resolvedUrl("images/balloon.jpg")
33 width: dp(400)
34 height: dp(250)
35
36 Ink {
37 anchors.fill: parent
38
39 onClicked: overlayView.open(image)
40 }
41 }
42
43 Label {
44 anchors.horizontalCenter: parent.horizontalCenter
45
46 style: "subheading"
47 color: Theme.light.subTextColor
48 text: "Tap to edit picture"
49 font.italic: true
50 }
51 }
52
53 OverlayView {
54 id: overlayView
55
56 width: dp(800)
57 height: dp(500)
58
59 Image {
60 id: contentImage
61 source: Qt.resolvedUrl("images/balloon.jpg")
62 anchors.fill: parent
63 }
64
65 Row {
66 anchors {
67 top: parent.top
68 right: parent.right
69 rightMargin: dp(16)
70 }
71 height: dp(48)
72 opacity: overlayView.transitionOpacity
73
74 spacing: dp(24)
75
76 Repeater {
77 model: ["content/add", "image/edit", "action/delete"]
78
79 delegate: IconButton {
80 id: iconAction
81
82 iconName: modelData
83
84 color: Theme.dark.iconColor
85 size: iconName == "content/add" ? dp(27) : dp(24)
86 anchors.verticalCenter: parent.verticalCenter
87 }
88 }
89 }
90 }
91}
diff --git a/prototype_2016/third_party/qml-material/demo/ProgressBarDemo.qml b/prototype_2016/third_party/qml-material/demo/ProgressBarDemo.qml
deleted file mode 100644
index 6c03054..0000000
--- a/prototype_2016/third_party/qml-material/demo/ProgressBarDemo.qml
+++ /dev/null
@@ -1,165 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4
5Item {
6 implicitHeight: grid.implicitHeight + dp(40)
7 GridLayout {
8 id: grid
9 anchors.centerIn: parent
10 columns: 2
11 columnSpacing: dp(20)
12 rowSpacing: dp(20)
13
14 Label {
15 text: "Determinate"
16 }
17
18 ProgressBar {
19 Layout.fillWidth: true
20 color: theme.accentColor
21
22 SequentialAnimation on value {
23 running: true
24 loops: NumberAnimation.Infinite
25
26 NumberAnimation {
27 duration: 3000
28 from: 0
29 to: 1
30 }
31
32 PauseAnimation { duration: 1000 } // This puts a bit of time between the loop
33 }
34 }
35
36 Label {
37 text: "Indeterminate"
38 }
39
40 ProgressBar {
41 Layout.fillWidth: true
42 color: theme.accentColor
43 indeterminate: true
44 }
45
46 Label {
47 text: "Default"
48 }
49
50 ProgressCircle {
51 Layout.alignment: Qt.AlignCenter
52 }
53
54 Label {
55 text: "Custom Color"
56 }
57
58 ProgressCircle {
59 Layout.alignment: Qt.AlignCenter
60 color: "#E91E63"
61 }
62
63 Label {
64 text: "Cyclic Colors"
65 }
66
67 ProgressCircle {
68 id: cyclicColorProgress
69 Layout.alignment: Qt.AlignCenter
70 SequentialAnimation {
71 running: true
72 loops: Animation.Infinite
73
74 ColorAnimation {
75 from: "red"
76 to: "blue"
77 target: cyclicColorProgress
78 properties: "color"
79 easing.type: Easing.InOutQuad
80 duration: 2400
81 }
82
83 ColorAnimation {
84 from: "blue"
85 to: "green"
86 target: cyclicColorProgress
87 properties: "color"
88 easing.type: Easing.InOutQuad
89 duration: 1560
90 }
91
92 ColorAnimation {
93 from: "green"
94 to: "#FFCC00"
95 target: cyclicColorProgress
96 properties: "color"
97 easing.type: Easing.InOutQuad
98 duration: 840
99 }
100
101 ColorAnimation {
102 from: "#FFCC00"
103 to: "red"
104 target: cyclicColorProgress
105 properties: "color"
106 easing.type: Easing.InOutQuad
107 duration: 1200
108 }
109 }
110 }
111
112 Label {
113 text: "Custom Size"
114 }
115
116 ProgressCircle {
117 Layout.alignment: Qt.AlignCenter
118 width: dp(64)
119 height: dp(64)
120 }
121
122 Label {
123 text: "Custom Size + Thickness"
124 }
125
126 ProgressCircle {
127 Layout.alignment: Qt.AlignCenter
128 width: dp(64)
129 height: dp(64)
130 dashThickness: dp(8)
131 }
132
133 Label {
134 text: "Determinate Value"
135 }
136
137 ProgressCircle {
138 id: determinateProgress
139 Layout.alignment: Qt.AlignCenter
140 width: dp(64)
141 height: dp(64)
142 indeterminate: false
143 minimumValue: 0
144 maximumValue: 100
145
146 SequentialAnimation on value {
147 running: true
148 loops: NumberAnimation.Infinite
149
150 NumberAnimation {
151 duration: 3000
152 from: determinateProgress.minimumValue
153 to: determinateProgress.maximumValue
154 }
155
156 PauseAnimation { duration: 1000 }
157 }
158
159 Label {
160 anchors.centerIn: parent
161 text: Math.round(determinateProgress.value) + "%"
162 }
163 }
164 }
165}
diff --git a/prototype_2016/third_party/qml-material/demo/RadioButtonDemo.qml b/prototype_2016/third_party/qml-material/demo/RadioButtonDemo.qml
deleted file mode 100644
index de08ac1..0000000
--- a/prototype_2016/third_party/qml-material/demo/RadioButtonDemo.qml
+++ /dev/null
@@ -1,70 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import QtQuick.Controls 1.3 as QuickControls
4import Material 0.2
5
6ColumnLayout {
7 spacing: 0
8
9 Repeater {
10 model: 2
11
12 Rectangle {
13 Layout.fillHeight: true
14 Layout.fillWidth: true
15 Layout.minimumHeight: grid.height + dp(80)
16 Layout.minimumWidth: grid.width + dp(80)
17 color: index == 0 ? "#EEE" : "#333"
18
19 GridLayout {
20 id: grid
21 anchors.centerIn: parent
22 rowSpacing: dp(20)
23 columnSpacing: dp(20)
24 columns: 2
25
26 QuickControls.ExclusiveGroup { id: optionGroup }
27
28 Label {
29 Layout.alignment : Qt.AlignHCenter
30 text: "Normal"
31 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
32 }
33
34 Label {
35 Layout.alignment : Qt.AlignHCenter
36 text: "Disabled"
37 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
38 }
39
40 RadioButton {
41 checked: true
42 text: "Option 1"
43 darkBackground: index == 1
44 canToggle: true
45 exclusiveGroup: optionGroup
46 }
47
48 RadioButton {
49 checked: true
50 enabled: false
51 text: "Disabled"
52 darkBackground: index == 1
53 }
54
55 RadioButton {
56 text: "Option 2"
57 darkBackground: index == 1
58 canToggle: true
59 exclusiveGroup: optionGroup
60 }
61
62 RadioButton {
63 enabled: false
64 text: "Disabled"
65 darkBackground: index == 1
66 }
67 }
68 }
69 }
70}
diff --git a/prototype_2016/third_party/qml-material/demo/SidebarPage.qml b/prototype_2016/third_party/qml-material/demo/SidebarPage.qml
deleted file mode 100644
index 9c94135..0000000
--- a/prototype_2016/third_party/qml-material/demo/SidebarPage.qml
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2015 Michael Spencer <sonrisesoftware@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18import QtQuick 2.4
19import Material 0.2
20import Material.ListItems 0.1 as ListItem
21
22Page {
23 id: page
24 title: "Page with right sidebar"
25
26 actions: [
27 Action {
28 iconName: "action/search"
29 text: "Search"
30 }
31 ]
32
33 Button {
34 anchors.centerIn: parent
35 text: "Sub page"
36 onClicked: pageStack.push(Qt.resolvedUrl("SubPage.qml"))
37 }
38
39 rightSidebar: PageSidebar {
40 title: "Sidebar"
41
42 width: dp(320)
43
44 actions: [
45 Action {
46 iconName: "action/delete"
47 text: "Delete"
48 }
49 ]
50 }
51}
diff --git a/prototype_2016/third_party/qml-material/demo/SliderDemo.qml b/prototype_2016/third_party/qml-material/demo/SliderDemo.qml
deleted file mode 100644
index 88a2abb..0000000
--- a/prototype_2016/third_party/qml-material/demo/SliderDemo.qml
+++ /dev/null
@@ -1,120 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4
5ColumnLayout {
6 spacing: 0
7
8 Repeater {
9 model: 2
10
11 Rectangle {
12 Layout.fillHeight: true
13 Layout.fillWidth: true
14 Layout.minimumHeight: grid.height + dp(80)
15 Layout.minimumWidth: grid.width + dp(80)
16 color: index == 0 ? "#EEE" : "#333"
17
18 GridLayout {
19 id: grid
20 anchors.centerIn: parent
21 rowSpacing: dp(20)
22 columnSpacing: dp(10)
23 columns: 2
24
25 Label {
26 text: "Normal"
27 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
28 }
29
30 Slider {
31 Layout.alignment: Qt.AlignCenter
32 value: 0.2
33 darkBackground: index == 1
34 }
35
36 Label {
37 text: "Tickmarks"
38 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
39 }
40
41 Slider {
42 Layout.alignment: Qt.AlignCenter
43 value: 40
44 tickmarksEnabled: true
45 stepSize: 20
46 minimumValue: 0
47 maximumValue: 100
48 darkBackground: index == 1
49 }
50
51 Label {
52 text: "Numeric Value Label"
53 Layout.alignment: Qt.AlignBottom
54 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
55 }
56
57 Slider {
58 Layout.alignment: Qt.AlignCenter
59 value: 60
60 tickmarksEnabled: true
61 numericValueLabel: true
62 stepSize: 20
63 minimumValue: 0
64 maximumValue: 100
65 darkBackground: index == 1
66 }
67
68 Label {
69 text: "Numeric Value Label + Active Focus on Press"
70 wrapMode: Text.WordWrap
71 Layout.alignment: Qt.AlignBottom
72 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
73 }
74
75 Slider {
76 Layout.alignment: Qt.AlignCenter
77 value: 80
78 focus: true
79 tickmarksEnabled: true
80 numericValueLabel: true
81 stepSize: 20
82 minimumValue: 0
83 maximumValue: 100
84 activeFocusOnPress: true
85 darkBackground: index == 1
86 }
87
88 Label {
89 text: "Customized Numeric Value Label"
90 wrapMode: Text.WordWrap
91 Layout.alignment: Qt.AlignBottom
92 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
93 }
94
95 Slider {
96 Layout.alignment: Qt.AlignCenter
97 numericValueLabel: true
98 stepSize: 1
99 minimumValue: 0
100 maximumValue: 100
101 alwaysShowValueLabel: true
102 knobLabel: value + "%"
103 knobDiameter: dp(42)
104 darkBackground: index == 1
105 }
106
107 Label {
108 text: "Disabled"
109 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
110 }
111
112 Slider {
113 enabled: false
114 Layout.alignment: Qt.AlignCenter
115 darkBackground: index == 1
116 }
117 }
118 }
119 }
120}
diff --git a/prototype_2016/third_party/qml-material/demo/SubPage.qml b/prototype_2016/third_party/qml-material/demo/SubPage.qml
deleted file mode 100644
index 0f43d4f..0000000
--- a/prototype_2016/third_party/qml-material/demo/SubPage.qml
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2015 Michael Spencer <sonrisesoftware@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18import QtQuick 2.4
19import Material 0.2
20import Material.ListItems 0.1 as ListItem
21
22TabbedPage {
23 id: page
24 title: "Page Title that is very long to demonstrate eliding titles in ActionBar"
25
26 actionBar.backgroundColor: Palette.colors.grey['200']
27 actionBar.decorationColor: Palette.colors.grey['300']
28
29 onGoBack: {
30 confirmationDialog.show()
31 event.accepted = true
32 }
33
34 Tab {
35 title: "Overview"
36 iconName: "action/home"
37
38 Rectangle {
39 color: Palette.colors.red["200"]
40
41 Button {
42 anchors.centerIn: parent
43 darkBackground: true
44 text: "Go to tab 3"
45 onClicked: page.selectedTab = 2
46 }
47 }
48 }
49
50 Tab {
51 title: "Projects"
52
53 Rectangle { color: Palette.colors.purple["200"] }
54 }
55
56 Tab {
57 title: "Inbox"
58
59 Rectangle { color: Palette.colors.orange["200"] }
60 }
61
62 Tab {
63 title: "Disabled Tab"
64 enabled: false
65 Rectangle { color: Palette.colors.purple["200"] }
66 }
67
68 Dialog {
69 id: confirmationDialog
70
71 title: "Do you want to go back?"
72 positiveButtonText: "Go Back"
73 negativeButtonText: "Cancel"
74
75 onAccepted: page.forcePop()
76 }
77}
diff --git a/prototype_2016/third_party/qml-material/demo/SwitchDemo.qml b/prototype_2016/third_party/qml-material/demo/SwitchDemo.qml
deleted file mode 100644
index fb7cc21..0000000
--- a/prototype_2016/third_party/qml-material/demo/SwitchDemo.qml
+++ /dev/null
@@ -1,70 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4
5ColumnLayout {
6 spacing: 0
7
8 Repeater {
9 model: 2
10
11 Rectangle {
12 Layout.fillHeight: true
13 Layout.fillWidth: true
14 Layout.minimumHeight: grid.height + dp(80)
15 Layout.minimumWidth: grid.width + dp(80)
16 color: index == 0 ? "#EEE" : "#333"
17
18 GridLayout {
19 id: grid
20 anchors.centerIn: parent
21 rowSpacing: dp(40)
22 columnSpacing: dp(40)
23 columns: 3
24
25 // Empty filler
26 Item { width: 1; height: 1 }
27
28 Label {
29 text: "Normal"
30 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
31 }
32
33 Label {
34 text: "Disabled"
35 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
36 }
37
38 Label {
39 text: "On"
40 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
41 }
42
43 Switch {
44 checked: true
45 darkBackground: index == 1
46 }
47
48 Switch {
49 checked: true
50 enabled: false
51 darkBackground: index == 1
52 }
53
54 Label {
55 text: "Off"
56 color: index == 0 ? Theme.light.textColor : Theme.dark.textColor
57 }
58
59 Switch {
60 darkBackground: index == 1
61 }
62
63 Switch {
64 enabled: false
65 darkBackground: index == 1
66 }
67 }
68 }
69 }
70}
diff --git a/prototype_2016/third_party/qml-material/demo/TextFieldDemo.qml b/prototype_2016/third_party/qml-material/demo/TextFieldDemo.qml
deleted file mode 100644
index d0dad27..0000000
--- a/prototype_2016/third_party/qml-material/demo/TextFieldDemo.qml
+++ /dev/null
@@ -1,54 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4
5Item {
6 implicitHeight: column.height
7
8 ColumnLayout {
9 id: column
10 anchors.centerIn: parent
11 spacing: dp(32)
12
13 TextField {
14 text: "Big Field with text"
15 font.pixelSize: dp(32)
16 anchors.horizontalCenter: parent.horizontalCenter
17 }
18
19 TextField {
20 placeholderText: "Search..."
21 anchors.horizontalCenter: parent.horizontalCenter
22 }
23
24 TextField {
25 text: "Text under label"
26 placeholderText: "Floating label"
27 floatingLabel: true
28 anchors.horizontalCenter: parent.horizontalCenter
29 }
30
31 TextField {
32 placeholderText: "Character limit"
33 floatingLabel: true
34 characterLimit: 10
35 anchors.horizontalCenter: parent.horizontalCenter
36 }
37
38 TextField {
39 id: passwordField
40 placeholderText: "Password"
41 floatingLabel: true
42 echoMode: TextInput.Password
43 helperText: "Hint: It's not password."
44 anchors.horizontalCenter: parent.horizontalCenter
45
46 onAccepted: {
47 if (passwordField.text === "password") {
48 passwordField.helperText = "Told ya."
49 passwordField.hasError = true
50 }
51 }
52 }
53 }
54}
diff --git a/prototype_2016/third_party/qml-material/demo/TimePickerDemo.qml b/prototype_2016/third_party/qml-material/demo/TimePickerDemo.qml
deleted file mode 100644
index 743944f..0000000
--- a/prototype_2016/third_party/qml-material/demo/TimePickerDemo.qml
+++ /dev/null
@@ -1,58 +0,0 @@
1import QtQuick 2.4
2import Material 0.2
3
4
5Item {
6
7 TimePickerDialog {
8 id: timePicker
9 onTimePicked: {
10 updateLabelForDate(timePicked)
11 }
12 prefer24Hour: twentyFourHourSwitch.checked
13 }
14
15 Column {
16 anchors.centerIn: parent
17 spacing: dp(20)
18
19 Button {
20 text: "Show Time Picker Dialog"
21 anchors.horizontalCenter: parent.horizontalCenter
22 elevation: 1
23 onClicked: {
24 timePicker.show()
25 }
26 }
27
28 Label {
29 id: timeLabel
30 style: "display1"
31 anchors.horizontalCenter: parent.horizontalCenter
32 }
33
34 Row {
35 anchors.horizontalCenter: parent.horizontalCenter
36 spacing: dp(16)
37
38 Label {
39 text: "24 hour clock:"
40 style: "dialog"
41 }
42
43 Switch {
44 id: twentyFourHourSwitch
45 checked: false
46 }
47 }
48 }
49
50 Component.onCompleted: {
51 var date = new Date(Date.now())
52 updateLabelForDate(new Date(Date.now()))
53 }
54
55 function updateLabelForDate(date) {
56 timeLabel.text = date.toLocaleTimeString(Qt.locale(), "hh:mm ap")
57 }
58}
diff --git a/prototype_2016/third_party/qml-material/demo/TypographyDemo.qml b/prototype_2016/third_party/qml-material/demo/TypographyDemo.qml
deleted file mode 100644
index 8bf5f27..0000000
--- a/prototype_2016/third_party/qml-material/demo/TypographyDemo.qml
+++ /dev/null
@@ -1,121 +0,0 @@
1import QtQuick 2.4
2import QtQuick.Layouts 1.1
3import Material 0.2
4import Material.ListItems 0.1 as ListItem
5
6Item {
7
8 implicitHeight: column.height
9
10 property var styles: [
11 "display4",
12 "display3",
13 "display2",
14 "display1",
15 "headline",
16 "title",
17 "subheading",
18 "body2",
19 "body1",
20 "caption",
21 "button"
22 ]
23
24 ColumnLayout {
25 id: column
26 spacing: dp(16)
27
28 ListItem.Subheader {
29 text: "Font Weights"
30 }
31
32 Label {
33 font.family: "Roboto"
34 font.weight: Font.Light
35 text: "Roboto Light"
36 font.pixelSize: dp(34)
37
38 anchors {
39 left: parent.left
40 margins: dp(16)
41 }
42 }
43
44 Label {
45 font.family: "Roboto"
46 text: "Roboto Regular"
47 font.pixelSize: dp(34)
48
49 anchors {
50 left: parent.left
51 margins: dp(16)
52 }
53 }
54
55 Label {
56 font.family: "Roboto"
57 font.weight: Font.DemiBold
58 text: "Roboto Medium"
59 font.pixelSize: dp(34)
60
61 anchors {
62 left: parent.left
63 margins: dp(16)
64 }
65 }
66
67 Label {
68 font.family: "Roboto"
69 font.weight: Font.Bold
70 text: "Roboto Bold"
71 font.pixelSize: dp(34)
72
73 anchors {
74 left: parent.left
75 margins: dp(16)
76 }
77 }
78
79 ListItem.Subheader {
80 text: "Label Styles"
81 }
82
83 Repeater {
84 model: styles
85 delegate: Row {
86 anchors {
87 left: parent.left
88 margins: dp(16)
89 }
90
91 Label {
92 text: modelData
93 width: dp(100)
94 }
95
96 Label {
97 style: modelData
98 text: {
99 var text = fontInfo["font"].substring(0,1).toUpperCase() + fontInfo["font"].substring(1)
100
101 if (style == "button")
102 text += " (ALL CAPS)"
103
104 text += " " + fontInfo["size"] + "sp"
105
106 if (fontInfo.size_desktop) {
107 text += " (Device), " + fontInfo["font"].substring(0,1).toUpperCase() + fontInfo["font"].substring(1)
108
109 if (style == "button")
110 text += " (ALL CAPS)"
111
112 text += " " + fontInfo["size_desktop"] + "sp (Desktop)"
113 }
114
115 return text
116 }
117 }
118 }
119 }
120 }
121}
diff --git a/prototype_2016/third_party/qml-material/demo/demo.pro b/prototype_2016/third_party/qml-material/demo/demo.pro
deleted file mode 100644
index dae5240..0000000
--- a/prototype_2016/third_party/qml-material/demo/demo.pro
+++ /dev/null
@@ -1,6 +0,0 @@
1TEMPLATE = app
2
3QT += qml quick
4
5SOURCES += main.cpp
6RESOURCES += demo.qrc icons/icons.qrc
diff --git a/prototype_2016/third_party/qml-material/demo/demo.qmlproject b/prototype_2016/third_party/qml-material/demo/demo.qmlproject
deleted file mode 100644
index d55cf9b..0000000
--- a/prototype_2016/third_party/qml-material/demo/demo.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
1/* File generated by Qt Creator */
2
3import QmlProject 1.1
4
5Project {
6 mainFile: "main.qml"
7
8 /* Include .qml, .js, and image files from current directory and subdirectories */
9 QmlFiles {
10 directory: "."
11 }
12 JavaScriptFiles {
13 directory: "."
14 }
15 ImageFiles {
16 directory: "."
17 }
18
19 importPaths: [ "../modules"]
20}
diff --git a/prototype_2016/third_party/qml-material/demo/demo.qrc b/prototype_2016/third_party/qml-material/demo/demo.qrc
deleted file mode 100644
index 47ed947..0000000
--- a/prototype_2016/third_party/qml-material/demo/demo.qrc
+++ /dev/null
@@ -1,48 +0,0 @@
1<!DOCTYPE RCC>
2<RCC version="1.0">
3
4<qresource>
5 <file>BottomSheetDemo.qml</file>
6 <file>ButtonDemo.qml</file>
7 <file>CheckBoxDemo.qml</file>
8 <file>ColorPaletteDemo.qml</file>
9 <file>CustomIconsDemo.qml</file>
10 <file>DatePickerDemo.qml</file>
11 <file>DialogDemo.qml</file>
12 <file>FormsDemo.qml</file>
13 <file>ListItemsDemo.qml</file>
14 <file>PageStackDemo.qml</file>
15 <file>ProgressBarDemo.qml</file>
16 <file>RadioButtonDemo.qml</file>
17 <file>SidebarPage.qml</file>
18 <file>SliderDemo.qml</file>
19 <file>SubPage.qml</file>
20 <file>SwitchDemo.qml</file>
21 <file>TextFieldDemo.qml</file>
22 <file>TimePickerDemo.qml</file>
23 <file>TypographyDemo.qml</file>
24 <file>icons/action_account_circle.svg</file>
25 <file>icons/action_autorenew.svg</file>
26 <file>icons/action_delete.svg</file>
27 <file>icons/action_language.svg</file>
28 <file>icons/action_settings.svg</file>
29 <file>icons/alert_warning.svg</file>
30 <file>icons/communication_email.svg</file>
31 <file>icons/content_add.svg</file>
32 <file>icons/content_create.svg</file>
33 <file>icons/content_forward.svg</file>
34 <file>icons/device_access_alarm.svg</file>
35 <file>icons/file_file_download.svg</file>
36 <file>icons/image_color_lens.svg</file>
37 <file>icons/maps_place.svg</file>
38 <file>icons/navigation_arrow_drop_down.svg</file>
39 <file>icons/social_share.svg</file>
40 <file>images/balloon.jpg</file>
41 <file>images/go-last.color.svg</file>
42 <file>images/list-add.color.svg</file>
43 <file>images/weather-pouring.svg</file>
44 <file>images/weather-sunset.svg</file>
45 <file>main.qml</file>
46</qresource>
47
48</RCC>
diff --git a/prototype_2016/third_party/qml-material/demo/icons.yml b/prototype_2016/third_party/qml-material/demo/icons.yml
deleted file mode 100644
index 85c523c..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons.yml
+++ /dev/null
@@ -1,19 +0,0 @@
1out: icons
2icons:
3 - action/account_circle
4 - action/autorenew
5 - action/delete
6 - action/language
7 - action/settings
8 - alert/warning
9 - communication/email
10 - content/add
11 - content/create
12 - content/forward
13 - device/access_alarm
14 - file/file_download
15 - image/color_lens
16 - image/edit
17 - maps/place
18 - navigation/arrow_drop_down
19 - social/share
diff --git a/prototype_2016/third_party/qml-material/demo/icons/action_account_circle.svg b/prototype_2016/third_party/qml-material/demo/icons/action_account_circle.svg
deleted file mode 100644
index 3cfbe0c..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/action_account_circle.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 6c3.31 0 6 2.69 6 6 0 3.32-2.69 6-6 6s-6-2.68-6-6c0-3.31 2.69-6 6-6zm0 28.4c-5.01 0-9.41-2.56-12-6.44.05-3.97 8.01-6.16 12-6.16s11.94 2.19 12 6.16c-2.59 3.88-6.99 6.44-12 6.44z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/action_autorenew.svg b/prototype_2016/third_party/qml-material/demo/icons/action_autorenew.svg
deleted file mode 100644
index 27b0d39..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/action_autorenew.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 12v6l8-8-8-8v6C15.16 8 8 15.16 8 24c0 3.14.92 6.05 2.48 8.52l2.92-2.92c-.89-1.67-1.4-3.57-1.4-5.6 0-6.63 5.37-12 12-12zm13.52 3.48L34.6 18.4c.89 1.67 1.4 3.57 1.4 5.6 0 6.63-5.37 12-12 12v-6l-8 8 8 8v-6c8.84 0 16-7.16 16-16 0-3.14-.92-6.05-2.48-8.52z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/action_delete.svg b/prototype_2016/third_party/qml-material/demo/icons/action_delete.svg
deleted file mode 100644
index 3051156..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/action_delete.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M12 38c0 2.21 1.79 4 4 4h16c2.21 0 4-1.79 4-4V14H12v24zM38 8h-7l-2-2H19l-2 2h-7v4h28V8z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/action_language.svg b/prototype_2016/third_party/qml-material/demo/icons/action_language.svg
deleted file mode 100644
index 8eba04c..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/action_language.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M23.99 4C12.94 4 4 12.95 4 24s8.94 20 19.99 20C35.04 44 44 35.05 44 24S35.04 4 23.99 4zm13.85 12h-5.9c-.65-2.5-1.56-4.9-2.76-7.12 3.68 1.26 6.74 3.81 8.66 7.12zM24 8.07c1.67 2.4 2.97 5.07 3.82 7.93h-7.64c.85-2.86 2.15-5.53 3.82-7.93zM8.52 28C8.19 26.72 8 25.38 8 24s.19-2.72.52-4h6.75c-.16 1.31-.27 2.64-.27 4 0 1.36.11 2.69.28 4H8.52zm1.63 4h5.9c.65 2.5 1.56 4.9 2.76 7.13-3.68-1.26-6.74-3.82-8.66-7.13zm5.9-16h-5.9c1.92-3.31 4.98-5.87 8.66-7.13-1.2 2.23-2.11 4.63-2.76 7.13zM24 39.93c-1.66-2.4-2.96-5.07-3.82-7.93h7.64c-.86 2.86-2.16 5.53-3.82 7.93zM28.68 28h-9.36c-.19-1.31-.32-2.64-.32-4 0-1.36.13-2.69.32-4h9.36c.19 1.31.32 2.64.32 4 0 1.36-.13 2.69-.32 4zm.51 11.12c1.2-2.23 2.11-4.62 2.76-7.12h5.9c-1.93 3.31-4.99 5.86-8.66 7.12zM32.72 28c.16-1.31.28-2.64.28-4 0-1.36-.11-2.69-.28-4h6.75c.33 1.28.53 2.62.53 4s-.19 2.72-.53 4h-6.75z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/action_settings.svg b/prototype_2016/third_party/qml-material/demo/icons/action_settings.svg
deleted file mode 100644
index 7a01c33..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/action_settings.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3c-1.22.51-2.35 1.17-3.38 1.97L9.9 10.1c-.45-.17-.97 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3c1.22-.51 2.35-1.17 3.38-1.97l4.98 2.01c.45.17.97 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/alert_warning.svg b/prototype_2016/third_party/qml-material/demo/icons/alert_warning.svg
deleted file mode 100644
index 31ef9ab..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/alert_warning.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M2 42h44L24 4 2 42zm24-6h-4v-4h4v4zm0-8h-4v-8h4v8z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/communication_email.svg b/prototype_2016/third_party/qml-material/demo/icons/communication_email.svg
deleted file mode 100644
index 533da60..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/communication_email.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M40 8H8c-2.21 0-3.98 1.79-3.98 4L4 36c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 8L24 26 8 16v-4l16 10 16-10v4z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/content_add.svg b/prototype_2016/third_party/qml-material/demo/icons/content_add.svg
deleted file mode 100644
index 2b3a796..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/content_add.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38 26H26v12h-4V26H10v-4h12V10h4v12h12v4z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/content_create.svg b/prototype_2016/third_party/qml-material/demo/icons/content_create.svg
deleted file mode 100644
index 7bc2969..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/content_create.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M6 34.5V42h7.5l22.13-22.13-7.5-7.5L6 34.5zm35.41-20.41c.78-.78.78-2.05 0-2.83l-4.67-4.67c-.78-.78-2.05-.78-2.83 0l-3.66 3.66 7.5 7.5 3.66-3.66z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/content_forward.svg b/prototype_2016/third_party/qml-material/demo/icons/content_forward.svg
deleted file mode 100644
index 62bae42..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/content_forward.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 16V8l16 16-16 16v-8H8V16z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/device_access_alarm.svg b/prototype_2016/third_party/qml-material/demo/icons/device_access_alarm.svg
deleted file mode 100644
index 1a5c539..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/device_access_alarm.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M44 11.44l-9.19-7.71-2.57 3.06 9.19 7.71L44 11.44zM15.76 6.78l-2.57-3.06L4 11.43l2.57 3.06 9.19-7.71zM25 16h-3v12l9.49 5.71L33 31.24l-8-4.74V16zm-1.01-8C14.04 8 6 16.06 6 26s8.04 18 17.99 18S42 35.94 42 26 33.94 8 23.99 8zM24 40c-7.73 0-14-6.27-14-14s6.27-14 14-14 14 6.27 14 14-6.26 14-14 14z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/file_file_download.svg b/prototype_2016/third_party/qml-material/demo/icons/file_file_download.svg
deleted file mode 100644
index b14aa39..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/file_file_download.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38 18h-8V6H18v12h-8l14 14 14-14zM10 36v4h28v-4H10z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/icons.qrc b/prototype_2016/third_party/qml-material/demo/icons/icons.qrc
deleted file mode 100644
index 09383aa..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/icons.qrc
+++ /dev/null
@@ -1,51 +0,0 @@
1<!DOCTYPE RCC>
2<RCC version="1.0">
3
4<qresource prefix="/icons/maps">
5 <file alias="place.svg">maps_place.svg</file>
6</qresource>
7
8<qresource prefix="/icons/communication">
9 <file alias="email.svg">communication_email.svg</file>
10</qresource>
11
12<qresource prefix="/icons/image">
13 <file alias="color_lens.svg">image_color_lens.svg</file>
14 <file alias="edit.svg">image_edit.svg</file>
15</qresource>
16
17<qresource prefix="/icons/alert">
18 <file alias="warning.svg">alert_warning.svg</file>
19</qresource>
20
21<qresource prefix="/icons/content">
22 <file alias="add.svg">content_add.svg</file>
23 <file alias="create.svg">content_create.svg</file>
24 <file alias="forward.svg">content_forward.svg</file>
25</qresource>
26
27<qresource prefix="/icons/device">
28 <file alias="access_alarm.svg">device_access_alarm.svg</file>
29</qresource>
30
31<qresource prefix="/icons/file">
32 <file alias="file_download.svg">file_file_download.svg</file>
33</qresource>
34
35<qresource prefix="/icons/social">
36 <file alias="share.svg">social_share.svg</file>
37</qresource>
38
39<qresource prefix="/icons/action">
40 <file alias="account_circle.svg">action_account_circle.svg</file>
41 <file alias="autorenew.svg">action_autorenew.svg</file>
42 <file alias="delete.svg">action_delete.svg</file>
43 <file alias="language.svg">action_language.svg</file>
44 <file alias="settings.svg">action_settings.svg</file>
45</qresource>
46
47<qresource prefix="/icons/navigation">
48 <file alias="arrow_drop_down.svg">navigation_arrow_drop_down.svg</file>
49</qresource>
50
51</RCC>
diff --git a/prototype_2016/third_party/qml-material/demo/icons/image_color_lens.svg b/prototype_2016/third_party/qml-material/demo/icons/image_color_lens.svg
deleted file mode 100644
index d1b14e9..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/image_color_lens.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 6C14.06 6 6 14.06 6 24s8.06 18 18 18c1.66 0 3-1.34 3-3 0-.78-.29-1.48-.78-2.01-.47-.53-.75-1.22-.75-1.99 0-1.66 1.34-3 3-3H32c5.52 0 10-4.48 10-10 0-8.84-8.06-16-18-16zM13 24c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm6-8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm10 0c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm6 8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/image_edit.svg b/prototype_2016/third_party/qml-material/demo/icons/image_edit.svg
deleted file mode 100644
index 7bc2969..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/image_edit.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M6 34.5V42h7.5l22.13-22.13-7.5-7.5L6 34.5zm35.41-20.41c.78-.78.78-2.05 0-2.83l-4.67-4.67c-.78-.78-2.05-.78-2.83 0l-3.66 3.66 7.5 7.5 3.66-3.66z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/maps_place.svg b/prototype_2016/third_party/qml-material/demo/icons/maps_place.svg
deleted file mode 100644
index b17fb9d..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/maps_place.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 4c-7.73 0-14 6.27-14 14 0 10.5 14 26 14 26s14-15.5 14-26c0-7.73-6.27-14-14-14zm0 19c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/navigation_arrow_drop_down.svg b/prototype_2016/third_party/qml-material/demo/icons/navigation_arrow_drop_down.svg
deleted file mode 100644
index 16f5422..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/navigation_arrow_drop_down.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M14 20l10 10 10-10z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/icons/social_share.svg b/prototype_2016/third_party/qml-material/demo/icons/social_share.svg
deleted file mode 100644
index 2896a1b..0000000
--- a/prototype_2016/third_party/qml-material/demo/icons/social_share.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31 0 3.22 2.61 5.83 5.83 5.83s5.83-2.61 5.83-5.83-2.61-5.83-5.83-5.83z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/images/balloon.jpg b/prototype_2016/third_party/qml-material/demo/images/balloon.jpg
deleted file mode 100644
index 9f8b281..0000000
--- a/prototype_2016/third_party/qml-material/demo/images/balloon.jpg
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/demo/images/go-last.color.svg b/prototype_2016/third_party/qml-material/demo/images/go-last.color.svg
deleted file mode 100644
index 861e81a..0000000
--- a/prototype_2016/third_party/qml-material/demo/images/go-last.color.svg
+++ /dev/null
@@ -1,157 +0,0 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:xlink="http://www.w3.org/1999/xlink"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 version="1.1"
13 width="48"
14 height="48"
15 id="svg2491">
16 <defs
17 id="defs2493">
18 <linearGradient
19 x1="11.767765"
20 y1="-4.4393449"
21 x2="41.116112"
22 y2="-7.0000062"
23 id="linearGradient6723"
24 xlink:href="#linearGradient5113"
25 gradientUnits="userSpaceOnUse"
26 gradientTransform="translate(0,47.00001)" />
27 <linearGradient
28 id="linearGradient3166">
29 <stop
30 id="stop3168"
31 style="stop-color:#a7cc5c;stop-opacity:1"
32 offset="0" />
33 <stop
34 id="stop3170"
35 style="stop-color:#789e2d;stop-opacity:1"
36 offset="1" />
37 </linearGradient>
38 <linearGradient
39 x1="9.9999981"
40 y1="41.5"
41 x2="41.999996"
42 y2="41.5"
43 id="linearGradient3173"
44 xlink:href="#linearGradient3166"
45 gradientUnits="userSpaceOnUse" />
46 <linearGradient
47 id="linearGradient5113">
48 <stop
49 id="stop5115"
50 style="stop-color:#ffffff;stop-opacity:1"
51 offset="0" />
52 <stop
53 id="stop5117"
54 style="stop-color:#ffffff;stop-opacity:0"
55 offset="1" />
56 </linearGradient>
57 <linearGradient
58 x1="16.067961"
59 y1="11.133182"
60 x2="37.73064"
61 y2="42.793934"
62 id="linearGradient5315"
63 xlink:href="#linearGradient5113"
64 gradientUnits="userSpaceOnUse"
65 gradientTransform="matrix(1.004639,0,0,1,-4.037671,-0.05462481)" />
66 <linearGradient
67 id="linearGradient2264">
68 <stop
69 id="stop2266"
70 style="stop-color:#d7e866;stop-opacity:1"
71 offset="0" />
72 <stop
73 id="stop2268"
74 style="stop-color:#8cab2a;stop-opacity:1"
75 offset="1" />
76 </linearGradient>
77 <linearGradient
78 x1="21.131361"
79 y1="13.152157"
80 x2="21.131361"
81 y2="38.714657"
82 id="linearGradient3172"
83 xlink:href="#linearGradient2264"
84 gradientUnits="userSpaceOnUse" />
85 <linearGradient
86 id="linearGradient5105">
87 <stop
88 id="stop5107"
89 style="stop-color:#000000;stop-opacity:1"
90 offset="0" />
91 <stop
92 id="stop5109"
93 style="stop-color:#000000;stop-opacity:0"
94 offset="1" />
95 </linearGradient>
96 <radialGradient
97 cx="11.25"
98 cy="19.03125"
99 r="8.0625"
100 fx="11.25"
101 fy="19.03125"
102 id="radialGradient4354"
103 xlink:href="#linearGradient5105"
104 gradientUnits="userSpaceOnUse"
105 gradientTransform="matrix(1,0,0,0.282946,0,13.64644)" />
106 </defs>
107 <metadata
108 id="metadata2496">
109 <rdf:RDF>
110 <cc:Work
111 rdf:about="">
112 <dc:format>image/svg+xml</dc:format>
113 <dc:type
114 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
115 </cc:Work>
116 </rdf:RDF>
117 </metadata>
118 <g
119 id="layer1">
120 <g
121 transform="translate(0.9999938,-2.9999963)"
122 id="g2571"
123 style="display:inline">
124 <path
125 d="m 19.3125,19.03125 a 8.0625,2.28125 0 1 1 -16.125,0 8.0625,2.28125 0 1 1 16.125,0 z"
126 transform="matrix(-2.48062,0,0,2.410961,50.90698,-5.38361)"
127 id="path4346"
128 style="opacity:0.16292138;fill:url(#radialGradient4354);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" />
129 <path
130 d="m 19.502209,9.4374998 19.004144,16.5060242 -19.004144,16.423291 0,-7.869835 -14.9958391,0 0,-17.055132 14.9958391,0 0,-8.0043482 z"
131 inkscape:connector-curvature="0"
132 id="path4348"
133 style="fill:url(#linearGradient3172);fill-opacity:1;fill-rule:nonzero;stroke:#548820;stroke-width:0.99999958;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
134 <path
135 d="m 20.573058,11.578557 16.516638,14.386273 -16.516638,14.199301 0,-6.738369 -15.0666831,0 0,-14.978334 15.0666831,0 0,-6.868871 z"
136 inkscape:connector-curvature="0"
137 id="path4360"
138 style="opacity:0.35400008;fill:none;stroke:url(#linearGradient5315);stroke-width:0.99999958;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
139 <rect
140 width="33.000008"
141 height="4.0000119"
142 x="9.5"
143 y="39.500008"
144 transform="matrix(0,1,1,0,0,0)"
145 id="rect4242"
146 style="fill:#b3c360;fill-opacity:1;fill-rule:nonzero;stroke:#548820;stroke-width:0.99999982;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
147 <rect
148 width="31"
149 height="2.0000019"
150 x="10.499998"
151 y="40.5"
152 transform="matrix(0,1,1,0,0,0)"
153 id="rect6697"
154 style="opacity:0.35400008;fill:url(#linearGradient3173);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient6723);stroke-width:0.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
155 </g>
156 </g>
157</svg>
diff --git a/prototype_2016/third_party/qml-material/demo/images/list-add.color.svg b/prototype_2016/third_party/qml-material/demo/images/list-add.color.svg
deleted file mode 100644
index 1e80aef..0000000
--- a/prototype_2016/third_party/qml-material/demo/images/list-add.color.svg
+++ /dev/null
@@ -1,180 +0,0 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:xlink="http://www.w3.org/1999/xlink"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 version="1.1"
13 width="48"
14 height="48"
15 id="svg3941">
16 <defs
17 id="defs3943">
18 <linearGradient
19 x1="25"
20 y1="15"
21 x2="25"
22 y2="35"
23 id="linearGradient3897"
24 xlink:href="#linearGradient3891"
25 gradientUnits="userSpaceOnUse" />
26 <linearGradient
27 id="linearGradient3891">
28 <stop
29 id="stop3893"
30 style="stop-color:#000000;stop-opacity:1"
31 offset="0" />
32 <stop
33 id="stop3895"
34 style="stop-color:#000000;stop-opacity:0"
35 offset="1" />
36 </linearGradient>
37 <linearGradient
38 x1="71.204407"
39 y1="6.2375584"
40 x2="71.204407"
41 y2="44.340794"
42 id="linearGradient3403-4"
43 xlink:href="#linearGradient4011-3"
44 gradientUnits="userSpaceOnUse"
45 gradientTransform="translate(-47.733516,-0.3572398)" />
46 <linearGradient
47 id="linearGradient4011-3">
48 <stop
49 id="stop4013-5"
50 style="stop-color:#ffffff;stop-opacity:1"
51 offset="0" />
52 <stop
53 id="stop4015-1"
54 style="stop-color:#ffffff;stop-opacity:0.23529412"
55 offset="0.507761" />
56 <stop
57 id="stop4017-7"
58 style="stop-color:#ffffff;stop-opacity:0.15686275"
59 offset="0.83456558" />
60 <stop
61 id="stop4019-4"
62 style="stop-color:#ffffff;stop-opacity:0.39215687"
63 offset="1" />
64 </linearGradient>
65 <radialGradient
66 cx="23.895569"
67 cy="3.9900031"
68 r="20.397499"
69 fx="23.895569"
70 fy="3.9900031"
71 id="radialGradient3013-3"
72 xlink:href="#linearGradient3242-7"
73 gradientUnits="userSpaceOnUse"
74 gradientTransform="matrix(0,2.2874593,-3.0194057,0,36.047438,-50.630156)" />
75 <linearGradient
76 id="linearGradient3242-7">
77 <stop
78 id="stop3244-5"
79 style="stop-color:#eef87e;stop-opacity:1"
80 offset="0" />
81 <stop
82 id="stop3246-9"
83 style="stop-color:#cde34f;stop-opacity:1"
84 offset="0.26238" />
85 <stop
86 id="stop3248-7"
87 style="stop-color:#93b723;stop-opacity:1"
88 offset="0.66093999" />
89 <stop
90 id="stop3250-8"
91 style="stop-color:#5a7e0d;stop-opacity:1"
92 offset="1" />
93 </linearGradient>
94 <linearGradient
95 x1="18.379412"
96 y1="44.980297"
97 x2="18.379412"
98 y2="3.0816143"
99 id="linearGradient3015-2"
100 xlink:href="#linearGradient2490-3"
101 gradientUnits="userSpaceOnUse"
102 gradientTransform="matrix(0.9584364,0,0,0.9584366,0.9975247,1.9975255)" />
103 <linearGradient
104 id="linearGradient2490-3">
105 <stop
106 id="stop2492-3"
107 style="stop-color:#3f7010;stop-opacity:1"
108 offset="0" />
109 <stop
110 id="stop2494-8"
111 style="stop-color:#84a718;stop-opacity:1"
112 offset="1" />
113 </linearGradient>
114 <linearGradient
115 id="linearGradient8838-2">
116 <stop
117 id="stop8840-8"
118 style="stop-color:#000000;stop-opacity:1"
119 offset="0" />
120 <stop
121 id="stop8842-8"
122 style="stop-color:#000000;stop-opacity:0"
123 offset="1" />
124 </linearGradient>
125 <radialGradient
126 cx="62.625"
127 cy="4.625"
128 r="10.625"
129 fx="62.625"
130 fy="4.625"
131 id="radialGradient3939"
132 xlink:href="#linearGradient8838-2"
133 gradientUnits="userSpaceOnUse"
134 gradientTransform="matrix(2.1647059,0,0,0.7529402,-111.5647,36.517647)" />
135 </defs>
136 <metadata
137 id="metadata3946">
138 <rdf:RDF>
139 <cc:Work
140 rdf:about="">
141 <dc:format>image/svg+xml</dc:format>
142 <dc:type
143 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
144 <dc:title />
145 </cc:Work>
146 </rdf:RDF>
147 </metadata>
148 <g
149 id="layer1">
150 <path
151 d="m 47,40 c 0,4.418278 -10.297451,8 -22.999999,8 -12.702548,0 -23.0000013,-3.581722 -23.0000013,-8 0,-4.418278 10.2974533,-8 23.0000013,-8 C 36.702549,32 47,35.581722 47,40 l 0,0 z"
152 inkscape:connector-curvature="0"
153 id="path8836-9"
154 style="opacity:0.3;fill:url(#radialGradient3939);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.99999988;marker:none;visibility:visible;display:inline;overflow:visible" />
155 <path
156 d="M 24.000003,5.501809 C 13.241574,5.501809 4.5018087,14.24157 4.5018087,25 c 0,10.75843 8.7397653,19.498195 19.4981943,19.498192 10.758425,0 19.498198,-8.739762 19.498188,-19.498192 0,-10.75843 -8.739763,-19.498191 -19.498188,-19.498191 z"
157 inkscape:connector-curvature="0"
158 id="path2555-2"
159 style="fill:url(#radialGradient3013-3);fill-opacity:1;stroke:url(#linearGradient3015-2);stroke-width:1.003654;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
160 <path
161 d="M 42.500001,24.999344 C 42.500001,35.216942 34.216659,43.5 24.000234,43.5 13.782874,43.5 5.4999992,35.216848 5.4999992,24.999344 c 0,-10.217125 8.2828748,-18.4993438 18.5002348,-18.4993438 10.216425,0 18.499767,8.2822188 18.499767,18.4993438 l 0,0 z"
162 inkscape:connector-curvature="0"
163 id="path8655-8"
164 style="opacity:0.7;color:#000000;fill:none;stroke:url(#linearGradient3403-4);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
165 <path
166 d="m 21,14 0,7 -7,0 0,6 7,0 0,7 6,0 0,-7 7,0 0,-6 -7,0 0,-7 z"
167 inkscape:connector-curvature="0"
168 id="rect3007-9"
169 style="color:#000000;fill:#638d14;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
170 <path
171 d="m 21,15 0,7 -7,0 0,6 7,0 0,7 6,0 0,-7 7,0 0,-6 -7,0 0,-7 z"
172 inkscape:connector-curvature="0"
173 id="rect3007"
174 style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
175 <path
176 d="m 21.53125,15.53125 0,6.46875 A 0.52273827,0.52273827 0 0 1 21,22.53125 l -6.46875,0 0,4.9375 6.46875,0 A 0.52273827,0.52273827 0 0 1 21.53125,28 l 0,6.46875 4.9375,0 0,-6.46875 A 0.52273827,0.52273827 0 0 1 27,27.46875 l 6.46875,0 0,-4.9375 -6.46875,0 A 0.52273827,0.52273827 0 0 1 26.46875,22 l 0,-6.46875 -4.9375,0 z"
177 id="path3889"
178 style="opacity:0.1;color:#000000;fill:none;stroke:url(#linearGradient3897);stroke-width:1;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
179 </g>
180</svg>
diff --git a/prototype_2016/third_party/qml-material/demo/images/weather-pouring.svg b/prototype_2016/third_party/qml-material/demo/images/weather-pouring.svg
deleted file mode 100644
index bf20e9b..0000000
--- a/prototype_2016/third_party/qml-material/demo/images/weather-pouring.svg
+++ /dev/null
@@ -1 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M9,12C9.53,12.14 9.85,12.69 9.71,13.22L8.41,18.05C8.27,18.59 7.72,18.9 7.19,18.76C6.65,18.62 6.34,18.07 6.5,17.54L7.78,12.71C7.92,12.17 8.47,11.86 9,12M13,12C13.53,12.14 13.85,12.69 13.71,13.22L11.64,20.95C11.5,21.5 10.95,21.8 10.41,21.66C9.88,21.5 9.56,20.97 9.7,20.43L11.78,12.71C11.92,12.17 12.47,11.86 13,12M17,12C17.53,12.14 17.85,12.69 17.71,13.22L16.41,18.05C16.27,18.59 15.72,18.9 15.19,18.76C14.65,18.62 14.34,18.07 14.5,17.54L15.78,12.71C15.92,12.17 16.47,11.86 17,12M17,10V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11C3,12.11 3.6,13.08 4.5,13.6V13.59C5,13.87 5.14,14.5 4.87,14.96C4.59,15.43 4,15.6 3.5,15.32V15.33C2,14.47 1,12.85 1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12C23,13.5 22.2,14.77 21,15.46V15.46C20.5,15.73 19.91,15.57 19.63,15.09C19.36,14.61 19.5,14 20,13.72V13.73C20.6,13.39 21,12.74 21,12A2,2 0 0,0 19,10H17Z" /></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/images/weather-sunset.svg b/prototype_2016/third_party/qml-material/demo/images/weather-sunset.svg
deleted file mode 100644
index 1a3babd..0000000
--- a/prototype_2016/third_party/qml-material/demo/images/weather-sunset.svg
+++ /dev/null
@@ -1 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M3,12H7A5,5 0 0,1 12,7A5,5 0 0,1 17,12H21A1,1 0 0,1 22,13A1,1 0 0,1 21,14H3A1,1 0 0,1 2,13A1,1 0 0,1 3,12M5,16H19A1,1 0 0,1 20,17A1,1 0 0,1 19,18H5A1,1 0 0,1 4,17A1,1 0 0,1 5,16M17,20A1,1 0 0,1 18,21A1,1 0 0,1 17,22H7A1,1 0 0,1 6,21A1,1 0 0,1 7,20H17M15,12A3,3 0 0,0 12,9A3,3 0 0,0 9,12H15M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7Z" /></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/demo/main.cpp b/prototype_2016/third_party/qml-material/demo/main.cpp
deleted file mode 100644
index d1e6dc0..0000000
--- a/prototype_2016/third_party/qml-material/demo/main.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
1#include <QGuiApplication>
2#include <QQmlApplicationEngine>
3
4int main(int argc, char *argv[])
5{
6 QGuiApplication app(argc, argv);
7
8 QQmlApplicationEngine engine(QUrl(QStringLiteral("qrc:/main.qml")));
9
10 return app.exec();
11}
diff --git a/prototype_2016/third_party/qml-material/demo/main.qml b/prototype_2016/third_party/qml-material/demo/main.qml
deleted file mode 100644
index f628cb8..0000000
--- a/prototype_2016/third_party/qml-material/demo/main.qml
+++ /dev/null
@@ -1,268 +0,0 @@
1import QtQuick 2.4
2import Material 0.2
3import Material.ListItems 0.1 as ListItem
4
5ApplicationWindow {
6 id: demo
7
8 title: "Material for QtQuick Demo"
9
10 // Necessary when loading the window from C++
11 visible: true
12
13 theme {
14 primaryColor: "blue"
15 accentColor: "red"
16 tabHighlightColor: "white"
17 }
18
19 property var styles: [
20 "Custom Icons", "Color Palette", "Typography"
21 ]
22
23 property var basicComponents: [
24 "Button", "CheckBox", "Progress Bar", "Radio Button",
25 "Slider", "Switch", "TextField"
26 ]
27
28 property var compoundComponents: [
29 "Bottom Sheet", "Dialog", "Forms", "List Items", "Page Stack", "Time Picker", "Date Picker"
30 ]
31
32 property var sections: [ basicComponents, styles, compoundComponents ]
33
34 property var sectionTitles: [ "Basic Components", "Style", "Compound Components" ]
35
36 property string selectedComponent: sections[0][0]
37
38 initialPage: TabbedPage {
39 id: page
40
41 title: "Demo"
42
43 actionBar.maxActionCount: navDrawer.enabled ? 3 : 4
44
45 actions: [
46 Action {
47 iconName: "alert/warning"
48 name: "Dummy error"
49 onTriggered: demo.showError("Something went wrong", "Do you want to retry?", "Close", true)
50 },
51
52 Action {
53 iconName: "image/color_lens"
54 name: "Colors"
55 onTriggered: colorPicker.show()
56 },
57
58 Action {
59 iconName: "action/settings"
60 name: "Settings"
61 hoverAnimation: true
62 },
63
64 Action {
65 iconName: "alert/warning"
66 name: "THIS SHOULD BE HIDDEN!"
67 visible: false
68 },
69
70 Action {
71 iconName: "action/language"
72 name: "Language"
73 enabled: false
74 },
75
76 Action {
77 iconName: "action/account_circle"
78 name: "Accounts"
79 }
80 ]
81
82 backAction: navDrawer.action
83
84 NavigationDrawer {
85 id: navDrawer
86
87 enabled: page.width < dp(500)
88
89 onEnabledChanged: smallLoader.active = enabled
90
91 Flickable {
92 anchors.fill: parent
93
94 contentHeight: Math.max(content.implicitHeight, height)
95
96 Column {
97 id: content
98 anchors.fill: parent
99
100 Repeater {
101 model: sections
102
103 delegate: Column {
104 width: parent.width
105
106 ListItem.Subheader {
107 text: sectionTitles[index]
108 }
109
110 Repeater {
111 model: modelData
112 delegate: ListItem.Standard {
113 text: modelData
114 selected: modelData == demo.selectedComponent
115 onClicked: {
116 demo.selectedComponent = modelData
117 navDrawer.close()
118 }
119 }
120 }
121 }
122 }
123 }
124 }
125 }
126
127 Repeater {
128 model: !navDrawer.enabled ? sections : 0
129
130 delegate: Tab {
131 title: sectionTitles[index]
132
133 property string selectedComponent: modelData[0]
134 property var section: modelData
135
136 sourceComponent: tabDelegate
137 }
138 }
139
140 Loader {
141 id: smallLoader
142 anchors.fill: parent
143 sourceComponent: tabDelegate
144
145 property var section: []
146 visible: active
147 active: false
148 }
149 }
150
151 Dialog {
152 id: colorPicker
153 title: "Pick color"
154
155 positiveButtonText: "Done"
156
157 MenuField {
158 id: selection
159 model: ["Primary color", "Accent color", "Background color"]
160 width: dp(160)
161 }
162
163 Grid {
164 columns: 7
165 spacing: dp(8)
166
167 Repeater {
168 model: [
169 "red", "pink", "purple", "deepPurple", "indigo",
170 "blue", "lightBlue", "cyan", "teal", "green",
171 "lightGreen", "lime", "yellow", "amber", "orange",
172 "deepOrange", "grey", "blueGrey", "brown", "black",
173 "white"
174 ]
175
176 Rectangle {
177 width: dp(30)
178 height: dp(30)
179 radius: dp(2)
180 color: Palette.colors[modelData]["500"]
181 border.width: modelData === "white" ? dp(2) : 0
182 border.color: Theme.alpha("#000", 0.26)
183
184 Ink {
185 anchors.fill: parent
186
187 onPressed: {
188 switch(selection.selectedIndex) {
189 case 0:
190 theme.primaryColor = parent.color
191 break;
192 case 1:
193 theme.accentColor = parent.color
194 break;
195 case 2:
196 theme.backgroundColor = parent.color
197 break;
198 }
199 }
200 }
201 }
202 }
203 }
204
205 onRejected: {
206 // TODO set default colors again but we currently don't know what that is
207 }
208 }
209
210 Component {
211 id: tabDelegate
212
213 Item {
214
215 Sidebar {
216 id: sidebar
217
218 expanded: !navDrawer.enabled
219
220 Column {
221 width: parent.width
222
223 Repeater {
224 model: section
225 delegate: ListItem.Standard {
226 text: modelData
227 selected: modelData == selectedComponent
228 onClicked: selectedComponent = modelData
229 }
230 }
231 }
232 }
233 Flickable {
234 id: flickable
235 anchors {
236 left: sidebar.right
237 right: parent.right
238 top: parent.top
239 bottom: parent.bottom
240 }
241 clip: true
242 contentHeight: Math.max(example.implicitHeight + 40, height)
243 Loader {
244 id: example
245 anchors.fill: parent
246 asynchronous: true
247 visible: status == Loader.Ready
248 // selectedComponent will always be valid, as it defaults to the first component
249 source: {
250 if (navDrawer.enabled) {
251 return Qt.resolvedUrl("%1Demo.qml").arg(demo.selectedComponent.replace(" ", ""))
252 } else {
253 return Qt.resolvedUrl("%1Demo.qml").arg(selectedComponent.replace(" ", ""))
254 }
255 }
256 }
257
258 ProgressCircle {
259 anchors.centerIn: parent
260 visible: example.status == Loader.Loading
261 }
262 }
263 Scrollbar {
264 flickableItem: flickable
265 }
266 }
267 }
268}
diff --git a/prototype_2016/third_party/qml-material/deploy_key.enc b/prototype_2016/third_party/qml-material/deploy_key.enc
deleted file mode 100644
index 8ec6492..0000000
--- a/prototype_2016/third_party/qml-material/deploy_key.enc
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/documentation/.gitignore b/prototype_2016/third_party/qml-material/documentation/.gitignore
deleted file mode 100644
index 1936cc1..0000000
--- a/prototype_2016/third_party/qml-material/documentation/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1html
diff --git a/prototype_2016/third_party/qml-material/documentation/images/buttons.png b/prototype_2016/third_party/qml-material/documentation/images/buttons.png
deleted file mode 100644
index aeda026..0000000
--- a/prototype_2016/third_party/qml-material/documentation/images/buttons.png
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/documentation/material.qdoc b/prototype_2016/third_party/qml-material/documentation/material.qdoc
deleted file mode 100644
index 5f07656..0000000
--- a/prototype_2016/third_party/qml-material/documentation/material.qdoc
+++ /dev/null
@@ -1,5 +0,0 @@
1/*!
2 \qmlmodule Material 0.2
3 \title Material Design UI components
4 This implements Material Design for QtQuick.
5*/
diff --git a/prototype_2016/third_party/qml-material/documentation/material.qdocconf b/prototype_2016/third_party/qml-material/documentation/material.qdocconf
deleted file mode 100644
index 8638c64..0000000
--- a/prototype_2016/third_party/qml-material/documentation/material.qdocconf
+++ /dev/null
@@ -1,16 +0,0 @@
1project = Material
2url = http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/
3description = Material for QtQuick
4sourcedirs = ./
5sourcedirs += ../modules/Material/
6sourcedirs += ../modules/Material/ListItems
7exampledirs += snippets
8imagedirs = images
9sources.fileextensions = "*.qml *.qdoc *.cpp"
10headers.fileextensions = "*.h"
11version = 0.2
12syntaxhighlighting = true
13sourceencoding = UTF-8
14outputencoding = UTF-8
15outputdir = ditaxml
16outputformats = DITAXML
diff --git a/prototype_2016/third_party/qml-material/fonts/MaterialFontLoader.qml b/prototype_2016/third_party/qml-material/fonts/MaterialFontLoader.qml
deleted file mode 100644
index b91f341..0000000
--- a/prototype_2016/third_party/qml-material/fonts/MaterialFontLoader.qml
+++ /dev/null
@@ -1,33 +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
12import QtQuick 2.0
13
14Item {
15 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-BlackItalic.ttf")}
16 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-Black.ttf")}
17 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-Bold.ttf")}
18 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-BoldItalic.ttf")}
19 FontLoader {source: Qt.resolvedUrl("roboto/RobotoCondensed-Bold.ttf")}
20 FontLoader {source: Qt.resolvedUrl("roboto/RobotoCondensed-BoldItalic.ttf")}
21 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-Medium.ttf")}
22 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-MediumItalic.ttf")}
23 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-Regular.ttf")}
24 FontLoader {source: Qt.resolvedUrl("roboto/RobotoCondensed-Italic.ttf")}
25 FontLoader {source: Qt.resolvedUrl("roboto/RobotoCondensed-Light.ttf")}
26 FontLoader {source: Qt.resolvedUrl("roboto/RobotoCondensed-LightItalic.ttf")}
27 FontLoader {source: Qt.resolvedUrl("roboto/RobotoCondensed-Regular.ttf")}
28 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-Italic.ttf")}
29 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-Light.ttf")}
30 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-LightItalic.ttf")}
31 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-Thin.ttf")}
32 FontLoader {source: Qt.resolvedUrl("roboto/Roboto-ThinItalic.ttf")}
33}
diff --git a/prototype_2016/third_party/qml-material/fonts/fonts.qrc b/prototype_2016/third_party/qml-material/fonts/fonts.qrc
deleted file mode 100644
index e795bb7..0000000
--- a/prototype_2016/third_party/qml-material/fonts/fonts.qrc
+++ /dev/null
@@ -1,27 +0,0 @@
1<!DOCTYPE RCC>
2<RCC version="1.0">
3
4<qresource prefix="/Material/Fonts">
5 <file>MaterialFontLoader.qml</file>
6 <file>qmldir</file>
7 <file>roboto/Roboto-Black.ttf</file>
8 <file>roboto/Roboto-BlackItalic.ttf</file>
9 <file>roboto/Roboto-Bold.ttf</file>
10 <file>roboto/Roboto-BoldItalic.ttf</file>
11 <file>roboto/Roboto-Italic.ttf</file>
12 <file>roboto/Roboto-Light.ttf</file>
13 <file>roboto/Roboto-LightItalic.ttf</file>
14 <file>roboto/Roboto-Medium.ttf</file>
15 <file>roboto/Roboto-MediumItalic.ttf</file>
16 <file>roboto/Roboto-Regular.ttf</file>
17 <file>roboto/Roboto-Thin.ttf</file>
18 <file>roboto/Roboto-ThinItalic.ttf</file>
19 <file>roboto/RobotoCondensed-Bold.ttf</file>
20 <file>roboto/RobotoCondensed-BoldItalic.ttf</file>
21 <file>roboto/RobotoCondensed-Italic.ttf</file>
22 <file>roboto/RobotoCondensed-Light.ttf</file>
23 <file>roboto/RobotoCondensed-LightItalic.ttf</file>
24 <file>roboto/RobotoCondensed-Regular.ttf</file>
25</qresource>
26
27</RCC>
diff --git a/prototype_2016/third_party/qml-material/fonts/qmldir b/prototype_2016/third_party/qml-material/fonts/qmldir
deleted file mode 100644
index d1f5ee9..0000000
--- a/prototype_2016/third_party/qml-material/fonts/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
1module Material.fonts
2
3MaterialFontLoader 0.1 MaterialFontLoader.qml
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Black.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Black.ttf
deleted file mode 100644
index 2cd263f..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Black.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BlackItalic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BlackItalic.ttf
deleted file mode 100644
index 2cbab76..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BlackItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Bold.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Bold.ttf
deleted file mode 100644
index 30264a0..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BoldItalic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BoldItalic.ttf
deleted file mode 100644
index 67b010e..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-BoldItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Italic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Italic.ttf
deleted file mode 100644
index 2c66b82..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Italic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Light.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Light.ttf
deleted file mode 100644
index f887c0c..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Light.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-LightItalic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-LightItalic.ttf
deleted file mode 100644
index 66b3bf0..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-LightItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Medium.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Medium.ttf
deleted file mode 100644
index f908a39..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Medium.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-MediumItalic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-MediumItalic.ttf
deleted file mode 100644
index ae193cf..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-MediumItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Regular.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Regular.ttf
deleted file mode 100644
index e8f41e4..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Thin.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Thin.ttf
deleted file mode 100644
index a607ef1..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-Thin.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-ThinItalic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-ThinItalic.ttf
deleted file mode 100644
index 67ef530..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/Roboto-ThinItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Bold.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Bold.ttf
deleted file mode 100644
index 738f9ec..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-BoldItalic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-BoldItalic.ttf
deleted file mode 100644
index 21fe077..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-BoldItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Italic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Italic.ttf
deleted file mode 100644
index 4466d00..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Italic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Light.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Light.ttf
deleted file mode 100644
index 9bce9c0..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Light.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-LightItalic.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-LightItalic.ttf
deleted file mode 100644
index 7151253..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-LightItalic.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Regular.ttf b/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Regular.ttf
deleted file mode 100644
index 6fe33b6..0000000
--- a/prototype_2016/third_party/qml-material/fonts/roboto/RobotoCondensed-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/prototype_2016/third_party/qml-material/icons.yml b/prototype_2016/third_party/qml-material/icons.yml
deleted file mode 100644
index e76ae0b..0000000
--- a/prototype_2016/third_party/qml-material/icons.yml
+++ /dev/null
@@ -1,8 +0,0 @@
1out: icons/core_icons.qrc
2icons:
3 - navigation/arrow_back
4 - navigation/chevron_left
5 - navigation/chevron_right
6 - navigation/close
7 - navigation/menu
8 - navigation/more_vert
diff --git a/prototype_2016/third_party/qml-material/icons/core_icons.qrc b/prototype_2016/third_party/qml-material/icons/core_icons.qrc
deleted file mode 100644
index 25aaa6f..0000000
--- a/prototype_2016/third_party/qml-material/icons/core_icons.qrc
+++ /dev/null
@@ -1,13 +0,0 @@
1<!DOCTYPE RCC>
2<RCC version="1.0">
3
4<qresource prefix="/icons/navigation">
5 <file alias="arrow_back.svg">navigation_arrow_back.svg</file>
6 <file alias="chevron_left.svg">navigation_chevron_left.svg</file>
7 <file alias="chevron_right.svg">navigation_chevron_right.svg</file>
8 <file alias="close.svg">navigation_close.svg</file>
9 <file alias="menu.svg">navigation_menu.svg</file>
10 <file alias="more_vert.svg">navigation_more_vert.svg</file>
11</qresource>
12
13</RCC> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/icons/navigation_arrow_back.svg b/prototype_2016/third_party/qml-material/icons/navigation_arrow_back.svg
deleted file mode 100644
index 0b26387..0000000
--- a/prototype_2016/third_party/qml-material/icons/navigation_arrow_back.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M40 22H15.66l11.17-11.17L24 8 8 24l16 16 2.83-2.83L15.66 26H40v-4z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/icons/navigation_chevron_left.svg b/prototype_2016/third_party/qml-material/icons/navigation_chevron_left.svg
deleted file mode 100644
index 4449fbd..0000000
--- a/prototype_2016/third_party/qml-material/icons/navigation_chevron_left.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M30.83 14.83L28 12 16 24l12 12 2.83-2.83L21.66 24z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/icons/navigation_chevron_right.svg b/prototype_2016/third_party/qml-material/icons/navigation_chevron_right.svg
deleted file mode 100644
index ab7c4c5..0000000
--- a/prototype_2016/third_party/qml-material/icons/navigation_chevron_right.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M20 12l-2.83 2.83L26.34 24l-9.17 9.17L20 36l12-12z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/icons/navigation_close.svg b/prototype_2016/third_party/qml-material/icons/navigation_close.svg
deleted file mode 100644
index 40b5e39..0000000
--- a/prototype_2016/third_party/qml-material/icons/navigation_close.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38 12.83L35.17 10 24 21.17 12.83 10 10 12.83 21.17 24 10 35.17 12.83 38 24 26.83 35.17 38 38 35.17 26.83 24z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/icons/navigation_menu.svg b/prototype_2016/third_party/qml-material/icons/navigation_menu.svg
deleted file mode 100644
index 6c9b6bf..0000000
--- a/prototype_2016/third_party/qml-material/icons/navigation_menu.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M6 36h36v-4H6v4zm0-10h36v-4H6v4zm0-14v4h36v-4H6z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/icons/navigation_more_vert.svg b/prototype_2016/third_party/qml-material/icons/navigation_more_vert.svg
deleted file mode 100644
index e0750c5..0000000
--- a/prototype_2016/third_party/qml-material/icons/navigation_more_vert.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 16c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 4c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 12c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/material.pri b/prototype_2016/third_party/qml-material/material.pri
deleted file mode 100644
index 4538f4c..0000000
--- a/prototype_2016/third_party/qml-material/material.pri
+++ /dev/null
@@ -1,31 +0,0 @@
1CONFIG += c++11
2QT += qml quick
3
4android {
5 QT += androidextras svg xml
6}
7
8HEADERS += $$PWD/src/plugin.h \
9 $$PWD/src/core/device.h \
10 $$PWD/src/core/units.h
11
12SOURCES += $$PWD/src/plugin.cpp \
13 $$PWD/src/core/device.cpp \
14 $$PWD/src/core/units.cpp
15
16RESOURCES += $$PWD/src/material.qrc \
17 $$PWD/src/components/components.qrc \
18 $$PWD/src/controls/controls.qrc \
19 $$PWD/src/core/core.qrc \
20 $$PWD/src/extras/extras.qrc \
21 $$PWD/src/listitems/listitems.qrc \
22 $$PWD/src/popups/popups.qrc \
23 $$PWD/src/styles/styles.qrc \
24 $$PWD/src/window/window.qrc \
25 $$PWD/icons/core_icons.qrc
26
27OTHER_FILES = $$PWD/README.md $$PWD/CHANGELOG.md
28
29contains(OPTIONS, roboto) {
30 RESOURCES += $$PWD/fonts/fonts.qrc
31}
diff --git a/prototype_2016/third_party/qml-material/qml-material.pro b/prototype_2016/third_party/qml-material/qml-material.pro
deleted file mode 100644
index 8e44140..0000000
--- a/prototype_2016/third_party/qml-material/qml-material.pro
+++ /dev/null
@@ -1,5 +0,0 @@
1TEMPLATE = subdirs
2
3SUBDIRS = src demo tests
4
5OTHER_FILES = $$PWD/README.md $$PWD/CHANGELOG.md
diff --git a/prototype_2016/third_party/qml-material/qpm.json b/prototype_2016/third_party/qml-material/qpm.json
deleted file mode 100644
index 6b49c1a..0000000
--- a/prototype_2016/third_party/qml-material/qpm.json
+++ /dev/null
@@ -1,22 +0,0 @@
1{
2 "name": "io.papyros.material",
3 "description": "",
4 "author": {
5 "name": "Michael Spencer",
6 "email": "sonrisesoftware@gmail.com"
7 },
8 "repository": {
9 "type": "GITHUB",
10 "url": "git@github.com:papyros/qml-material.git"
11 },
12 "version": {
13 "label": "0.3.0",
14 "revision": "",
15 "fingerprint": ""
16 },
17 "dependencies": [
18 ],
19 "license": "LGPL_2_1",
20 "pri_filename": "material.pri",
21 "webpage": "http://papyros.io/qml-material"
22}
diff --git a/prototype_2016/third_party/qml-material/scripts/build_docs.sh b/prototype_2016/third_party/qml-material/scripts/build_docs.sh
deleted file mode 100755
index 6bef30f..0000000
--- a/prototype_2016/third_party/qml-material/scripts/build_docs.sh
+++ /dev/null
@@ -1,7 +0,0 @@
1#! /bin/bash
2
3cd documentation
4rm -r ditaxml html
5
6qdoc material.qdocconf
7docmaker.py ditaxml html \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/scripts/deploy.sh b/prototype_2016/third_party/qml-material/scripts/deploy.sh
deleted file mode 100755
index eb75d5a..0000000
--- a/prototype_2016/third_party/qml-material/scripts/deploy.sh
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/bin/bash
2set -e
3
4if [ -n "$TRAVIS_BUILD_ID" ]; then
5 # When running on Travis we need to use SSH to deploy to GitHub
6 #
7 # The following converts the repo URL to an SSH location,
8 # decrypts the SSH key and sets up the Git config with
9 # the correct user name and email (globally as this is a
10 # temporary travis environment)
11 #
12 # Set the following environment variables in the travis configuration (.travis.yml)
13 #
14 # DEPLOY_BRANCH - The only branch that Travis should deploy from
15 # ENCRYPTION_LABEL - The label assigned when encrypting the SSH key using travis encrypt-file
16 # GIT_NAME - The Git user name
17 # GIT_EMAIL - The Git user email
18 #
19 echo SOURCE_BRANCH: $SOURCE_BRANCH
20 echo ENCRYPTION_LABEL: $ENCRYPTION_LABEL
21 echo GIT_NAME: $GIT_NAME
22 echo GIT_EMAIL: $GIT_EMAIL
23
24 if [ "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
25 echo "Travis should only deploy from the SOURCE_BRANCH ($SOURCE_BRANCH) branch"
26 exit 0
27 else
28 if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
29 echo "Travis should not deploy from pull requests"
30 exit 0
31 else
32 ENCRYPTED_KEY_VAR=encrypted_${ENCRYPTION_LABEL}_key
33 ENCRYPTED_IV_VAR=encrypted_${ENCRYPTION_LABEL}_iv
34 ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
35 ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
36 REPO=${REPO/git:\/\/github.com\//git@github.com:}
37
38 # The `deploy_key.enc` file should have been added to the repo and should
39 # have been created from the deploy private key using `travis encrypt-file`
40 openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d
41
42 chmod 600 deploy_key
43 eval `ssh-agent -s`
44 ssh-add deploy_key
45
46 git config --global user.name "$GIT_NAME"
47 git config --global user.email "$GIT_EMAIL"
48 fi
49 fi
50fi
51
52REPO=git@github.com:papyros/qml-material
53TARGET_BRANCH=gh-pages
54SOURCE_DIR=documentation/html
55
56if [ ! -d "$SOURCE_DIR" ]; then
57 echo "SOURCE_DIR ($SOURCE_DIR) does not exist, build the documentation before deploying"
58 exit 1
59fi
60
61REPO_NAME=$(basename $REPO)
62TARGET_DIR=$(mktemp -d /tmp/$REPO_NAME.XXXX)
63REV=$(git rev-parse HEAD)
64git clone --branch ${TARGET_BRANCH} ${REPO} ${TARGET_DIR}
65rsync -rt --delete --exclude=".git" $SOURCE_DIR/ $TARGET_DIR/
66cd $TARGET_DIR
67git add -A .
68git commit --allow-empty -m "Documentation built from commit $REV"
69git push origin $TARGET_BRANCH
diff --git a/prototype_2016/third_party/qml-material/scripts/icons.py b/prototype_2016/third_party/qml-material/scripts/icons.py
deleted file mode 100755
index 5c134cd..0000000
--- a/prototype_2016/third_party/qml-material/scripts/icons.py
+++ /dev/null
@@ -1,74 +0,0 @@
1#! /usr/bin/env python2
2import sys
3import os.path
4import urllib
5
6
7def download_icon(name, out_dirname):
8 print(' - ' + name)
9 group, name = name.split('/')
10 url = ('https://raw.githubusercontent.com/google/material-design-icons/master/{}/svg/production/ic_{}_48px.svg'
11 .format(group, name))
12 filename = os.path.join(out_dirname, group + '_' + name + '.svg')
13
14 if not os.path.exists(filename):
15 urllib.urlretrieve(url, filename)
16
17
18def load_yaml(fileName):
19 from yaml import load
20 try:
21 from yaml import CLoader as Loader
22 except ImportError:
23 from yaml import Loader
24 stream = open(fileName, "r")
25 return load(stream, Loader=Loader)
26
27
28def download_icons(names, out_dirname):
29 resources = {}
30 for icon in names:
31 download_icon(icon, out_dirname)
32 group, name = icon.split('/')
33 if group in resources:
34 resources[group].append(name)
35 else:
36 resources[group] = [name]
37
38 text = '<!DOCTYPE RCC>\n<RCC version="1.0">\n\n'
39
40 for group, names in resources.items():
41 text += '<qresource prefix="/icons/{}">\n'.format(group)
42 for name in names:
43 text += '\t<file alias="{name}.svg">{group}_{name}.svg</file>\n'.format(group=group, name=name)
44 text += '</qresource>\n\n'
45
46 text += '</RCC>'
47
48 return text
49
50
51if __name__ == '__main__':
52 if len(sys.argv) > 1:
53 filename = sys.argv[1]
54 else:
55 filename = 'icons.yml'
56
57 config = load_yaml(filename)
58
59 icons = config.get('icons', [])
60 out_filename = config.get('out', 'icons')
61
62 if out_filename.endswith('.qrc'):
63 out_dirname = os.path.dirname(out_filename)
64 else:
65 out_dirname = out_filename
66 out_filename = os.path.join(out_dirname, 'icons.qrc')
67
68 if not os.path.exists(out_dirname):
69 os.makedirs(out_dirname)
70
71 qrc = download_icons(icons, out_dirname)
72
73 with open(out_filename, 'w') as f:
74 f.write(qrc)
diff --git a/prototype_2016/third_party/qml-material/scripts/lint.sh b/prototype_2016/third_party/qml-material/scripts/lint.sh
deleted file mode 100755
index 0f4785d..0000000
--- a/prototype_2016/third_party/qml-material/scripts/lint.sh
+++ /dev/null
@@ -1,38 +0,0 @@
1#! /bin/bash
2
3tempdir=$(mktemp -d /tmp/$REPO_NAME.XXXX)
4
5qmlfiles=$(find modules -type f -name \*qml -print)
6jsfiles=$(find modules -type f -name \*js -print)
7pyfiles=$(find modules -type f -name \*py -print)
8
9fail=0
10
11echo ">>> Checking QML files using qmllint"
12
13for file in $qmlfiles; do
14 qmllint $file || fail=1
15done
16
17echo ">>> Checking Python files using pyflakes and pep8"
18
19for file in $pyfiles; do
20 pyflakes $file || fail=1
21 pep8 $file || fail=1
22done
23
24echo ">>> Checking Javascript files using jshint"
25
26srcdir=$(pwd)
27
28cd $tempdir
29
30for file in $jsfiles; do
31 mkdir -p $(dirname $file)
32 sed "s/\.pragma .*//g; s/\.import .*//g" < $srcdir/$file > $file
33 jshint $file || fail=1
34done
35
36if [[ $fail == 1 ]]; then
37 exit 1
38fi
diff --git a/prototype_2016/third_party/qml-material/scripts/make_awesome.py b/prototype_2016/third_party/qml-material/scripts/make_awesome.py
deleted file mode 100755
index d21f89f..0000000
--- a/prototype_2016/third_party/qml-material/scripts/make_awesome.py
+++ /dev/null
@@ -1,89 +0,0 @@
1#!/usr/bin/env python3
2
3import requests
4import codecs
5import re
6
7# Don't include the gender icons from FontAwesome
8icon_blacklist = [
9 "genderless", "transgender.*", "neuter", "mars.*", "venus.*", "mercury.*",
10 "intersex"
11]
12
13js_template_header = """
14.pragma library
15
16var map = {
17"""
18
19js_template_footer = """
20};
21"""
22
23fontFilename = ''
24
25
26def is_blacklisted(icon_name):
27 for blacklisted_icon in icon_blacklist:
28 if re.match(blacklisted_icon, icon_name):
29 return True
30
31 return False
32
33
34def get_awesome_icons():
35 print('Downloading SCSS file...')
36
37 response = requests.get('http://raw.githubusercontent.com/FortAwesome/' +
38 'Font-Awesome/master/scss/_variables.scss')
39 icons = []
40
41 for line in response.text.split('\n'):
42 if not line.startswith('$fa-var-'):
43 continue
44
45 line_array = line[8:].strip().split(': ')
46
47 name = line_array[0].replace('-', '_')
48 code = line_array[1][2:].strip(';').strip('"')
49
50 icons.append((name, code))
51
52 return icons
53
54
55def save_icons(icons, filename):
56 saved_count = 0
57
58 with codecs.open(filename, encoding='utf-8', mode='w') as f:
59 f.write(js_template_header)
60
61 for icon_name, code in icons:
62 if not is_blacklisted(icon_name):
63 saved_count += 1
64 f.write(" '{0}': '\\u{1}',\n".format(icon_name, code))
65
66 f.write(js_template_footer)
67
68 print('Wrote {0} of {1} icons to {2}'.format(saved_count,
69 len(icons), filename))
70
71
72def download_font(url, filename):
73 print('Downloading font...')
74
75 response = requests.get(url)
76
77 with open(filename, 'wb') as out_file:
78 out_file.write(response.content)
79
80 print('Wrote {0}'.format(filename))
81
82
83if __name__ == '__main__':
84 icons = get_awesome_icons()
85 save_icons(icons, 'src/core/awesome.js')
86
87 download_font('http://github.com/FortAwesome/Font-Awesome/' +
88 'raw/master/fonts/FontAwesome.otf',
89 'src/core/FontAwesome.otf')
diff --git a/prototype_2016/third_party/qml-material/scripts/normalize_imports.sh b/prototype_2016/third_party/qml-material/scripts/normalize_imports.sh
deleted file mode 100755
index 3479316..0000000
--- a/prototype_2016/third_party/qml-material/scripts/normalize_imports.sh
+++ /dev/null
@@ -1,9 +0,0 @@
1#!/bin/bash
2
3ROOT=$1
4VERSION=$2
5
6for F in $(grep -rl "${ROOT}" .)
7do
8 sed -i '' -E "s/import ${ROOT} [0-9]+.[0-9]+/import ${ROOT} ${VERSION}/g" $F
9done
diff --git a/prototype_2016/third_party/qml-material/scripts/qrc.py b/prototype_2016/third_party/qml-material/scripts/qrc.py
deleted file mode 100755
index 0aeca11..0000000
--- a/prototype_2016/third_party/qml-material/scripts/qrc.py
+++ /dev/null
@@ -1,52 +0,0 @@
1#! /usr/bin/env python3
2
3# Generate a Qt Resource file from the contents of a list of directories
4# qrc.py <dir1> <dir2> ...
5
6import os
7import os.path
8
9
10def create_qrc(dirname, prefix=None):
11 basename = os.path.basename(dirname)
12
13 file_list = []
14
15 for root, dirs, files in os.walk(dirname):
16 file_list += [os.path.relpath(os.path.join(root, filename), dirname)
17 for filename in files]
18
19 file_list.sort()
20
21 contents = '<!DOCTYPE RCC>\n<RCC version="1.0">\n\n'
22
23 if prefix:
24 contents += '<qresource prefix="/{}">\n'.format(prefix)
25 else:
26 contents += '<qresource>\n'
27
28 for filename in file_list:
29 if (filename.endswith('.js') or filename.endswith('.qml') or
30 filename.endswith('.otf') or filename.endswith('.ttf') or
31 filename.endswith('.png') or filename.endswith('.jpg') or
32 filename.endswith('.jpeg') or filename.endswith('.svg') or
33 filename == 'qmldir'):
34 contents += '\t<file>' + filename + '</file>\n'
35
36 contents += '</qresource>\n\n</RCC>\n'
37
38 with open(os.path.join(dirname, basename + '.qrc'), 'w') as f:
39 f.write(contents)
40
41
42if __name__ == '__main__':
43 create_qrc('demo')
44 create_qrc('src/core', 'Material')
45 create_qrc('src/controls', 'Material')
46 create_qrc('src/components', 'Material')
47 create_qrc('src/extras', 'Material/Extras')
48 create_qrc('src/listitems', 'Material/ListItems')
49 create_qrc('src/popups', 'Material')
50 create_qrc('src/styles', 'QtQuick/Controls/Styles/Material')
51 create_qrc('src/window', 'Material')
52 create_qrc('fonts', 'Material/Fonts')
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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import QtQuick.Controls.Styles 1.3 as ControlStyles
14import Material 0.3
15import 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 */
26Controls.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
11import QtQuick 2.4
12import 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 */
21View {
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
11import QtQuick 2.4
12import QtQuick.Layouts 1.1
13import QtQuick.Controls 1.3 as Controls
14import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle
15import QtQuick.Controls.Styles 1.3
16import QtQuick.Controls.Private 1.0
17import 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 */
25Controls.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
11import QtQuick 2.4
12import Material 0.3
13import 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 */
21Item {
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
11import 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 */
19Rectangle {
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
11import QtQuick 2.4
12import Material 0.3
13import 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 */
21PopupBase {
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 */
20import QtQuick 2.4
21import QtQuick.Window 2.2
22import QtQuick.Controls 1.3 as Controls
23import QtQuick.Controls.Styles 1.3 as Styles
24import Material 0.3
25
26/*!
27 \qmltype ProgressCircle
28 \inqmlmodule Material
29
30 \brief Visual circular indicator of progress in some operation.
31*/
32Controls.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
11import QtQuick 2.4
12
13/*!
14 \qmltype Scrollbar
15 \inqmlmodule Material
16
17 \brief Scrollbars show scrolling progress for listviews and flickables.
18*/
19Item {
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
12import QtQuick 2.4
13import QtQuick.Layouts 1.1
14import Material 0.3
15
16/*!
17 \qmltype Snackbar
18 \inqmlmodule Material
19
20 \brief Snackbars provide lightweight feedback about an operation
21 */
22View {
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
11import QtQuick 2.4
12import 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 */
20Rectangle {
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
13import QtQuick 2.4
14import Material 0.3
15import Material.Extras 0.1
16import QtQuick.Controls 1.3 as QuickControls
17import QtQuick.Controls.Styles 1.3
18
19FocusScope {
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
12import QtQuick 2.4
13import Material 0.3
14import 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 */
30Popover {
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/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/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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle
14import 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 */
48Controls.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
12import QtQuick 2.4
13import QtQuick.Controls 1.3 as Controls
14import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle
15import 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 */
23Controls.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
11import QtQuick 2.4
12import 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 */
20Text {
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
12import QtQuick 2.4
13import QtQuick.Controls 1.3 as Controls
14import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle
15import Material 0.3
16
17/*!
18 \qmltype ProgressBar
19 \inqmlmodule Material
20
21 \brief Visual indicator of progress in some operation.
22*/
23
24Controls.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
12import QtQuick 2.4
13import QtQuick.Controls 1.3 as Controls
14import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle
15import 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*/
23Controls.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
12import QtQuick 2.4
13import Material 0.3
14import QtQuick.Controls 1.3 as Controls
15import 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 */
24Controls.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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import QtQuick.Controls.Styles 1.3 as ControlStyles
14
15import 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 */
23Controls.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
11import QtQuick 2.4
12import 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 */
22Controls.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
13import QtQuick 2.4
14import QtQuick.Controls 1.3 as Controls
15import QtQuick.Controls.Styles.Material 0.1 as MaterialStyle
16import Material 0.3
17
18/*!
19 \qmltype TextField
20 \inqmlmodule Material
21
22 \brief A single-line text input control.
23 */
24Controls.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
11import QtQuick 2.4
12import Material 0.3
13import "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 */
24Item {
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
12import QtQuick 2.4
13import QtQuick.Window 2.2
14import Material 0.3
15import 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*/
23Item {
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/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
11import QtQuick 2.4
12
13pragma Singleton
14
15/*!
16 \qmltype MaterialAnimation
17 \inqmlmodule Material
18
19 \brief A singleton with common animation durations.
20 */
21QtObject {
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
11import QtQuick 2.4
12
13/*!
14 \qmltype Object
15 \inqmlmodule Material
16
17 \brief A base class for non-visual objects.
18 */
19QtObject {
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
11import QtQuick 2.4
12
13pragma Singleton
14
15/*!
16 \qmltype Palette
17 \inqmlmodule Material
18
19 \brief Provides access to the Material Design color palette.
20 */
21Object {
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/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
11import QtQuick 2.4
12
13pragma 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 */
24Object {
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
11import 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 */
23QtObject {
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
11import 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*/
40Object {
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
11import QtQuick 2.4
12import QtGraphicalEffects 1.0
13import 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 */
22Item {
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
4var 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/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
22UnitsAttached::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
40void 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
52void 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
71int 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
82int UnitsAttached::dpi() const { return m_dpi; }
83
84qreal UnitsAttached::multiplier() const { return m_multiplier; }
85
86void UnitsAttached::setMultiplier(qreal multiplier)
87{
88 if (m_multiplier != multiplier) {
89 m_multiplier = multiplier;
90 emit multiplierChanged();
91 }
92}
93
94void 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
20class 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
27public:
28 UnitsAttached(QObject *attachee);
29
30 int dp() const;
31 int dpi() const;
32 qreal multiplier() const;
33
34public slots:
35 void setMultiplier(qreal multiplier);
36
37signals:
38 void dpChanged();
39 void multiplierChanged();
40
41protected slots:
42 void screenChanged(QScreen *);
43
44private:
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
56class Units : public QObject
57{
58 Q_OBJECT
59
60public:
61 static UnitsAttached *qmlAttachedProperties(QObject *object)
62 {
63 return new UnitsAttached(object);
64 }
65};
66
67QML_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
11function findRoot(obj) {
12 while (obj.parent) {
13 obj = obj.parent;
14 }
15
16 return obj;
17}
18
19function 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
36function 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
51function 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
67function 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
78function forEach(list, callback) {
79 for (var i = 0; i < length(list); i++) {
80 var item = getItem(list, i)
81 callback(item)
82 }
83}
84
85function 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
94function 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
12import QtQuick 2.4
13
14Grid {
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/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
11import QtQuick 2.4
12
13/*
14example usage:
15
16Rectangle {
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*/
35Item {
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
12import QtQuick 2.4
13
14Image {
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 @@
1module Material.Extras
2
3AutomaticGrid 0.1 AutomaticGrid.qml
4CircleImage 0.1 CircleImage.qml
5CircleMask 0.1 CircleMask.qml
6ColumnFlow 0.1 ColumnFlow.qml
7Image 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
11import QtQuick 2.4
12import 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 */
22View {
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 @@
1file(GLOB QML_FILES *.qml)
2
3install(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
11import QtQuick 2.4
12import Material 0.3
13
14/*!
15 \qmltype Divider
16 \inqmlmodule Material.ListItems
17
18 \brief A divider divides content in a list.
19 */
20Item {
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
12import QtQuick 2.4
13import QtQuick.Layouts 1.1
14import 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 */
22BaseListItem {
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
11import QtQuick 2.4
12import Material 0.3
13import 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 */
21Subtitled {
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
11import QtQuick 2.4
12import QtGraphicalEffects 1.0
13import QtQuick.Layouts 1.1
14import 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 */
22BaseListItem {
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
11import QtQuick 2.4
12import 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 */
20View {
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
12import QtQuick 2.4
13import QtQuick.Layouts 1.1
14import 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 */
22BaseListItem {
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 @@
1module Material.ListItems
2
3BaseListItem 0.1 BaseListItem.qml
4Divider 0.1 Divider.qml
5SimpleMenu 0.1 SimpleMenu.qml
6Standard 0.1 Standard.qml
7Subheader 0.1 Subheader.qml
8Subtitled 0.1 Subtitled.qml
9SectionHeader 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
18class MaterialRegisterHelper {
19
20public:
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
27void 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
16class MaterialPlugin : public QQmlExtensionPlugin
17{
18 Q_OBJECT
19 Q_PLUGIN_METADATA(IID "io.papyros.Material")
20
21public:
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
11import QtQuick 2.4
12import Material 0.3
13import 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 */
22BottomSheet {
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
12import QtQuick 2.4
13import 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 */
22PopupBase {
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
13import QtQuick 2.4
14import QtQuick.Layouts 1.1
15import Material 0.3
16import 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 */
24PopupBase {
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
11import QtQuick 2.4
12import QtQuick.Window 2.2
13import Material 0.3
14import 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 */
22PopupBase {
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
11import QtQuick 2.4
12import Material 0.3
13
14/*!
15 \qmltype InputDialog
16 \inqmlmodule Material
17
18 \brief A dialog with a single text field input.
19 */
20Dialog {
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 */
20import QtQuick 2.4
21import QtQuick.Layouts 1.1
22
23import Material 0.3
24import 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 */
32Item {
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
11import QtQuick 2.4
12import Material 0.3
13import 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 */
29PopupBase {
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
11import QtQuick 2.4
12import QtQuick.Window 2.2
13import Material 0.3
14import 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 */
22FocusScope {
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
11import QtQuick 2.4
12import Material 0.3
13
14Dialog {
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 @@
1module Material
2
3# This will be automatically uncommented when installing globally
4# plugin material
5
6# Components
7ActionButton 0.1 ActionButton.qml
8Card 0.1 Card.qml
9DatePicker 0.2 DatePicker.qml
10IconButton 0.1 IconButton.qml
11ProgressCircle 0.1 ProgressCircle.qml
12Scrollbar 0.1 Scrollbar.qml
13Snackbar 0.1 Snackbar.qml
14ThinDivider 0.1 ThinDivider.qml
15TimePicker 0.2 TimePicker.qml
16Tooltip 0.1 Tooltip.qml
17Wave 0.1 Wave.qml
18
19# Controls
20Action 0.1 Action.qml
21Button 0.1 Button.qml
22CheckBox 0.1 CheckBox.qml
23Label 0.1 Label.qml
24ProgressBar 0.1 ProgressBar.qml
25RadioButton 0.1 RadioButton.qml
26Slider 0.1 Slider.qml
27Switch 0.1 Switch.qml
28Tab 0.1 Tab.qml
29TextField 0.1 TextField.qml
30
31# Core
32AwesomeIcon 0.1 AwesomeIcon.qml
33Icon 0.1 Icon.qml
34Ink 0.1 Ink.qml
35Object 0.1 Object.qml
36PlatformExtensions 0.2 PlatformExtensions.qml
37UnitsHelper 0.3 UnitsHelper.qml
38View 0.1 View.qml
39Utils 0.3 utils.js
40singleton MaterialAnimation 0.1 MaterialAnimation.qml
41singleton Palette 0.1 Palette.qml
42singleton Theme 0.1 Theme.qml
43
44# Popups
45BottomActionSheet 0.1 BottomActionSheet.qml
46BottomSheet 0.1 BottomSheet.qml
47Dialog 0.1 Dialog.qml
48Dropdown 0.1 Dropdown.qml
49InputDialog 0.1 InputDialog.qml
50MenuField 0.1 MenuField.qml
51Popover 0.2 Popover.qml
52PopupBase 0.1 PopupBase.qml
53TimePickerDialog 0.2 TimePickerDialog.qml
54
55# Window
56ActionBar 0.1 ActionBar.qml
57AppTheme 0.1 AppTheme.qml
58ApplicationWindow 0.1 ApplicationWindow.qml
59MainView 0.1 MainView.qml
60NavigationDrawer 0.1 NavigationDrawer.qml
61NavigationDrawerPage 0.2 NavigationDrawerPage.qml
62OverlayLayer 0.1 OverlayLayer.qml
63OverlayView 0.1 OverlayView.qml
64Page 0.1 Page.qml
65PageSidebar 0.1 PageSidebar.qml
66PageStack 0.1 PageStack.qml
67Window 0.1 Window.qml
68Sidebar 0.1 Sidebar.qml
69TabBar 0.1 TabBar.qml
70TabbedPage 0.2 TabbedPage.qml
71Toolbar 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 @@
1TEMPLATE = lib
2TARGET = material
3
4CONFIG += c++11
5QT += qml quick
6
7
8android {
9 QT += androidextras svg xml
10}
11
12HEADERS += plugin.h \
13 core/device.h \
14 core/units.h
15
16SOURCES += plugin.cpp \
17 core/device.cpp \
18 core/units.cpp
19
20RESOURCES += ../icons/core_icons.qrc
21
22isEmpty(MODULE_INSTALL_PATH) {
23 MODULE_INSTALL_PATH = $$[QT_INSTALL_QML]
24}
25
26target.path = $$MODULE_INSTALL_PATH/Material
27
28material.files += \
29 components/* \
30 controls/* \
31 core/* \
32 popups/* \
33 window/*
34material.path = $$MODULE_INSTALL_PATH/Material
35
36extras.files += extras/*
37extras.path = $$MODULE_INSTALL_PATH/Material/Extras
38
39listitems.files += listitems/*
40listitems.path = $$MODULE_INSTALL_PATH/Material/ListItems
41
42styles.files += styles/*
43styles.path = $$MODULE_INSTALL_PATH/QtQuick/Controls/Styles/Material
44
45qmldir.target = $$OUT_PWD/out/qmldir
46qmldir.commands = mkdir -p $$OUT_PWD/out;
47qmldir.commands += sed \"s/$$LITERAL_HASH plugin material/plugin material/\" $$PWD/qmldir > $$qmldir.target
48qmldir.depends = $$PWD/qmldir
49qmldir.path = $$MODULE_INSTALL_PATH/Material
50qmldir.files = $$qmldir.target
51qmldir.CONFIG += no_check_exist
52
53INSTALLS += target material extras listitems styles qmldir
54
55OTHER_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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14
15ApplicationWindowStyle {
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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14
15ButtonStyle {
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 @@
1file(GLOB QML_FILES *.qml)
2
3install(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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14
15CheckBoxStyle {
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
12import QtQuick 2.4
13import QtQuick.Controls.Styles 1.3
14import Material 0.3
15
16ProgressBarStyle {
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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14
15RadioButtonStyle {
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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14
15SliderStyle {
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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14
15SwitchStyle {
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
12import QtQuick 2.4
13import QtQuick.Controls.Styles 1.3
14import QtQuick.Layouts 1.1
15import Material 0.3
16
17TextFieldStyle {
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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14
15ToolBarStyle {
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
11import QtQuick 2.4
12import QtQuick.Controls.Styles 1.3
13import Material 0.3
14import "../Base/"
15
16ToolButtonStyle {
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 @@
1module QtQuick.Controls.Styles.Material
2
3ApplicationWindowStyle 0.1 ApplicationWindowStyle.qml
4ButtonStyle 0.1 ButtonStyle.qml
5CheckBoxStyle 0.1 CheckBoxStyle.qml
6ProgressBarStyle 0.1 ProgressBarStyle.qml
7SwitchStyle 0.1 SwitchStyle.qml
8ToolBarStyle.qml 0.1 ToolBarStyle.qml
9ToolButtonStyle.qml 0.1 ToolButtonStyle.qml
10RadioButtonStyle 0.1 RadioButtonStyle.qml
11SliderStyle 0.1 SliderStyle.qml
12TextFieldStyle 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
12import QtQuick 2.4
13import QtQuick.Layouts 1.1
14import Material 0.3
15import 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 */
31Item {
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
11import QtQuick 2.4
12import 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 */
20QtObject {
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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import QtQuick.Window 2.2
14import Material 0.3
15import 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*/
49Controls.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
11import QtQuick 2.4
12import QtQuick.Window 2.2
13import 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 */
21Item {
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
12import QtQuick 2.4
13import 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 */
21PopupBase {
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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13
14Page {
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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import 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 */
57FocusScope {
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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import 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 */
22Page {
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/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
11import QtQuick 2.4
12import QtQuick.Layouts 1.1
13
14import Material 0.3
15import Material.ListItems 0.1
16
17Item {
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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import 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 */
23Page {
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
11import QtQuick 2.4
12import QtQuick.Controls 1.3 as Controls
13import QtQuick.Layouts 1.1
14import 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*/
23View {
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
11import QtQuick 2.4
12import Material 0.3
13import 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*/
33Window {
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>
diff --git a/prototype_2016/third_party/qml-material/styles_demo/Makefile b/prototype_2016/third_party/qml-material/styles_demo/Makefile
deleted file mode 100644
index e105b26..0000000
--- a/prototype_2016/third_party/qml-material/styles_demo/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
1run:
2 QT_QUICK_CONTROLS_STYLE=Material qmlscene -I ../modules/ main.qml
diff --git a/prototype_2016/third_party/qml-material/styles_demo/main.qml b/prototype_2016/third_party/qml-material/styles_demo/main.qml
deleted file mode 100644
index 77ee716..0000000
--- a/prototype_2016/third_party/qml-material/styles_demo/main.qml
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2015 Michael Spencer <sonrisesoftware@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18import QtQuick 2.4
19import QtQuick.Controls 1.3
20import QtQuick.Window 2.2
21import QtQuick.Dialogs 1.2
22import QtQuick.Layouts 1.1
23
24ApplicationWindow {
25 title: qsTr("Hello World")
26 width: 640
27 height: 480
28
29 menuBar: MenuBar {
30 Menu {
31 title: qsTr("&File")
32 MenuItem {
33 text: qsTr("&Open")
34 onTriggered: messageDialog.show(qsTr("Open action triggered"));
35 }
36 MenuItem {
37 text: qsTr("E&xit")
38 onTriggered: Qt.quit();
39 }
40 }
41 }
42
43 toolBar: ToolBar {
44 ToolButton {
45 text: "Test"
46 anchors.verticalCenter: parent.verticalCenter
47 }
48 }
49
50 ColumnLayout {
51 anchors.centerIn: parent
52
53 CheckBox {
54 id: checkBox1
55 anchors.horizontalCenter: parent.horizontalCenter
56 text: qsTr("Check Box")
57 }
58
59 RadioButton {
60 id: radioButton1
61 anchors.horizontalCenter: parent.horizontalCenter
62 text: qsTr("Radio button")
63 }
64
65 Slider {
66 anchors.horizontalCenter: parent.horizontalCenter
67 }
68
69 GridLayout {
70 anchors.horizontalCenter: parent.horizontalCenter
71 TextField {
72 placeholderText: "Type in contact's name"
73 }
74 TextField {
75 placeholderText: "Type in contact's phone"
76 }
77 }
78
79 RowLayout {
80 anchors.horizontalCenter: parent.horizontalCenter
81
82 Button {
83 id: button1
84 text: qsTr("Press Me 1")
85 onClicked: messageDialog.show(qsTr("Button 1 pressed"))
86 }
87
88 Button {
89 id: button2
90 text: qsTr("Press Me 2")
91 onClicked: messageDialog.show(qsTr("Button 2 pressed"))
92 }
93
94 Button {
95 id: button3
96 text: qsTr("Press Me 3")
97 onClicked: messageDialog.show(qsTr("Button 3 pressed"))
98 }
99 }
100 }
101
102 MessageDialog {
103 id: messageDialog
104 title: qsTr("May I have your attention, please?")
105
106 function show(caption) {
107 messageDialog.text = caption;
108 messageDialog.open();
109 }
110 }
111}
diff --git a/prototype_2016/third_party/qml-material/tests/icons.yml b/prototype_2016/third_party/qml-material/tests/icons.yml
deleted file mode 100644
index 3fe1625..0000000
--- a/prototype_2016/third_party/qml-material/tests/icons.yml
+++ /dev/null
@@ -1,6 +0,0 @@
1out: icons
2icons:
3 - action/alarm
4 - action/search
5 - action/settings
6 - content/add
diff --git a/prototype_2016/third_party/qml-material/tests/icons/action_alarm.svg b/prototype_2016/third_party/qml-material/tests/icons/action_alarm.svg
deleted file mode 100644
index 1a5c539..0000000
--- a/prototype_2016/third_party/qml-material/tests/icons/action_alarm.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M44 11.44l-9.19-7.71-2.57 3.06 9.19 7.71L44 11.44zM15.76 6.78l-2.57-3.06L4 11.43l2.57 3.06 9.19-7.71zM25 16h-3v12l9.49 5.71L33 31.24l-8-4.74V16zm-1.01-8C14.04 8 6 16.06 6 26s8.04 18 17.99 18S42 35.94 42 26 33.94 8 23.99 8zM24 40c-7.73 0-14-6.27-14-14s6.27-14 14-14 14 6.27 14 14-6.26 14-14 14z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/tests/icons/action_search.svg b/prototype_2016/third_party/qml-material/tests/icons/action_search.svg
deleted file mode 100644
index be555cd..0000000
--- a/prototype_2016/third_party/qml-material/tests/icons/action_search.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M31 28h-1.59l-.55-.55C30.82 25.18 32 22.23 32 19c0-7.18-5.82-13-13-13S6 11.82 6 19s5.82 13 13 13c3.23 0 6.18-1.18 8.45-3.13l.55.55V31l10 9.98L40.98 38 31 28zm-12 0c-4.97 0-9-4.03-9-9s4.03-9 9-9 9 4.03 9 9-4.03 9-9 9z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/tests/icons/action_settings.svg b/prototype_2016/third_party/qml-material/tests/icons/action_settings.svg
deleted file mode 100644
index 7a01c33..0000000
--- a/prototype_2016/third_party/qml-material/tests/icons/action_settings.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3c-1.22.51-2.35 1.17-3.38 1.97L9.9 10.1c-.45-.17-.97 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3c1.22-.51 2.35-1.17 3.38-1.97l4.98 2.01c.45.17.97 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/tests/icons/content_add.svg b/prototype_2016/third_party/qml-material/tests/icons/content_add.svg
deleted file mode 100644
index 2b3a796..0000000
--- a/prototype_2016/third_party/qml-material/tests/icons/content_add.svg
+++ /dev/null
@@ -1 +0,0 @@
1<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M38 26H26v12h-4V26H10v-4h12V10h4v12h12v4z"/></svg> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/tests/icons/icons.qrc b/prototype_2016/third_party/qml-material/tests/icons/icons.qrc
deleted file mode 100644
index b0e9440..0000000
--- a/prototype_2016/third_party/qml-material/tests/icons/icons.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
1<!DOCTYPE RCC>
2<RCC version="1.0">
3
4<qresource prefix="/icons/action">
5 <file alias="alarm.svg">action_alarm.svg</file>
6 <file alias="search.svg">action_search.svg</file>
7 <file alias="settings.svg">action_settings.svg</file>
8</qresource>
9
10<qresource prefix="/icons/content">
11 <file alias="add.svg">content_add.svg</file>
12</qresource>
13
14</RCC> \ No newline at end of file
diff --git a/prototype_2016/third_party/qml-material/tests/tests.cpp b/prototype_2016/third_party/qml-material/tests/tests.cpp
deleted file mode 100755
index 6d01cdf..0000000
--- a/prototype_2016/third_party/qml-material/tests/tests.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2014 Michael Spencer
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <QtQuickTest/QtQuickTest>
20QUICK_TEST_MAIN(material)
diff --git a/prototype_2016/third_party/qml-material/tests/tests.pro b/prototype_2016/third_party/qml-material/tests/tests.pro
deleted file mode 100644
index dd81acd..0000000
--- a/prototype_2016/third_party/qml-material/tests/tests.pro
+++ /dev/null
@@ -1,9 +0,0 @@
1TEMPLATE = app
2TARGET = tst_material
3CONFIG += warn_on qmltestcase no_testcase_installs
4SOURCES += tests.cpp
5
6RESOURCES += icons/icons.qrc
7
8OTHER_FILES += tst_card.qml \
9 tst_pagestack.qml
diff --git a/prototype_2016/third_party/qml-material/tests/tst_actionbar.qml b/prototype_2016/third_party/qml-material/tests/tst_actionbar.qml
deleted file mode 100644
index bc52522..0000000
--- a/prototype_2016/third_party/qml-material/tests/tst_actionbar.qml
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2015 Michael Spencer <sonrisesoftware@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import QtTest 1.0
21import Material 0.2
22
23Rectangle {
24 width: 400
25 height: 800
26
27 ActionBar {
28 id: actionBar
29
30 width: parent.width
31
32 actions: [
33 Action {
34 id: action1
35 name: "Action 1"
36 iconName: "content/add"
37 objectName: "action1"
38 },
39 Action {
40 name: "Action 2"
41 iconName: "action/search"
42 },
43 Action {
44 name: "Action 3"
45 iconName: "action/settings"
46 },
47 Action {
48 id: action4
49 name: "Action 4"
50 objectName: "action4"
51 iconName: "action/alarm"
52 }
53 ]
54 }
55
56 OverlayLayer {
57 id: tooltipOverlayLayer
58 objectName: "tooltipOverlayLayer"
59 }
60
61 OverlayLayer {
62 id: overlayLayer
63 }
64
65 SignalSpy {
66 id: action1Spy
67 target: action1
68 signalName: "triggered"
69 }
70
71 SignalSpy {
72 id: action4Spy
73 target: action4
74 signalName: "triggered"
75 }
76
77 SignalSpy {
78 id: overflowSpy
79 target: testCase.findChild(actionBar, "action/overflow")
80 signalName: "clicked"
81 }
82
83 TestCase {
84 id: testCase
85 when: windowShown
86 name: "ActionBar Test"
87
88 function init() {
89 var button = testCase.findChild(actionBar, "action/overflow")
90 var overflow = testCase.findChild(actionBar, "overflowMenu")
91 verify(button != null)
92 verify(overflow != null)
93
94 if (overflow.showing) {
95 mouseClick(button, 10, 10)
96 wait(10000)
97 }
98
99 verify(!overflow.showing)
100
101 overflowSpy.clear()
102 }
103
104 function test_click_action() {
105 var button = testCase.findChild(actionBar, "action/" + action1.objectName)
106
107 verify(button != null)
108
109 compare(action1Spy.count, 0)
110 mouseClick(button, 10, 10)
111 wait(10000) // Wait for the overflow to fully open
112 compare(action1Spy.count, 1)
113 }
114
115 function test_open_overflow() {
116 var button = testCase.findChild(actionBar, "action/overflow")
117 var overflow = testCase.findChild(actionBar, "overflowMenu")
118
119 verify(button != null)
120 verify(overflow != null)
121
122 verify(!overflow.showing)
123 compare(overflowSpy.count, 0)
124 mouseClick(button, 10, 10)
125 wait(10000) // Wait for the overflow to fully open
126 compare(overflowSpy.count, 1)
127 verify(overflow.showing)
128 }
129
130 function test_click_action_in_overflow() {
131 var button = testCase.findChild(actionBar, "action/overflow")
132 var listItem = testCase.findChild(actionBar, "action/" + action4.objectName)
133 var overflow = testCase.findChild(actionBar, "overflowMenu")
134
135 verify(button != null)
136 verify(listItem != null)
137 verify(overflow != null)
138
139 compare(action4Spy.count, 0)
140 mouseClick(button, 10, 10)
141
142 wait(10000) // Wait for the overflow to fully open
143
144 verify(overflow.showing)
145 mouseClick(listItem, 10, 10)
146 compare(action4Spy.count, 1)
147
148 wait(400)
149 }
150 }
151}
diff --git a/prototype_2016/third_party/qml-material/tests/tst_card.qml b/prototype_2016/third_party/qml-material/tests/tst_card.qml
deleted file mode 100755
index 8ef29c1..0000000
--- a/prototype_2016/third_party/qml-material/tests/tst_card.qml
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2014 Michael Spencer
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import QtTest 1.0
21import Material 0.2
22
23Card {
24 width: 100
25 height: 100
26 id: card
27
28 TestCase {
29 name: "Card Test"
30 when: windowShown
31
32 function test_showCard() {
33 wait(2000);
34 }
35 }
36
37}
diff --git a/prototype_2016/third_party/qml-material/tests/tst_pagestack.qml b/prototype_2016/third_party/qml-material/tests/tst_pagestack.qml
deleted file mode 100755
index 6b90c9a..0000000
--- a/prototype_2016/third_party/qml-material/tests/tst_pagestack.qml
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * QML Material - An application framework implementing Material Design.
3 * Copyright (C) 2014 Michael Spencer
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import QtTest 1.0
21import Material 0.2
22
23Rectangle {
24 width: 100
25 height: 100
26
27 ApplicationWindow {
28 id: mainwin
29 title: "Application Name"
30 width: 100
31 height: 100
32
33 initialPage: Page {
34 id: page
35 title: "Page Title"
36
37 Label {
38 anchors.centerIn: parent
39 text: "Hello World!"
40 }
41 }
42
43 Component.onCompleted: mainwin.show()
44 }
45
46 TestCase {
47 name: "PageStack Test"
48 when: mainwin.visible
49
50 function test_showCard() {
51 wait(2000);
52 console.log('here');
53
54 verify( page !== null )
55 verify( page !== undefined )
56 }
57 }
58
59}
diff --git a/prototype_2016/third_party/qml-material/vendor.cmake b/prototype_2016/third_party/qml-material/vendor.cmake
deleted file mode 100644
index 9bb3abf..0000000
--- a/prototype_2016/third_party/qml-material/vendor.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
1set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
2
3set(VENDOR_SOURCES ${VENDOR_SOURCES}
4 ${CMAKE_CURRENT_LIST_DIR}/src/plugin.h
5 ${CMAKE_CURRENT_LIST_DIR}/src/core/device.h
6 ${CMAKE_CURRENT_LIST_DIR}/src/core/units.h
7 ${CMAKE_CURRENT_LIST_DIR}/src/plugin.cpp
8 ${CMAKE_CURRENT_LIST_DIR}/src/core/device.cpp
9 ${CMAKE_CURRENT_LIST_DIR}/src/core/units.cpp
10 ${CMAKE_CURRENT_LIST_DIR}/src/material.qrc
11 ${CMAKE_CURRENT_LIST_DIR}/src/components/components.qrc
12 ${CMAKE_CURRENT_LIST_DIR}/src/controls/controls.qrc
13 ${CMAKE_CURRENT_LIST_DIR}/src/core/core.qrc
14 ${CMAKE_CURRENT_LIST_DIR}/src/extras/extras.qrc
15 ${CMAKE_CURRENT_LIST_DIR}/src/listitems/listitems.qrc
16 ${CMAKE_CURRENT_LIST_DIR}/src/popups/popups.qrc
17 ${CMAKE_CURRENT_LIST_DIR}/src/styles/styles.qrc
18 ${CMAKE_CURRENT_LIST_DIR}/src/window/window.qrc
19 ${CMAKE_CURRENT_LIST_DIR}/icons/core_icons.qrc)
diff --git a/prototype_2016/third_party/qml-rust/.gitignore b/prototype_2016/third_party/qml-rust/.gitignore
deleted file mode 100644
index 4497ede..0000000
--- a/prototype_2016/third_party/qml-rust/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
1target
2Cargo.lock
3DOtherSide
4/*.qml
diff --git a/prototype_2016/third_party/qml-rust/Cargo.toml b/prototype_2016/third_party/qml-rust/Cargo.toml
deleted file mode 100644
index 404dd7f..0000000
--- a/prototype_2016/third_party/qml-rust/Cargo.toml
+++ /dev/null
@@ -1,19 +0,0 @@
1[package]
2name = "qml"
3version = "0.0.5"
4authors = ["White-Oak <lpzhelud@gmail.com>"]
5build = "build.rs"
6
7description = "Safe QML bindings for Rust"
8repository = "https://github.com/White-Oak/qml-rust"
9readme = "README.md"
10keywords = ["QML", "FFI", "Qt", "bindings", "GUI"]
11license = "MIT"
12
13
14[dependencies]
15libc = { path = "../libc", version = "0.2" }
16lazy_static = { path = "../lazy-static.rs", version = "0.2" }
17
18[build-dependencies]
19pkg-config = { path = "../pkg-config-rs", version = "0.3" }
diff --git a/prototype_2016/third_party/qml-rust/LICENSE b/prototype_2016/third_party/qml-rust/LICENSE
deleted file mode 100644
index 63b6955..0000000
--- a/prototype_2016/third_party/qml-rust/LICENSE
+++ /dev/null
@@ -1,7 +0,0 @@
1Copyright (c) 2016 White-Oak
2
3Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
5The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
7THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/prototype_2016/third_party/qml-rust/README.md b/prototype_2016/third_party/qml-rust/README.md
deleted file mode 100644
index aca316e..0000000
--- a/prototype_2016/third_party/qml-rust/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
1# QML-rust - bindings for [Qt Quick](http://doc.qt.io/qt-5/qtquick-index.html)
2Bindings are based on [DOtherSide](https://github.com/filcuc/DOtherSide) C bindings for QML
3Library is mostly feature-compliant with other bindings based on the library, but lacks some minor features and has quite a few bugs.
4
5## [Early documentation](https://white-oak.github.io/qml-rust/qml/)
6# Examples
7All examples are located in a folder [`examples/`](examples), under `example_name.rs` and `example_name.qml` names.
8
9* `cargo run --example properties` for setting properties from Rust to QML.
10* `cargo run --example listmodel` for an example of providing QML with list model from Rust.
11* `cargo run --example listmodel_macro` for the same example, but using `Q_LISTMODEL!` macro.
12* `cargo run --example sigslots` for an example of how to create your own `QObject` with signals and slots, and to communicate between QML and Rust. Also shows how to use `Q_OBJECT!` macro.
13* `cargo run --example qvarlists` for an example of how to use `qvarlist!` macro to easily form `QVariant` (used to pass data to QML) of a complex array.
14* `cargo run --example threaded` for an example of multithreading.
15* `cargo run --example qmlregister` for an example of how to register and use your own types from Rust in QML.
16
17Requires CMake, Make, Qt (Core, Gui, Widgets, Quick) and, of course, Rust.
18
19## In-app examples
20
21* [Architect](https://github.com/White-Oak/architect) - an app showing some git stats,
22using qml-rust to provide properties and lists to QML in [here](https://github.com/White-Oak/architect/blob/master/src/view/qt.rs).
23* [Kefia](https://github.com/White-Oak/kefia) - A simple package manager, that provides a QListModel to QML, registers a QObject with slots and communicates between QML and Rust,
24[here](https://github.com/White-Oak/kefia/blob/master/src/view.rs).
25
26# Status
27Done:
28* Basic initialization and execution.
29* Providing properties to QML files.
30* QAbstractListModels - provides changable models for QML items (early draft, still lacks proper mutability).
31* QObjects: slots, signals (limited properties support). Emitting signals and receiving slots works.
32* Registering your own QML types (singletons or not) from Rust code.
33
34To be done:
35* the library is mostly done, but some stuff is lacking polish, like possible memory leaks or better macro designs.
diff --git a/prototype_2016/third_party/qml-rust/build.rs b/prototype_2016/third_party/qml-rust/build.rs
deleted file mode 100644
index 606d653..0000000
--- a/prototype_2016/third_party/qml-rust/build.rs
+++ /dev/null
@@ -1,21 +0,0 @@
1extern crate pkg_config;
2use std::env;
3use std::process::Command;
4use std::path::*;
5use pkg_config::*;
6
7fn main() {
8 Command::new("sh")
9 .arg("build_lib.sh")
10 .output()
11 .unwrap_or_else(|e| panic!("failed to execute process: {}", e));
12 let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
13 let path = Path::new(&manifest_dir).join("DOtherSide").join("build").join("lib");
14
15 println!("cargo:rustc-link-search=native={}", path.display());
16 println!("cargo:rerun-if-changed={}", path.display());
17 println!("cargo:rustc-link-lib=static=DOtherSideStatic");
18 println!("cargo:rustc-link-lib=dylib=stdc++");
19
20 Config::new().probe("Qt5Core Qt5Gui Qt5Qml Qt5Quick Qt5Widgets").unwrap();
21}
diff --git a/prototype_2016/third_party/qml-rust/build_lib.sh b/prototype_2016/third_party/qml-rust/build_lib.sh
deleted file mode 100644
index 2612e11..0000000
--- a/prototype_2016/third_party/qml-rust/build_lib.sh
+++ /dev/null
@@ -1,8 +0,0 @@
1ln -sn ../DOtherSide DOtherSide
2cd DOtherSide
3rm -rf build
4mkdir build
5cd build
6
7cmake ..
8make DOtherSideStatic
diff --git a/prototype_2016/third_party/qml-rust/examples/listmodel.qml b/prototype_2016/third_party/qml-rust/examples/listmodel.qml
deleted file mode 100644
index 978bf1d..0000000
--- a/prototype_2016/third_party/qml-rust/examples/listmodel.qml
+++ /dev/null
@@ -1,24 +0,0 @@
1import QtQuick 2.2
2import QtQuick.Controls 1.2
3import QtQuick.Layouts 1.1
4import QtQuick.Window 2.1
5
6ApplicationWindow
7{
8 x: 400
9 y: 200
10 width: 400
11 height: 300
12 title: "SimpleData"
13 Component.onCompleted: visible = true
14
15 ListView {
16 width: 400
17 height: 300
18
19 model: listModel
20 delegate: Text {
21 text: name + ": " + number
22 }
23 }
24}
diff --git a/prototype_2016/third_party/qml-rust/examples/listmodel.rs b/prototype_2016/third_party/qml-rust/examples/listmodel.rs
deleted file mode 100644
index 07d99e8..0000000
--- a/prototype_2016/third_party/qml-rust/examples/listmodel.rs
+++ /dev/null
@@ -1,17 +0,0 @@
1#[macro_use]
2extern crate qml;
3
4use qml::*;
5
6fn main() {
7 let qqae = QmlEngine::new();
8 let mut qalm = QListModel::new(&["name", "number"]);
9 qalm.insert_row(qvarlist!["John", 42].into_iter());
10 qalm.insert_row(qvarlist!["Oak", 505].into_iter());
11 qqae.set_property("listModel", &qalm.get_qvar());
12
13 qqae.load_file("examples/listmodel.qml");
14 qalm.set_data(vec![qvarlist!["OMG", 13317], qvarlist!["HACKED", 228]]);
15 qqae.exec();
16 qqae.quit();
17}
diff --git a/prototype_2016/third_party/qml-rust/examples/listmodel_macro.rs b/prototype_2016/third_party/qml-rust/examples/listmodel_macro.rs
deleted file mode 100644
index 7b4b685..0000000
--- a/prototype_2016/third_party/qml-rust/examples/listmodel_macro.rs
+++ /dev/null
@@ -1,25 +0,0 @@
1#[macro_use]
2extern crate qml;
3
4use qml::*;
5
6Q_LISTMODEL!{
7 pub QTestModel {
8 name: String,
9 number: i32,
10 }
11}
12
13fn main() {
14 let mut qqae = QmlEngine::new();
15 let mut qalm = QTestModel::new();
16 qalm.insert_row("John".into(), 42);
17 qalm.insert_row("Oak".into(), 505);
18 // `&QTestModel` implements `Into<QVariant>`
19 qqae.set_and_store_property("listModel", qalm.get_qvar());
20
21 qqae.load_file("examples/listmodel.qml");
22 qalm.set_data(vec![("OMG".into(), 13317), ("HACKED".into(), 228)]);
23 qqae.exec();
24 qqae.quit();
25}
diff --git a/prototype_2016/third_party/qml-rust/examples/properties.qml b/prototype_2016/third_party/qml-rust/examples/properties.qml
deleted file mode 100644
index 4dd58e4..0000000
--- a/prototype_2016/third_party/qml-rust/examples/properties.qml
+++ /dev/null
@@ -1,33 +0,0 @@
1import QtQuick 2.2
2import QtQuick.Controls 1.2
3import QtQuick.Layouts 1.1
4import QtQuick.Window 2.1
5
6ApplicationWindow
7{
8 width: 400
9 height: 300
10 title: "SimpleData"
11 Component.onCompleted: visible = true
12
13 ColumnLayout
14 {
15 anchors.fill: parent
16 Text{
17 text: "Wait"
18 Component.onCompleted: text = testArrayProperty()
19
20 function testArrayProperty() {
21 if (typeof values == 'undefined')
22 return "No array"
23 return values[0] == 42 && values[1] == 43
24 }
25 }
26 SpinBox { value: qVar1 }
27 TextField { text: qVar2 }
28 CheckBox { checked: qVar3 }
29 SpinBox { value: qVar4; decimals: 1 }
30
31 }
32
33}
diff --git a/prototype_2016/third_party/qml-rust/examples/properties.rs b/prototype_2016/third_party/qml-rust/examples/properties.rs
deleted file mode 100644
index ca85ef7..0000000
--- a/prototype_2016/third_party/qml-rust/examples/properties.rs
+++ /dev/null
@@ -1,16 +0,0 @@
1extern crate qml;
2
3use qml::*;
4fn main() {
5 let mut qqae = QmlEngine::new();
6 let qvar: QVariant = 10.into();
7 qqae.set_and_store_property("qVar1", 5);
8 qqae.set_and_store_property("qVar2", 8.6);
9 qqae.set_property("qVar3", &qvar);
10 qqae.set_property("qVar4", &qvar);
11 let vec: Vec<QVariant> = vec![42.into(), 43.into()];
12 qqae.set_and_store_property("values", vec);
13 qqae.load_file("examples/properties.qml");
14 qqae.exec();
15 qqae.quit();
16}
diff --git a/prototype_2016/third_party/qml-rust/examples/qmlregister.qml b/prototype_2016/third_party/qml-rust/examples/qmlregister.qml
deleted file mode 100644
index 6dafdd7..0000000
--- a/prototype_2016/third_party/qml-rust/examples/qmlregister.qml
+++ /dev/null
@@ -1,17 +0,0 @@
1import QtQuick 2.2
2import TestModule 1.0
3
4Item {
5 TestRsObject{
6 id: rsRegistered
7
8 name: "Oak"
9 }
10 Component.onCompleted: {
11 console.log(rsRegistered.name)
12 rsRegistered.name = "This is working"
13 console.log(rsRegistered.name)
14 rsRegistered.assure_everything_okay()
15 console.log(TestRsSingleton.temp)
16 }
17}
diff --git a/prototype_2016/third_party/qml-rust/examples/qmlregister.rs b/prototype_2016/third_party/qml-rust/examples/qmlregister.rs
deleted file mode 100644
index 55ab2d8..0000000
--- a/prototype_2016/third_party/qml-rust/examples/qmlregister.rs
+++ /dev/null
@@ -1,46 +0,0 @@
1#[macro_use]
2extern crate qml;
3use std::thread;
4use std::sync::*;
5use std::time::Duration;
6
7use qml::*;
8
9#[derive(Default)]
10pub struct Test;
11
12impl QTest {
13 fn assure_everything_okay(&mut self) -> Option<&QVariant> {
14 println!("It's okay");
15 None
16 }
17}
18
19Q_OBJECT!(
20pub Test as QTest{
21 signals:
22 slots:
23 fn assure_everything_okay();
24 properties:
25 name: String; read: get_name, write: set_name, notify: name_changed;
26});
27
28Q_OBJECT!(
29pub Test as QTestSingleton{
30 signals:
31 slots:
32 properties:
33 temp: i32; read: get_temp, write: set_temp, notify: temp_changed;
34});
35
36Q_REGISTERABLE_QML!(QTest: Test as TestRsObject 1=>0, from TestModule);
37Q_REGISTERABLE_QML!(QTestSingleton: Test as TestRsSingleton 1=>0, from TestModule);
38fn main() {
39 let mut qqae = QmlEngine::new();
40 Q_REGISTER_QML!(QTest);
41 Q_REGISTER_SINGLETON_QML!(QTestSingleton);
42 qqae.load_file("examples/qmlregister.qml");
43 qqae.exec();
44
45 qqae.quit();
46}
diff --git a/prototype_2016/third_party/qml-rust/examples/qobjects.rs b/prototype_2016/third_party/qml-rust/examples/qobjects.rs
deleted file mode 100644
index d03eda4..0000000
--- a/prototype_2016/third_party/qml-rust/examples/qobjects.rs
+++ /dev/null
@@ -1,31 +0,0 @@
1#[macro_use]
2extern crate qml;
3
4use qml::*;
5
6pub struct Test;
7
8impl Test {
9 pub fn launchGoose(&self, i: i32, i2: String) -> Option<&QVariant> {
10 println!("GOOSE HI from {} and {}", i2, i);
11 None
12 }
13}
14
15Q_OBJECT!(
16pub Test as QTest{
17 signals:
18 fn testname (a: i32, b: i32);
19 slots:
20 fn launchGoose(i: i32, launchText: String);
21 properties:
22});
23
24fn main() {
25 let mut qqae = QmlEngine::new();
26 let mut qtest = QTest::new(Test);
27 qtest.testname(54, 55);
28 qtest.qslot_call("launchGoose",
29 vec![42.into(), "QML Rust".to_string().into()]);
30 println!("{:?}", qtest.qmeta());
31}
diff --git a/prototype_2016/third_party/qml-rust/examples/qvarlists.qml b/prototype_2016/third_party/qml-rust/examples/qvarlists.qml
deleted file mode 100644
index e0be5e4..0000000
--- a/prototype_2016/third_party/qml-rust/examples/qvarlists.qml
+++ /dev/null
@@ -1,31 +0,0 @@
1import QtQuick 2.0
2import QtCharts 2.0
3import QtQuick.Layouts 1.0
4import QtQuick.Controls 1.3
5ApplicationWindow {
6 visible: true
7 title: "Architect View"
8 minimumWidth: 1200
9 minimumHeight: 800 + 100
10 x: 400
11 y: 100
12 ChartView {
13 title: "Language stats"
14 anchors.fill: parent
15 antialiasing: true
16
17 PercentBarSeries {
18 id: barS
19 axisX: BarCategoryAxis { categories: ["2005", "2006"] }
20 BarSet { label: "Bob"; values: [2, 2] }
21 BarSet { label: "Susan"; values: [5, 1] }
22 BarSet { label: "James"; values: [3, 5] }
23 Component.onCompleted: {
24 console.log(values)
25 values.forEach(function(item, index) {
26 barS.append(item[0], item[1]);
27 });
28 }
29 }
30 }
31}
diff --git a/prototype_2016/third_party/qml-rust/examples/qvarlists.rs b/prototype_2016/third_party/qml-rust/examples/qvarlists.rs
deleted file mode 100644
index 99192e4..0000000
--- a/prototype_2016/third_party/qml-rust/examples/qvarlists.rs
+++ /dev/null
@@ -1,15 +0,0 @@
1#![feature(trace_macros)]
2#[macro_use]
3extern crate qml;
4
5use qml::*;
6
7fn main() {
8 let mut qqae = QmlEngine::new();
9 trace_macros!(true);
10 let shortcut = qvarlist![["John", [2, 2]], ["Ivan", [10, 0]], ["Mary", [0, 1]]];
11 qqae.set_and_store_property("values", shortcut);
12
13 qqae.load_file("examples/qvarlists.qml");
14 qqae.exec();
15}
diff --git a/prototype_2016/third_party/qml-rust/examples/sigslots.qml b/prototype_2016/third_party/qml-rust/examples/sigslots.qml
deleted file mode 100644
index 7a2691e..0000000
--- a/prototype_2016/third_party/qml-rust/examples/sigslots.qml
+++ /dev/null
@@ -1,35 +0,0 @@
1import QtQuick 2.2
2import QtQuick.Controls 1.2
3import QtQuick.Layouts 1.1
4import QtQuick.Window 2.1
5
6ApplicationWindow {
7 width: 400
8 height: 300
9 title: "of Signals & Slots"
10 Component.onCompleted: visible = true
11
12 ColumnLayout {
13 anchors.fill: parent
14 Text {
15 id: text
16 anchors.horizontalCenter: parent.horizontalCenter
17 text: "Not set yet"
18 }
19 Button {
20 id: butt
21 anchors.horizontalCenter: parent.horizontalCenter
22 text: "Notify Rust"
23 Component.onCompleted: {
24 clicked.connect(test.click)
25 test.updateText.connect(updateText)
26 console.log(test.name)
27 test.name = "OAK"
28 console.log(test.name)
29 }
30 function updateText(s) {
31 text.text = s
32 }
33 }
34 }
35}
diff --git a/prototype_2016/third_party/qml-rust/examples/sigslots.rs b/prototype_2016/third_party/qml-rust/examples/sigslots.rs
deleted file mode 100644
index 1f1d744..0000000
--- a/prototype_2016/third_party/qml-rust/examples/sigslots.rs
+++ /dev/null
@@ -1,39 +0,0 @@
1#[macro_use]
2extern crate qml;
3use std::thread;
4use std::sync::*;
5use std::time::Duration;
6
7use qml::*;
8
9pub struct Test;
10
11Q_OBJECT!(
12pub Test as QTest{
13 signals:
14 fn updateText(s: String);
15 slots:
16 fn click();
17 properties:
18 name: String; read: get_name, write: set_name, notify: name_changed;
19});
20
21impl QTest {
22 pub fn click(&self) -> Option<&QVariant> {
23 println!("IT CLICKED");
24 self.updateText("Woah, Rust has noticed you".into());
25 None
26 }
27}
28
29fn main() {
30 let mut qqae = QmlEngine::new();
31 let mut qtest = QTest::new(Test, "OAK".into());
32 qtest.set_name("Swapped".into());
33 // assert_eq!(qtest.get_name(), "Swapped".to_string());
34 qqae.set_and_store_property("test", qtest.get_qobj());
35 qqae.load_file("examples/sigslots.qml");
36 qqae.exec();
37
38 qqae.quit();
39}
diff --git a/prototype_2016/third_party/qml-rust/examples/threaded.qml b/prototype_2016/third_party/qml-rust/examples/threaded.qml
deleted file mode 100644
index b31c3ed..0000000
--- a/prototype_2016/third_party/qml-rust/examples/threaded.qml
+++ /dev/null
@@ -1,31 +0,0 @@
1import QtQuick 2.5;
2import QtQuick.Window 2.1;
3import QtQuick.Controls 1.4;
4import QtQuick.Layouts 1.2;
5
6ApplicationWindow {
7 width: 300;
8 height: 100;
9 Component.onCompleted: visible = true;
10 ColumnLayout {
11 anchors.fill: parent;
12 TextField {
13 id: urlField;
14 Layout.fillWidth: true
15 text: "Anything"
16 }
17 RowLayout {
18 Layout.fillWidth: true
19 Item { Layout.fillWidth: true }
20 Button {
21 text: "Download Page";
22 onClicked: logic.downloadPage(urlField.text)
23 }
24 Item { Layout.fillWidth: true }
25 }
26 Connections {
27 target: logic;
28 onPageDownloaded: console.log("Page Downloaded");
29 }
30 }
31}
diff --git a/prototype_2016/third_party/qml-rust/examples/threaded.rs b/prototype_2016/third_party/qml-rust/examples/threaded.rs
deleted file mode 100644
index c5389ed..0000000
--- a/prototype_2016/third_party/qml-rust/examples/threaded.rs
+++ /dev/null
@@ -1,36 +0,0 @@
1#[macro_use]
2extern crate qml;
3
4use std::thread;
5use std::time::Duration;
6use qml::*;
7
8pub struct Logic;
9
10impl QLogic {
11 pub fn downloadPage(&mut self, url: String) -> Option<&QVariant>{
12 self.threaded(|s| {
13 thread::sleep(Duration::from_secs(2));;
14 s.pageDownloaded(url);
15 })
16 None
17 }
18}
19
20Q_OBJECT!{
21pub Logic as QLogic {
22 signals:
23 fn pageDownloaded(response: String);
24 slots:
25 fn downloadPage(url: String);
26 properties:
27}
28}
29
30fn main() {
31 let mut qqae = QmlEngine::new();
32 let qlogic = QLogic::new(Logic);
33 qqae.set_and_store_property("logic", qlogic.get_qobj());
34 qqae.load_file("examples/threaded.qml");
35 qqae.exec();
36}
diff --git a/prototype_2016/third_party/qml-rust/src/lib.rs b/prototype_2016/third_party/qml-rust/src/lib.rs
deleted file mode 100644
index a72a3ce..0000000
--- a/prototype_2016/third_party/qml-rust/src/lib.rs
+++ /dev/null
@@ -1,37 +0,0 @@
1#![allow(non_snake_case)]
2#![allow(dead_code)]
3#![allow(unused_variables)]
4extern crate libc;
5#[macro_use]
6extern crate lazy_static;
7
8mod qmlengine;
9mod qvariant;
10mod qabstactlistmodel;
11mod qinthasharray;
12mod utils;
13mod qmodelindex;
14mod types;
15mod qresource;
16mod qurl;
17mod qobject;
18mod qmeta;
19mod qtypes;
20#[macro_use]
21mod macros;
22mod qmlregister;
23
24pub use qmlengine::QmlEngine;
25pub use qvariant::QVariant;
26pub use qabstactlistmodel::QListModel;
27pub use qobject::QObject;
28pub use qmeta::{QObjectMacro, emit_signal};
29pub use qtypes::*;
30pub use qresource::*;
31pub use qmlregister::QMLRegisterable;
32
33#[doc(hidden)]
34pub use libc::c_void;
35
36#[doc(hidden)]
37pub use qmlregister::{register_qml_type, register_qml_singleton_type};
diff --git a/prototype_2016/third_party/qml-rust/src/macros.rs b/prototype_2016/third_party/qml-rust/src/macros.rs
deleted file mode 100644
index 23c5bae..0000000
--- a/prototype_2016/third_party/qml-rust/src/macros.rs
+++ /dev/null
@@ -1,476 +0,0 @@
1/// Eases forming of `QVariantLists` ([`QVariant`](struct.QVariant.html) of array).
2///
3/// To be more precise, macro generates Vec<QVariant> which implements Into<QVariant>.
4/// # Examples
5/// ```
6/// # #[macro_use] extern crate qml;
7/// # use qml::*;
8/// # fn main() {
9/// let shortcut: QVariant = qvarlist![["John", [2, 2]], ["Ivan", [10, 0]], ["Mary", [0, 1]]].into();
10/// # }
11/// ```
12#[macro_export]
13macro_rules! qvarlist{
14 (__ $v:ident, [$($inside:tt)*], $($rest:tt)*) => {
15 $v.push(qvarlist!($($inside)*).into());
16 qvarlist!(__ $v, $($rest)*);
17 };
18 (__ $v:ident, [$($inside:tt)*]) => {
19 $v.push(qvarlist!($($inside)*).into());
20 };
21 (__ $v:ident, $varname:expr, $($rest:tt)*) => {
22 $v.push($varname.into());
23 qvarlist!(__ $v, $($rest)*);
24 };
25 (__ $v:ident, $varname:expr) => {
26 $v.push($varname.into());
27 };
28 ($($rest:tt)*) => {{
29 let mut v: Vec<QVariant> = Vec::new();
30 qvarlist!(__ v, $($rest)*);
31 v
32 }};
33}
34
35#[doc(hidden)]
36#[macro_export]
37macro_rules! __gen_signals{
38 (fn $signalname:ident ( $( $signalvar:ident : $signalqtype:ident ),* ); $($rest:tt)*) =>{
39 pub fn $signalname(&self, $( $signalvar: $signalqtype ),*){
40 let mut vec: Vec<QVariant> = Vec::new();
41 $(
42 let $signalvar: $signalqtype = $signalvar;
43 vec.push($signalvar.into());
44 )*
45 emit_signal(self, stringify!($signalname), vec);
46 }
47
48 __gen_signals!($($rest)*);
49 };
50 () => ();
51}
52
53/// Marks the structure to be able to be used in Qt meta-object system.
54///
55/// # Examples
56///
57/// ```
58/// # #[macro_use] extern crate qml;
59/// # use qml::*;
60/// pub struct Example;
61///
62/// impl Example {
63/// pub fn simple_receiver(&mut self) {
64/// // This is a function that also will be a slot
65/// }
66/// }
67///
68/// Q_OBJECT!(
69/// pub Example as QExample{
70/// signals:
71/// fn simple_signal(s: String);
72/// slots:
73/// fn simple_receiver();
74/// properties:
75/// name: String; read: get_name, write: set_name, notify: name_changed;
76/// });
77///
78/// ...
79///
80/// # fn main() {
81/// let mut qqae = QmlEngine::new();
82/// let mut qobject = QExample::new(Example);
83/// qobject.simple_signal("Hi from Rust!".into());
84/// # }
85/// ```
86#[macro_export]
87macro_rules! Q_OBJECT{
88 (
89 pub $obj:ident as $wrapper:ident{
90 signals:
91 $(fn $signalname:ident ( $( $signalvar:ident : $signalqtype:ident ),* );)*
92
93 slots:
94 $(fn $slotname:ident ( $( $slotvar:ident : $slotqtype:ident ),* );)*
95
96 properties:
97 $($propname:ident : $proptype:ident; read: $read_slot:ident, write: $write_slot:ident,
98 notify: $notify_sig:ident;)*
99 }) =>{
100 pub struct $wrapper{
101 origin: Box<$obj>,
102 ptr: QObject,
103 properties: ::std::collections::HashMap<&'static str, (QVariant, QMetaType)>,
104 }
105
106 impl ::std::ops::Deref for $wrapper {
107 type Target = $obj;
108
109 fn deref(&self) -> &$obj {
110 let ref b: Box<$obj> = self.origin;
111 b.as_ref()
112 }
113 }
114
115 impl ::std::ops::DerefMut for $wrapper {
116 fn deref_mut<'a>(&'a mut self) -> &'a mut $obj {
117 self.origin.as_mut()
118 }
119 }
120
121 impl $wrapper{
122 __gen_signals!($(fn $signalname ( $( $signalvar : $signalqtype ),* );)*
123 $(fn $notify_sig ();)*);
124
125 pub fn with_no_props(origin: $obj)-> Box<Self> {
126 unsafe{
127 let mut local = $wrapper{
128 origin: Box::new(origin),
129 ptr: ::std::mem::uninitialized(),
130 properties: ::std::collections::HashMap::new(),
131 };
132 $(local.properties.insert(stringify!($propname), ($proptype::default().into(), $proptype::metatype()));)*
133 let mut local = Box::new(local);
134 let qobj = QObject::new(&mut *local);
135 ::std::ptr::write(&mut local.ptr, qobj);
136 local
137 }
138 }
139
140 pub fn new(origin: $obj, $($propname: $proptype),*) -> Box<Self>{
141 let mut local = Self::with_no_props(origin);
142 $(local.properties.insert(stringify!($propname), ($propname.into(), $proptype::metatype()));)*
143 local
144 }
145
146 $(pub fn $read_slot(&self) -> &QVariant {
147 println!("Trying to read");
148 &self.properties.get(stringify!($propname)).unwrap().0
149 }
150
151 pub fn $write_slot(&mut self, input: $proptype) {
152 self.properties.insert(stringify!($propname), (input.into(), $proptype::metatype()));
153 })*
154
155 fn threaded<F: FnOnce(&mut $wrapper) + Send + 'static>(&mut self, f: F){
156 let ptr = ::std::sync::atomic::AtomicPtr::new(self);
157 ::std::thread::spawn(move || {
158 f(unsafe { &mut *ptr.load(::std::sync::atomic::Ordering::Relaxed) });
159 });
160 }
161 }
162
163 impl QObjectMacro for $wrapper{
164 fn qslot_call(&mut self, name: &str, args: Vec<QVariant>) -> Option<&QVariant>{
165 fn next_or_panic(qt: Option<QVariant>) -> QVariant{
166 if let Some(o) = qt {
167 o
168 }else {
169 panic!("Not enough parameters to call a slot")
170 }
171 }
172 match name {
173 $(stringify!($slotname) => {
174 let mut iter = args.into_iter();
175 $(
176 let next = next_or_panic (iter.next());
177 let $slotvar: $slotqtype = next.into();
178 )*
179 self.$slotname ($($slotvar),*)
180 },)*
181 $(stringify!($read_slot) => {
182 Some(self.$read_slot ())
183 },
184 stringify!($write_slot) => {
185 let mut iter = args.into_iter();
186 let next = next_or_panic (iter.next());
187 let property: $proptype = next.into();
188 self.$write_slot (property);
189 None
190 },)*
191 _ => panic!("Unrecognized slot call: {}", name)
192 }
193 }
194
195 fn qmeta(&self) -> (Vec<(&'static str, i32, Vec<i32>)>,
196 Vec<(&'static str, i32, i32, Vec<i32>)>,
197 Vec<(&'static str, i32, &'static str, &'static str, &'static str)>,
198 &'static str){
199 let mut signals = Vec::new();
200 $(
201 let mut argc = 0;
202 let mut mttypes = Vec::new();
203 $(
204 argc += 1;
205 mttypes.push($signalqtype::metatype() as i32);
206 )*
207 signals.push((stringify!($signalname), argc, mttypes));
208 )*
209 let mut slots = Vec::new();
210 $(
211 let mut argc = 0;
212 let mut mttypes = Vec::new();
213 $(
214 argc += 1;
215 mttypes.push($slotqtype::metatype() as i32);
216 )*
217 slots.push((stringify!($slotname), 43, argc, mttypes));
218 )*
219 $(
220 slots.push((stringify!($read_slot), $proptype::metatype() as i32, 0, Vec::new()));
221 slots.push((stringify!($write_slot), QMetaType::Void as i32, 1, vec![$proptype::metatype() as i32]));
222 )*
223 let mut props: Vec<(&'static str, i32, &'static str, &'static str, &'static str)> = Vec::new();
224 $(
225 props.push((stringify!($propname), $proptype::metatype() as i32, stringify!($read_slot),
226 stringify!($write_slot), stringify!($notify_sig)));
227 )*
228 (signals, slots, props, stringify!($obj))
229 }
230
231 fn get_qobj(&self) -> &QObject{
232 &self.ptr
233 }
234
235 fn get_qobj_mut(&mut self) -> &mut QObject{
236 &mut self.ptr
237 }
238 }
239 };
240 }
241
242/// Generates a wrapper for [`QListModel`](struct.QListModel.html) for static typing and easier management.
243///
244/// # Examples
245/// ```
246/// # #[macro_use] extern crate qml;
247/// # use qml::*;
248/// Q_LISTMODEL!{
249/// pub QTestModel {
250/// name: &str,
251/// number: i32,
252/// }
253/// }
254///
255/// ...
256///
257/// # fn main() {
258/// let mut qqae = QmlEngine::new();
259/// let mut qalm = QTestModel::new();
260/// qalm.insert_row("John", 42);
261/// qalm.insert_row("Oak", 505);
262/// // `&QTestModel` implements `Into<QVariant>`
263/// qqae.set_and_store_property("listModel", &qalm);
264///
265/// qqae.load_file("examples/listmodel.qml");
266/// qalm.set_data(vec![("OMG", 13317), ("HACKED", 228)]);
267/// qqae.exec();
268/// # }
269/// ```
270#[macro_export]
271macro_rules! Q_LISTMODEL{
272 (pub $wrapper:ident{
273 $($rolename:ident : $roletype:ty,)*
274 }) => {
275 pub struct $wrapper {
276 qalm: Box<QListModel<'static>>,
277 }
278
279 impl $wrapper {
280 pub fn new() -> Self{
281 $wrapper{ qalm: QListModel::new(&[$(stringify!($rolename)),*])}
282 }
283
284 /// Inserts a row into this model
285 pub fn insert_row(&mut self, $($rolename : $roletype),*) {
286 let mut vec = Vec::new();
287 $(
288 vec.push($rolename.into());
289 )*
290 self.qalm.insert_row(vec.into_iter());
291 }
292
293 /// Gets an accoiated qvariant
294 pub fn get_qvar(&self) -> QVariant{
295 self.qalm.get_qvar()
296 }
297
298 /// Sets a specified data for this model
299 pub fn set_data(&mut self, vec: Vec<($($roletype),*)>) {
300 self.qalm.set_data(vec.into_iter()
301 .map(|($($rolename),*)| {
302 let mut vec = Vec::new();
303 $(
304 vec.push($rolename.into());
305 )*
306 vec
307 }).collect::<Vec<Vec<QVariant>>>())
308 }
309
310 /// View contents of this model as a slice of rows of QVariants
311 pub fn view_raw_data(&self) -> &[Vec<QVariant>]{
312 self.qalm.view_data()
313 }
314
315 /// View contents of this model as a row
316 pub fn view_data(&self) -> Vec<($($roletype),*)>{
317 let view = self.qalm.view_data();
318 view.into_iter().map(|v| {
319 let mut v = v.iter();
320 $(
321 let $rolename = v.next().unwrap().into();
322 )*
323 ($($rolename),*)
324 }).collect()
325 }
326 }
327
328 impl<'a, 'b> From<&'a $wrapper> for QVariant {
329 fn from(i: &$wrapper) -> QVariant {
330 i.get_qvar()
331 }
332 }
333 }
334 }
335
336/// Provides definitions for a type that can be used from QML.
337///
338/// The same macro is used to prepare a type for being used as a normal type or a singleton.
339/// The only requirement is that the type in question should provide `Default` implementation.
340/// # Examples
341/// ```
342///
343/// #[derive(Default)]
344/// pub struct Test;
345///
346/// Q_OBJECT!(
347/// pub Test as QTest{
348/// signals:
349/// slots:
350/// properties:
351/// name: String; read: get_name, write: set_name, notify: name_changed;
352/// });
353///
354/// Q_REGISTERABLE_QML!(QTest: Test as TestRsObject 1=>0, from TestModule);
355/// ```
356/// Later on a type that was made registerable can be used in [`Q_REGISTER_QML`](macro.Q_REGISTER_QML!.html)
357/// or in [`Q_REGISTER_SINGLETON_QML`](macro.Q_REGISTER_SINGLETON_QML!.html) macros to be used as a type in QML.
358#[macro_export]
359macro_rules! Q_REGISTERABLE_QML(
360 ($wrapper:ident : $origin:ident as $qml:ident $major:expr=>$minor:expr, from $uri:ident) => {
361 impl QMLRegisterable for $wrapper{
362 fn qualify_to_register(&self) -> (i32, i32, &'static str, &'static str) {
363 ($major, $minor, stringify!($uri), stringify!($qml))
364 }
365
366 fn get_new(&self) -> *mut c_void {
367 unsafe {
368 let obj = $wrapper::with_no_props($origin::default());
369 let res = Box::into_raw(obj) as *mut c_void;
370 res
371 }
372 }
373
374 fn get_qobj_from_ptr(&self, ptr: *mut c_void) -> *mut QObject {
375 unsafe {
376 let mut obj: Box<$wrapper> = Box::from_raw(ptr as *mut $wrapper);
377 let res = obj.get_qobj_mut() as *mut QObject;
378 ::std::mem::forget(obj);
379 res
380 }
381 }
382 }
383
384 impl $wrapper {
385 pub fn get_shallow() -> Self {
386 unsafe {
387 ::std::mem::uninitialized()
388 }
389 }
390 }
391 }
392 );
393
394/// Registers a type as a QML type.
395///
396/// To use this macro [`Q_REGISTERABLE_QML`](macro.Q_REGISTERABLE_QML!.html) should be used first.
397/// # Examples
398/// ```
399///
400/// #[derive(Default)]
401/// pub struct Test;
402///
403/// Q_OBJECT!(
404/// pub Test as QTest{
405/// signals:
406/// slots:
407/// properties:
408/// name: String; read: get_name, write: set_name, notify: name_changed;
409/// });
410///
411/// Q_REGISTERABLE_QML!(QTest: Test as TestRsObject 1=>0, from TestModule);
412///
413/// // ...
414///
415/// # fn main() {
416/// Q_REGISTER_QML!(QTest);
417/// # }
418/// ```
419/// Then in qml:
420///
421/// ```qml
422/// import TestModule 1.0
423///
424/// TestRsObject{
425/// name: "Oak"
426/// }
427/// ```
428#[macro_export]
429macro_rules! Q_REGISTER_QML(
430 ($wrapper:ident) => {
431 register_qml_type($wrapper::get_shallow());
432 }
433 );
434
435/// Registers a type as a singleton type in QML.
436///
437/// To use this macro [`Q_REGISTERABLE_QML`](macro.Q_REGISTERABLE_QML!.html) should be used first.
438/// # Examples
439/// ```
440///
441/// #[derive(Default)]
442/// pub struct Test;
443///
444/// Q_OBJECT!(
445/// pub Test as QTest{
446/// signals:
447/// slots:
448/// properties:
449/// name: String; read: get_name, write: set_name, notify: name_changed;
450/// });
451///
452/// Q_REGISTERABLE_QML!(QTest: Test as TestRsSingleton 1=>0, from TestModule);
453///
454/// // ...
455///
456/// # fn main() {
457/// Q_REGISTER_SINGLETON_QML!(QTest);
458/// # }
459/// ```
460/// Then in qml:
461///
462/// ```qml
463/// import TestModule 1.0
464///
465/// Item {
466/// Component.onCompleted: {
467/// console.log(TestRsSingleton.name)
468/// }
469/// }
470/// ```
471#[macro_export]
472macro_rules! Q_REGISTER_SINGLETON_QML(
473 ($wrapper:ident) => {
474 register_qml_singleton_type($wrapper::get_shallow());
475 }
476 );
diff --git a/prototype_2016/third_party/qml-rust/src/qabstactlistmodel.rs b/prototype_2016/third_party/qml-rust/src/qabstactlistmodel.rs
deleted file mode 100644
index e3c0dd3..0000000
--- a/prototype_2016/third_party/qml-rust/src/qabstactlistmodel.rs
+++ /dev/null
@@ -1,224 +0,0 @@
1use libc;
2use std::ptr::null_mut;
3
4use qvariant::*;
5use types::*;
6use qmodelindex::*;
7use qinthasharray::*;
8
9extern "C" {
10
11 fn dos_qabstractlistmodel_qmetaobject() -> DosQMetaObject;
12 fn dos_qabstractlistmodel_create(callbackObject: *const libc::c_void,
13 metaObject: DosQMetaObject,
14 dObjectCallback: DObjectCallback,
15 rowCountCallback: RowCountCallback,
16 columnCountCallback: ColumnCountCallback,
17 dataCallback: DataCallback,
18 setDataCallback: SetDataCallback,
19 roleNamesCallback: RoleNamesCallback,
20 flagsCallback: FlagsCallback,
21 headerDataCallback: HeaderDataCallback)
22 -> DosQAbstractListModel;
23}
24
25/// Called when a slot should be executed
26/// @param self The pointer to the `QObject` in the binded language
27/// @param slotName The slotName as `DosQVariant`. It should not be deleted
28/// @param argc The number of arguments
29/// @param argv An array of `DosQVariant` pointers. They should not be deleted
30extern "C" fn RustObjectCallback(Qself: *const libc::c_void,
31 slotname: DosQVariant,
32 argc: i32,
33 argv: *const DosQVariant) {
34 println!("SLOT WAS EXECUTED. hi");
35}
36pub type DObjectCallback = extern "C" fn(*const libc::c_void, DosQVariant, i32, *const DosQVariant);
37
38/// Called when the `QAbstractListModel::rowCount` method must be executed
39/// @param self The pointer to the `QAbstractListModel` in the binded language
40/// @param index The parent `DosQModelIndex`. It should not be deleted
41/// @param result The rowCount result. This must be deferenced and filled from the binded language.
42/// It should not be deleted
43pub type RowCountCallback = extern "C" fn(*const libc::c_void, DosQModelIndex, *mut i32);
44
45/// Called when the `QAbstractListModel::columnCount` method must be executed
46/// @param self The pointer to the `QAbstractListModel` in the binded language
47/// @param index The parent `DosQModelIndex`. It should not be deleted
48/// @param result The rowCount result. This must be deferenced and filled from the binded language.
49/// It should not be deleted
50extern "C" fn RustColumnCountCallback(Qself: *const libc::c_void,
51 parent: DosQModelIndex,
52 result: *mut i32) {
53}
54pub type ColumnCountCallback = extern "C" fn(*const libc::c_void, DosQModelIndex, *mut i32);
55
56/// Called when the `QAbstractListModel::data` method must be executed
57/// @param self The pointer to the `QAbstractListModel` in the binded language
58/// @param index The `DosQModelIndex` to which we request the data. It should not be deleted
59/// @param result The `DosQVariant` result. This must be deferenced and filled from the binded language.
60/// It should not be deleted. See `dos_qvariant_assign` or other `DosQVariant` setters
61pub type DataCallback = extern "C" fn(*const libc::c_void, DosQModelIndex, i32, MutDosQVariant);
62
63extern "C" fn RustSetDataCallback(Qself: *const libc::c_void,
64 index: DosQModelIndex,
65 value: DosQVariant,
66 role: i32,
67 result: *mut bool) {
68 println!("SET DATA HELLO");
69}
70pub type SetDataCallback = extern "C" fn(*const libc::c_void,
71 DosQModelIndex,
72 DosQVariant,
73 i32,
74 *mut bool);
75
76pub type RoleNamesCallback = extern "C" fn(*const libc::c_void, MutDosQHashIntQByteArray);
77
78extern "C" fn RustFlagsCallback(Qself: *const libc::c_void,
79 index: DosQModelIndex,
80 result: *mut i32) {
81 println!("IVE GOT FLAGS CALLBACK");
82}
83pub type FlagsCallback = extern "C" fn(*const libc::c_void, DosQModelIndex, *mut i32);
84
85extern "C" fn RustHeaderDataCallback(Qself: *const libc::c_void,
86 section: i32,
87 orientation: i32,
88 role: i32,
89 result: MutDosQVariant) {
90 println!("FINAL CALLBACK");
91}
92pub type HeaderDataCallback = extern "C" fn(*const libc::c_void, i32, i32, i32, MutDosQVariant);
93
94use std::sync::atomic::{AtomicPtr, Ordering};
95/// Allows providing a custom model to QML
96pub struct QListModel<'a> {
97 wrapped: AtomicPtr<WQAbstractListModel>,
98 model: Vec<Vec<QVariant>>,
99 rolenames: Vec<&'a str>,
100}
101
102extern "C" {
103 fn dos_qabstractlistmodel_beginInsertRows(vptr: DosQAbstractListModel,
104 parent: DosQModelIndex,
105 first: i32,
106 last: i32);
107 fn dos_qabstractlistmodel_endInsertRows(vptr: DosQAbstractListModel);
108
109 fn dos_qabstractlistmodel_beginResetModel(vptr: DosQAbstractListModel);
110 fn dos_qabstractlistmodel_endResetModel(vptr: DosQAbstractListModel);
111}
112
113impl<'a> QListModel<'a> {
114 /// Rolenames are roles of provided data, that are mapped to corresponding roles in QML.
115 pub fn new<'b>(rolenames: &'b [&'a str]) -> Box<Self> {
116 unsafe {
117 let mut rs = Vec::new();
118 rs.extend_from_slice(rolenames);
119 let result = QListModel {
120 wrapped: AtomicPtr::new(null_mut()),
121 model: Vec::new(),
122 rolenames: rs,
123 };
124 // Probably need an explanation on why do I need a box
125 let mut boxer = Box::new(result);
126
127 let dqmo = dos_qabstractlistmodel_qmetaobject();
128 let dqalm =
129 dos_qabstractlistmodel_create(&*boxer as *const QListModel as *const libc::c_void,
130 dqmo,
131 RustObjectCallback, // no need
132 RustRowCountCallback,
133 RustColumnCountCallback, // no need
134 RustDataCallback,
135 RustSetDataCallback, // no need
136 RustRoleNamesCallback,
137 RustFlagsCallback, // no need
138 RustHeaderDataCallback);// no need
139 boxer.wrapped = AtomicPtr::new(dqalm);
140
141 boxer
142 }
143 }
144
145 /// Returns an amount of rows in this model
146 pub fn row_count(&self) -> usize {
147 self.model.len()
148 }
149
150 /// Gets a `QVariant` associate
151 pub fn get_qvar(&self) -> QVariant {
152 self.wrapped.load(Ordering::Relaxed).into()
153 }
154
155 /// Inserts a row into model
156 ///
157 /// Note that it clones all incoming qvariants as modifying them is not allowed.
158 pub fn insert_row<T>(&mut self, qvars: T)
159 where T: Iterator<Item = QVariant>
160 {
161 unsafe {
162 let index = QModelIndex::new();
163 dos_qabstractlistmodel_beginInsertRows(self.wrapped.load(Ordering::Relaxed),
164 get_model_ptr(&index),
165 self.model.len() as i32,
166 (self.model.len() + 1) as i32);
167 self.model.push(qvars.collect());
168 dos_qabstractlistmodel_endInsertRows(self.wrapped.load(Ordering::Relaxed));
169 }
170 }
171
172 /// Sets a data for this QAbstractListModel
173 pub fn set_data(&mut self, qvars: Vec<Vec<QVariant>>) {
174 unsafe {
175 dos_qabstractlistmodel_beginResetModel(self.wrapped.load(Ordering::Relaxed));
176 self.model = qvars;
177 dos_qabstractlistmodel_endResetModel(self.wrapped.load(Ordering::Relaxed));
178 }
179 }
180
181 /// Gets an immutable view of the data
182 pub fn view_data(&self) -> &[Vec<QVariant>] {
183 &self.model
184 }
185}
186
187impl<'a, 'b> From<&'a QListModel<'b>> for QVariant {
188 fn from(i: &QListModel) -> QVariant {
189 i.get_qvar()
190 }
191}
192
193extern "C" fn RustRowCountCallback(Qself: *const libc::c_void,
194 index: DosQModelIndex,
195 result: *mut i32) {
196 unsafe {
197 let qlist = &*(Qself as *const QListModel);
198 *result = qlist.row_count() as i32;
199 }
200}
201
202extern "C" fn RustDataCallback(Qself: *const libc::c_void,
203 index: DosQModelIndex,
204 role: i32,
205 result: MutDosQVariant) {
206 let qindex: QModelIndex = index.into();
207 unsafe {
208 let qlist = &*(Qself as *const QListModel);
209 let data = &qlist.model[qindex.row() as usize][(role - START_ROLE) as usize];
210 let mut qvar: QVariant = result.into();
211 qvar.set(data);
212 }
213}
214
215const START_ROLE: i32 = 0x0100;
216extern "C" fn RustRoleNamesCallback(Qself: *const libc::c_void, result: MutDosQHashIntQByteArray) {
217 unsafe {
218 let qlist = &*(Qself as *const QListModel);
219 let hash: QHashIntQByteArray = result.into();
220 for (i, name) in qlist.rolenames.iter().enumerate() {
221 hash.insert(START_ROLE + i as i32, name);
222 }
223 }
224}
diff --git a/prototype_2016/third_party/qml-rust/src/qinthasharray.rs b/prototype_2016/third_party/qml-rust/src/qinthasharray.rs
deleted file mode 100644
index 0c296ad..0000000
--- a/prototype_2016/third_party/qml-rust/src/qinthasharray.rs
+++ /dev/null
@@ -1,44 +0,0 @@
1use libc;
2
3use utils::*;
4use types::*;
5
6extern "C" {
7
8 fn dos_qhash_int_qbytearray_create() -> MutDosQHashIntQByteArray;
9 fn dos_qhash_int_qbytearray_delete(vptr: MutDosQHashIntQByteArray);
10 fn dos_qhash_int_qbytearray_insert(vptr: MutDosQHashIntQByteArray,
11 key: i32,
12 value: *const libc::c_char);
13 fn dos_qhash_int_qbytearray_value(vptr: MutDosQHashIntQByteArray,
14 key: i32)
15 -> *const libc::c_char;
16}
17
18pub struct QHashIntQByteArray(MutDosQHashIntQByteArray);
19
20impl QHashIntQByteArray {
21 pub fn new() -> Self {
22 unsafe { QHashIntQByteArray(dos_qhash_int_qbytearray_create()) }
23 }
24
25 pub fn insert(&self, key: i32, value: &str) {
26 unsafe { dos_qhash_int_qbytearray_insert(self.0, key, stoptr(value)) }
27 }
28}
29
30// impl Drop for QHashIntQByteArray {
31// fn drop(&mut self) {
32// unsafe { dos_qhash_int_qbytearray_delete(self.0) }
33// }
34// }
35
36pub fn get_dqhiqba_ptr(o: QHashIntQByteArray) -> MutDosQHashIntQByteArray {
37 o.0
38}
39
40impl From<MutDosQHashIntQByteArray> for QHashIntQByteArray {
41 fn from(i: MutDosQHashIntQByteArray) -> Self {
42 QHashIntQByteArray(i)
43 }
44}
diff --git a/prototype_2016/third_party/qml-rust/src/qmeta.rs b/prototype_2016/third_party/qml-rust/src/qmeta.rs
deleted file mode 100644
index 1804402..0000000
--- a/prototype_2016/third_party/qml-rust/src/qmeta.rs
+++ /dev/null
@@ -1,195 +0,0 @@
1use std::mem::forget;
2use libc;
3
4use qvariant::*;
5use utils::*;
6use types::*;
7use qobject::*;
8
9extern "C" {
10 fn dos_qmetaobject_create(superClassMetaObject: DosQMetaObject,
11 className: *const libc::c_char,
12 signalDefinitions: *const SignalDefinitions,
13 slotDefinitions: *const SlotDefinitions,
14 propertyDefinitions: *const PropertyDefinitions)
15 -> DosQMetaObject;
16 fn dos_qobject_qmetaobject() -> DosQMetaObject;
17 fn dos_qobject_signal_emit(vptr: DosQObject,
18 name: *const libc::c_char,
19 parametersCount: i32,
20 parameters: *const DosQVariant);
21}
22
23#[doc(hidden)]
24/// Used by [`Q_OBJECT`](macro.Q_OBJECT!.html) macro to send signals to Qt.
25pub fn emit_signal(obj: &QObjectMacro, signalname: &str, args: Vec<QVariant>) {
26 let vec: Vec<DosQVariant> = args.iter()
27 .map(|qvar| get_private_variant(qvar))
28 .collect();
29 forget(args);
30 unsafe {
31 println!("about to send signal");
32 dos_qobject_signal_emit(get_qobj_ptr(obj.get_qobj()),
33 stoptr(signalname),
34 vec.len() as i32,
35 vec.as_ptr())
36 }
37}
38
39pub struct QMeta {
40 ptr: DosQMetaObject,
41}
42
43pub fn get_dos_qmeta(meta: &QMeta) -> DosQMetaObject {
44 meta.ptr
45}
46
47impl QMeta {
48 pub fn new_for_qobject(def: QMetaDefinition) -> QMeta {
49 unsafe {
50 let meta_obj = dos_qobject_qmetaobject();
51 let dos_meta = dos_qmetaobject_create(meta_obj,
52 stoptr(def.name),
53 &def.sig_defs as *const SignalDefinitions,
54 &def.slot_defs as *const SlotDefinitions,
55 &def.prop_defs as *const PropertyDefinitions);
56 QMeta { ptr: dos_meta }
57 }
58 }
59}
60
61#[derive(Debug)]
62pub struct QMetaDefinition {
63 sig_defs: SignalDefinitions,
64 slot_defs: SlotDefinitions,
65 prop_defs: PropertyDefinitions,
66 name: &'static str,
67}
68
69pub fn get_qmetadef_name(o: &QMetaDefinition) -> &'static str {
70 o.name
71}
72
73pub type QMetaDef = (Vec<(&'static str, i32, Vec<i32>)>,
74 Vec<(&'static str, i32, i32, Vec<i32>)>,
75 Vec<(&'static str, i32, &'static str, &'static str, &'static str)>,
76 &'static str);
77impl QMetaDefinition {
78 pub fn new(input: QMetaDef) -> Self {
79 let (signals, slots, props, name) = input;
80 let signals: Vec<SignalDefinition> = signals.into_iter()
81 .map(|(s, argc, types)| {
82 let def = SignalDefinition {
83 name: stoptr(s),
84 parametersCount: argc,
85 parametersMetaTypes: types.as_ptr(),
86 };
87 forget(types);
88 def
89 })
90 .collect();
91 let sig_defs = SignalDefinitions {
92 count: signals.len() as i32,
93 definitions: signals.as_ptr(),
94 };
95 forget(signals);
96
97 let slots: Vec<SlotDefinition> = slots.into_iter()
98 .map(|(s, ret_type, argc, types)| {
99 let def = SlotDefinition {
100 name: stoptr(s),
101 returnMetaType: ret_type,
102 parametersCount: argc,
103 parametersMetaTypes: types.as_ptr(),
104 };
105 forget(types);
106 def
107 })
108 .collect();
109 let slot_defs = SlotDefinitions {
110 count: slots.len() as i32,
111 definitions: slots.as_ptr(),
112 };
113 forget(slots);
114
115 let props: Vec<PropertyDefinition> = props.into_iter()
116 .map(|(name, propertyMetaType, readSlot, writeSlot, notifySignal)| {
117 PropertyDefinition {
118 name: stoptr(name),
119 propertyMetaType: propertyMetaType,
120 readSlot: stoptr(readSlot),
121 writeSlot: stoptr(writeSlot),
122 notifySignal: stoptr(notifySignal),
123 }
124 })
125 .collect();
126 let prop_defs = PropertyDefinitions {
127 count: props.len() as i32,
128 definitions: props.as_ptr(),
129 };
130 forget(props);
131 QMetaDefinition {
132 sig_defs: sig_defs,
133 slot_defs: slot_defs,
134 prop_defs: prop_defs,
135 name: name,
136 }
137 }
138}
139
140#[doc(hidden)]
141// Provides `qml-rust` with the neccessary information and an ability to callback slots.
142pub trait QObjectMacro {
143 fn qslot_call(&mut self, name: &str, args: Vec<QVariant>) -> Option<&QVariant>;
144 fn qmeta(&self) -> QMetaDef;
145 fn get_qobj(&self) -> &QObject;
146 fn get_qobj_mut(&mut self) -> &mut QObject;
147}
148
149#[derive(Debug)]
150#[repr(C)]
151struct SignalDefinition {
152 name: *const libc::c_char,
153 parametersCount: i32,
154 parametersMetaTypes: *const i32,
155}
156
157#[derive(Debug)]
158#[repr(C)]
159struct SignalDefinitions {
160 count: i32,
161 definitions: *const SignalDefinition,
162}
163
164#[derive(Debug)]
165#[repr(C)]
166struct SlotDefinition {
167 name: *const libc::c_char,
168 returnMetaType: i32,
169 parametersCount: i32,
170 parametersMetaTypes: *const i32,
171}
172
173#[derive(Debug)]
174#[repr(C)]
175struct SlotDefinitions {
176 count: i32,
177 definitions: *const SlotDefinition,
178}
179
180#[derive(Debug)]
181#[repr(C)]
182struct PropertyDefinition {
183 name: *const libc::c_char,
184 propertyMetaType: i32,
185 readSlot: *const libc::c_char,
186 writeSlot: *const libc::c_char,
187 notifySignal: *const libc::c_char,
188}
189
190#[derive(Debug)]
191#[repr(C)]
192struct PropertyDefinitions {
193 count: i32,
194 definitions: *const PropertyDefinition,
195}
diff --git a/prototype_2016/third_party/qml-rust/src/qmlengine.rs b/prototype_2016/third_party/qml-rust/src/qmlengine.rs
deleted file mode 100644
index b3a02a6..0000000
--- a/prototype_2016/third_party/qml-rust/src/qmlengine.rs
+++ /dev/null
@@ -1,118 +0,0 @@
1use std::ops::Deref;
2
3use qvariant::*;
4use types::*;
5use qurl::*;
6use qmeta::*;
7
8extern "C" {
9 fn dos_qapplication_create();
10 fn dos_qapplication_exec();
11 fn dos_qapplication_quit();
12 fn dos_qapplication_delete();
13
14 fn dos_qqmlapplicationengine_create() -> DosQmlApplicationEngine;
15 fn dos_qqmlapplicationengine_load(vptr: DosQmlApplicationEngine, filename: DosCStr);
16 fn dos_qqmlapplicationengine_load_url(vptr: DosQmlApplicationEngine, url: DosQUrl);
17 fn dos_qqmlapplicationengine_load_data(vptr: DosQmlApplicationEngine, data: DosCStr);
18 fn dos_qqmlapplicationengine_add_import_path(vptr: DosQmlApplicationEngine, path: DosCStr);
19 fn dos_qqmlapplicationengine_context(vptr: DosQmlApplicationEngine) -> DosQQmlContext;
20 fn dos_qqmlapplicationengine_delete(vptr: DosQmlApplicationEngine);
21
22 fn dos_qqmlcontext_setcontextproperty(vptr: DosQQmlContext,
23 name: DosCStr,
24 value: DosQVariant);
25
26}
27
28/// Provides an entry point for building QML applications from Rust
29pub struct QmlEngine {
30 ptr: DosQmlApplicationEngine,
31 stored: Vec<QVariant>,
32}
33
34impl QmlEngine {
35 /// Creates a QML context of a non-headless application
36 pub fn new() -> Self {
37 unsafe {
38 dos_qapplication_create();
39 QmlEngine {
40 ptr: dos_qqmlapplicationengine_create(),
41 stored: Vec::new(),
42 }
43 }
44 }
45
46 pub fn registered_type<T: Deref<Target = QObjectMacro>>(&mut self, id: i32, registered: T) {}
47 /// Loads a file as a qml file
48 pub fn load_file(&self, path: &str) {
49 let path_raw = ::std::env::current_dir().unwrap().join(path);
50 let path = if cfg!(windows) {
51 format!("file:///{}", path_raw.display())
52 } else {
53 format!("file://{}", path_raw.display())
54 };
55 unsafe { dos_qqmlapplicationengine_load_url(self.ptr, construct_qurl(&path)) }
56 }
57
58 /// Loads a string as a qml file
59 pub fn load_data(&self, data: &str) {
60 unsafe { dos_qqmlapplicationengine_load_data(self.ptr, stoptr(data)) }
61 }
62
63 /// Adds a directory path where the engine searches for installed modules
64 pub fn add_import_path(&self, path: &str) {
65 unsafe { dos_qqmlapplicationengine_add_import_path(self.ptr, stoptr(path)) }
66 }
67
68 /// Launches the application
69 pub fn exec(&self) {
70 unsafe {
71 dos_qapplication_exec();
72 }
73 }
74 /// Closes the application
75 pub fn quit(&self) {
76 unsafe {
77 dos_qapplication_quit();
78 }
79 }
80
81 /// Sets a property for this QML context
82 ///
83 /// This variant stores qvariant, so it is removed, only when this QmlEngine is removed.
84 pub fn set_and_store_property<T: Into<QVariant>>(&mut self, name: &str, value: T) {
85 let val = value.into();
86 unsafe {
87 let context = dos_qqmlapplicationengine_context(self.ptr);
88 dos_qqmlcontext_setcontextproperty(context, stoptr(name), get_private_variant(&val));
89 }
90 self.stored.push(val);
91 }
92
93 /// Sets a property for this QML context
94 pub fn set_property(&self, name: &str, value: &QVariant) {
95 unsafe {
96 let context = dos_qqmlapplicationengine_context(self.ptr);
97 dos_qqmlcontext_setcontextproperty(context, stoptr(name), get_private_variant(value));
98 }
99 }
100}
101
102use utils::*;
103
104impl Default for QmlEngine {
105 fn default() -> Self {
106 Self::new()
107 }
108}
109
110impl Drop for QmlEngine {
111 fn drop(&mut self) {
112 unsafe {
113 dos_qapplication_quit();
114 dos_qqmlapplicationengine_delete(self.ptr);
115 dos_qapplication_delete();
116 }
117 }
118}
diff --git a/prototype_2016/third_party/qml-rust/src/qmlregister.rs b/prototype_2016/third_party/qml-rust/src/qmlregister.rs
deleted file mode 100644
index 99c11a9..0000000
--- a/prototype_2016/third_party/qml-rust/src/qmlregister.rs
+++ /dev/null
@@ -1,101 +0,0 @@
1use libc;
2
3use std::mem::forget;
4use std::collections::HashMap;
5use std::cell::UnsafeCell;
6
7use types::*;
8use qobject::*;
9use qmeta::*;
10use utils::*;
11
12extern "C" {
13 fn dos_qdeclarative_qmlregistertype(qmlRegisterType: *const QmlRegisterType) -> i32;
14 fn dos_qdeclarative_qmlregistersingletontype(qmlRegisterType: *const QmlRegisterType) -> i32;
15}
16
17#[repr(C)]
18pub struct QmlRegisterType {
19 major: i32,
20 minor: i32,
21 uri: DosCStr,
22 qml: DosCStr,
23 static_meta_object: DosQMetaObject,
24 create_dobject: CreateDObject,
25 delete_dobject: DeleteDObject,
26}
27
28pub type CreateDObject = extern "C" fn(i32, DosQObject, *mut *const libc::c_void, *mut DosQObject);
29pub type DeleteDObject = extern "C" fn(i32, *const libc::c_void);
30
31extern "C" fn delete_dobject(id: i32, ptr: *const libc::c_void) {}
32
33pub type RegisterQualifier = (i32, i32, &'static str, &'static str);
34#[doc(hidden)]
35pub trait QMLRegisterable: QObjectMacro {
36 fn qualify_to_register(&self) -> RegisterQualifier;
37 fn get_new(&self) -> *mut libc::c_void;
38 fn get_qobj_from_ptr(&self, ptr: *mut libc::c_void) -> *mut QObject;
39}
40
41extern "C" fn create_dobject(id: i32,
42 wrapper: DosQObject,
43 binded_ptr: *mut *const libc::c_void,
44 dosQObject: *mut DosQObject) {
45 let map = unsafe { &*(REGISTERED_TYPES.0.get()) };
46 // Getting shallow object from the map
47 let shallow = map.get(&id).unwrap();
48 // Getting pointer to a created object
49 let binded = shallow.get_new();
50
51 // Returning pointers to a wrapper and to an DosQObject, then swapping DosQObject with a fresh one
52 // Comments are copied 'as is' from the DOtherSide docs to ensure correctness
53 unsafe {
54 let mut qobj = &mut *shallow.get_qobj_from_ptr(binded);
55 // # Retrieve the DosQObject created dos_qobject_create() inside the nimQObject
56 *dosQObject = get_qobj_ptr(qobj);
57 // # Store the pointer to the nimQObject
58 *binded_ptr = get_binded_ptr(qobj);
59 // # Swap the vptr inside the nimQObject with the wrapper
60 set_qobj_ptr(qobj, wrapper);
61 }
62 forget(binded);
63}
64
65struct UnsafeWrapper(UnsafeCell<HashMap<i32, Box<QMLRegisterable>>>);
66unsafe impl Sync for UnsafeWrapper {}
67unsafe impl Send for UnsafeWrapper {}
68
69lazy_static!{
70 static ref REGISTERED_TYPES: UnsafeWrapper = UnsafeWrapper(UnsafeCell::new(HashMap::new()));
71}
72
73type Registerer = unsafe extern "C" fn(*const QmlRegisterType) -> i32;
74fn register_with<T: QMLRegisterable + 'static>(t: T, r: Registerer) {
75 let (major, minor, uri, qml) = t.qualify_to_register();
76 let qmeta = QMetaDefinition::new(t.qmeta());
77 let meta = QMeta::new_for_qobject(qmeta);
78 let mut map = unsafe { &mut *(REGISTERED_TYPES.0.get()) };
79
80 let qrt = QmlRegisterType {
81 major: major,
82 minor: minor,
83 uri: stoptr(uri),
84 qml: stoptr(qml),
85 static_meta_object: get_dos_qmeta(&meta),
86 create_dobject: create_dobject,
87 delete_dobject: delete_dobject,
88 };
89 forget(meta);
90 let id = unsafe { r(&qrt as *const QmlRegisterType) };
91 map.insert(id, Box::new(t));
92 forget(qrt);
93}
94
95pub fn register_qml_type<T: QMLRegisterable + 'static>(t: T) {
96 register_with(t, dos_qdeclarative_qmlregistertype)
97}
98
99pub fn register_qml_singleton_type<T: QMLRegisterable + 'static>(t: T) {
100 register_with(t, dos_qdeclarative_qmlregistersingletontype)
101}
diff --git a/prototype_2016/third_party/qml-rust/src/qmodelindex.rs b/prototype_2016/third_party/qml-rust/src/qmodelindex.rs
deleted file mode 100644
index 6b6d3e1..0000000
--- a/prototype_2016/third_party/qml-rust/src/qmodelindex.rs
+++ /dev/null
@@ -1,43 +0,0 @@
1
2use types::*;
3
4extern "C" {
5
6 fn dos_qmodelindex_create() -> DosQModelIndex;
7 // DOS_API DosQModelIndex *DOS_CALL dos_qmodelindex_create_qmodelindex(DosQModelIndex *index);
8 // DOS_API void DOS_CALL dos_qmodelindex_delete (DosQModelIndex *vptr);
9 fn dos_qmodelindex_row(vptr: DosQModelIndex) -> i32;
10 fn dos_qmodelindex_column(vptr: DosQModelIndex) -> i32;
11// DOS_API bool DOS_CALL dos_qmodelindex_isValid(const DosQModelIndex *vptr);
12// DOS_API DosQVariant *DOS_CALL dos_qmodelindex_data (const DosQModelIndex *vptr, int role);
13// DOS_API DosQModelIndex *DOS_CALL dos_qmodelindex_parent (const DosQModelIndex *vptr);
14// DOS_API DosQModelIndex *DOS_CALL dos_qmodelindex_child (const DosQModelIndex *vptr, int row, int column);
15// DOS_API DosQModelIndex *DOS_CALL dos_qmodelindex_sibling(const DosQModelIndex *vptr, int row, int column);
16// DOS_API void DOS_CALL dos_qmodelindex_assign (DosQModelIndex *l, const DosQModelIndex *r);
17}
18
19pub struct QModelIndex(DosQModelIndex);
20
21pub fn get_model_ptr(o: &QModelIndex) -> DosQModelIndex {
22 o.0
23}
24
25impl QModelIndex {
26 pub fn new() -> Self {
27 unsafe { QModelIndex(dos_qmodelindex_create()) }
28 }
29
30 pub fn row(&self) -> i32 {
31 unsafe { dos_qmodelindex_row(self.0) }
32 }
33
34 pub fn column(&self) -> i32 {
35 unsafe { dos_qmodelindex_column(self.0) }
36 }
37}
38
39impl From<DosQModelIndex> for QModelIndex {
40 fn from(i: DosQModelIndex) -> Self {
41 QModelIndex(i)
42 }
43}
diff --git a/prototype_2016/third_party/qml-rust/src/qobject.rs b/prototype_2016/third_party/qml-rust/src/qobject.rs
deleted file mode 100644
index f7caf4f..0000000
--- a/prototype_2016/third_party/qml-rust/src/qobject.rs
+++ /dev/null
@@ -1,120 +0,0 @@
1use libc;
2use std::mem::forget;
3use std::slice::from_raw_parts_mut;
4
5use qvariant::*;
6use types::*;
7use qmeta::*;
8
9#[doc(hidden)]
10/// Contains a pointer to raw Qt object.
11#[derive(Debug)]
12pub struct QObject {
13 ptr: DosQObject,
14 qmeta: DosQMetaObject,
15 binded_ptr: *mut libc::c_void,
16}
17
18extern "C" {
19
20 fn dos_qobject_create(dObjectPointer: *mut libc::c_void,
21 metaObject: DosQMetaObject,
22 dObjectCallback: DObjectCallback)
23 -> DosQObject;
24 fn dos_qobject_signal_connect(senderVPtr: DosQObject,
25 signal: *const libc::c_char,
26 receiverVPtr: DosQObject,
27 method: *const libc::c_char,
28 qtype: i32)
29 -> bool;
30 fn dos_qobject_delete(deleted: DosQObject);
31 fn dos_qmetaobject_delete(vptr: DosQMetaObject);
32}
33
34impl Drop for QObject {
35 fn drop(&mut self) {
36 unsafe {
37 dos_qobject_delete(self.ptr);
38 dos_qmetaobject_delete(self.qmeta);
39 }
40 }
41}
42
43macro_rules! QT_connect {
44 ($sender:ident, $signal:ident, $receiver:ident, $method:tt) => {{
45 unimplemented!()
46 }}
47}
48
49/// This enum describes the types of connection that can be used between signals and slots.
50/// In particular, it determines whether a particular signal is delivered to a slot immediately or queued for delivery at a later time.
51pub enum QtConnectionType {
52 /// **(Default)** If the receiver lives in the thread that emits the signal, Qt::DirectConnection is used. Otherwise, Qt::QueuedConnection is used. The connection type is determined when the signal is emitted.
53 Auto = 0,
54 /// The slot is invoked immediately when the signal is emitted. The slot is executed in the signalling thread.
55 Direct = 1,
56 /// The slot is invoked when control returns to the event loop of the receiver's thread. The slot is executed in the receiver's thread.
57 Queued = 2,
58 /// Same as Qt::QueuedConnection, except that the signalling thread blocks until the slot returns. This connection must not be used if the receiver lives in the signalling thread, or else the application will deadlock.
59 BlockingQueued = 3,
60 /// This is a flag that can be combined with any one of the above connection types, using a bitwise OR. When Qt::UniqueConnection is set, QObject::connect() will fail if the connection already exists (i.e. if the same signal is already connected to the same slot for the same pair of objects). This flag was introduced in Qt 4.6.
61 Unique = 0x80,
62}
63
64/// Called when a slot should be executed
65/// @param self The pointer to the `QObject` in the binded language
66/// @param slotName The slotName as `DosQVariant`. It should not be deleted
67/// @param argc The number of arguments
68/// @param argv An array of `DosQVariant` pointers. They should not be deleted
69type DObjectCallback = extern "C" fn(*mut libc::c_void, DosQVariant, i32, *mut DosQVariant);
70
71impl QObject {
72 pub fn new(obj: &mut QObjectMacro) -> QObject {
73 unsafe {
74 let qmeta = QMetaDefinition::new(obj.qmeta());
75 let meta = QMeta::new_for_qobject(qmeta);
76
77 // println!("Adress of wrapper {:p}", obj);
78 let obj = Box::new(obj);
79 let binded_ptr = Box::into_raw(obj) as *mut libc::c_void;
80 QObject {
81 ptr: dos_qobject_create(binded_ptr, get_dos_qmeta(&meta), callback),
82 qmeta: get_dos_qmeta(&meta),
83 binded_ptr: binded_ptr,
84 }
85 }
86 }
87}
88
89pub fn get_qobj_ptr(o: &QObject) -> DosQObject {
90 o.ptr
91}
92
93pub fn get_binded_ptr(o: &QObject) -> *mut libc::c_void {
94 o.binded_ptr
95}
96
97pub fn set_qobj_ptr(o: &mut QObject, ptr: DosQObject) {
98 o.ptr = ptr;
99}
100
101extern "C" fn callback(obj: *mut libc::c_void,
102 slotName: DosQVariant,
103 argc: i32,
104 argv: *mut DosQVariant) {
105 unsafe {
106 let mut obj: Box<&mut QObjectMacro> = Box::from_raw(obj as *mut &mut QObjectMacro);
107 // println!("Calling adress of wrapper {:p}", *obj.as_mut());
108 let slice = from_raw_parts_mut(argv, argc as usize);
109 let vec: Vec<QVariant> = slice.iter().skip(1).map(|&dq| dq.into()).collect();
110 let slotName: String = new_qvariant(slotName).into();
111 // println!("Right before going in... name: {}, argc: {}",
112 // slotName,
113 // argc);
114 if let Some(qvar) = obj.qslot_call(&slotName, vec) {
115 let mut qv: QVariant = slice[0].into();
116 qv.set(qvar);
117 }
118 forget(obj);
119 }
120}
diff --git a/prototype_2016/third_party/qml-rust/src/qresource.rs b/prototype_2016/third_party/qml-rust/src/qresource.rs
deleted file mode 100644
index efe3705..0000000
--- a/prototype_2016/third_party/qml-rust/src/qresource.rs
+++ /dev/null
@@ -1,11 +0,0 @@
1use types::*;
2use utils::*;
3
4extern "C" {
5 fn dos_qresource_register(filename: DosCStr);
6}
7
8/// Registers a binary resource file created by rcc
9pub fn register_resources(filename: &str) {
10 unsafe { dos_qresource_register(stoptr(filename)) }
11}
diff --git a/prototype_2016/third_party/qml-rust/src/qtypes.rs b/prototype_2016/third_party/qml-rust/src/qtypes.rs
deleted file mode 100644
index eea7278..0000000
--- a/prototype_2016/third_party/qml-rust/src/qtypes.rs
+++ /dev/null
@@ -1,36 +0,0 @@
1//! Contains definitions required to communicate with Qt with the use of `named types`.
2//!
3//! Provides definition of [`QMetaType`](enum.QMetaType.html) enum, that contains mapping of named types
4//! and a trait [`QMetaTypable`](trait.QMetaTypable.html), that controls which types are able to be used in signals, slots or properties.
5
6/// Provides an associated variant of enum for a type.
7///
8/// Only types that implement this, may be used as types in signals, slots or properties.
9pub trait QMetaTypable {
10 /// Returns an associate variant of QMetaType
11 fn metatype() -> QMetaType;
12}
13
14impl QMetaTypable for i32 {
15 fn metatype() -> QMetaType {
16 QMetaType::Int
17 }
18}
19
20impl QMetaTypable for String {
21 fn metatype() -> QMetaType {
22 QMetaType::QString
23 }
24}
25
26/// Analogue of [`Qt::QMetaType::Type`](http://doc.qt.io/qt-5/qmetatype.html#Type-enum)
27///
28/// `QMetaType` in Qt manages named types in the meta-object system.
29pub enum QMetaType {
30 Void = 43,
31 Bool = 1,
32 Int = 2,
33 Double = 6,
34 Long = 32,
35 QString = 10,
36}
diff --git a/prototype_2016/third_party/qml-rust/src/qurl.rs b/prototype_2016/third_party/qml-rust/src/qurl.rs
deleted file mode 100644
index e9948b8..0000000
--- a/prototype_2016/third_party/qml-rust/src/qurl.rs
+++ /dev/null
@@ -1,17 +0,0 @@
1use libc;
2
3use utils::*;
4use types::*;
5
6extern "C" {
7
8 // QUrl
9 fn dos_qurl_create(url: *const libc::c_char, parsingMode: i32) -> DosQUrl;
10// DOS_API void DOS_CALL dos_qurl_delete(DosQUrl *vptr);
11// DOS_API char *DOS_CALL dos_qurl_to_string(const DosQUrl *vptr);
12// DOS_API bool dos_qurl_isValid(const DosQUrl *vptr);
13}
14
15pub fn construct_qurl(url: &str) -> DosQUrl {
16 unsafe { dos_qurl_create(stoptr(url), 0) }
17}
diff --git a/prototype_2016/third_party/qml-rust/src/qvariant.rs b/prototype_2016/third_party/qml-rust/src/qvariant.rs
deleted file mode 100644
index 40fda96..0000000
--- a/prototype_2016/third_party/qml-rust/src/qvariant.rs
+++ /dev/null
@@ -1,270 +0,0 @@
1use libc;
2use std::ffi::CStr;
3use std::sync::atomic::{AtomicPtr, Ordering};
4
5use utils::*;
6use types::*;
7use qobject::*;
8
9extern "C" {
10 fn dos_qvariant_create() -> DosQVariant;
11 fn dos_qvariant_create_int(value: i32) -> DosQVariant;
12 fn dos_qvariant_create_bool(value: bool) -> DosQVariant;
13 fn dos_qvariant_create_string(value: DosCStr) -> DosQVariant;
14 fn dos_qvariant_create_qobject(value: DosQObject) -> DosQVariant;
15 fn dos_qvariant_create_qvariant(value: DosQVariant) -> DosQVariant;
16 fn dos_qvariant_create_float(value: f32) -> DosQVariant;
17 fn dos_qvariant_create_double(value: f64) -> DosQVariant;
18 fn dos_qvariant_create_array(size: i32, array: *const DosQVariant) -> DosQVariant;
19
20 fn dos_qvariant_toInt(val: DosQVariant) -> i32;
21 fn dos_qvariant_toBool(val: DosQVariant) -> bool;
22 fn dos_qvariant_toString(val: DosQVariant) -> *mut libc::c_char;
23 fn dos_qvariant_toFloat(val: DosQVariant) -> f32;
24 fn dos_qvariant_toDouble(val: DosQVariant) -> f64;
25 // DOS_API DosQObject *DOS_CALL dos_qvariant_toQObject(const DosQVariant *vptr);
26
27 fn dos_qvariant_isnull(val: DosQVariant) -> bool;
28 fn dos_qvariant_assign(val: MutDosQVariant, other: DosQVariant);
29 fn dos_qvariant_delete(val: DosQVariant);
30 fn dos_chararray_delete(ptr: DosCStr);
31// DOS_API void DOS_CALL dos_qvariant_setInt (DosQVariant *vptr, int value);
32// DOS_API void DOS_CALL dos_qvariant_setBool (DosQVariant *vptr, bool value);
33// DOS_API void DOS_CALL dos_qvariant_setFloat (DosQVariant *vptr, float value);
34// DOS_API void DOS_CALL dos_qvariant_setDouble (DosQVariant *vptr, double value);
35// DOS_API void DOS_CALL dos_qvariant_setString (DosQVariant *vptr, const char *value);
36// DOS_API void DOS_CALL dos_qvariant_setQObject(DosQVariant *vptr, DosQObject *value);
37
38}
39
40/// This holds a value to be providen for a QML context.
41///
42/// A value can be different: int, string, float, double, bool or even a custom object.
43#[derive(Debug)]
44pub struct QVariant {
45 ptr: AtomicPtr<WQVariant>,
46 owned: bool,
47}
48
49impl PartialEq for QVariant {
50 fn eq(&self, other: &QVariant) -> bool {
51 self.ptr.load(Ordering::Relaxed) == other.ptr.load(Ordering::Relaxed)
52 }
53}
54
55impl Clone for QVariant {
56 fn clone(&self) -> Self {
57 unsafe {
58 new_qvar(dos_qvariant_create_qvariant(self.ptr.load(Ordering::Relaxed)),
59 true)
60 }
61 }
62}
63
64impl QVariant {
65 pub fn to_int(&self) -> i32 {
66 unsafe { dos_qvariant_toInt(self.ptr.load(Ordering::Relaxed)) }
67 }
68
69 pub fn into_bool(self) -> bool {
70 unsafe { dos_qvariant_toBool(self.ptr.load(Ordering::Relaxed)) }
71 }
72
73 pub fn into_float(self) -> f32 {
74 unsafe { dos_qvariant_toFloat(self.ptr.load(Ordering::Relaxed)) }
75 }
76
77 pub fn into_double(self) -> f64 {
78 unsafe { dos_qvariant_toDouble(self.ptr.load(Ordering::Relaxed)) }
79 }
80
81 /// Sets the value for this `QVariant`
82 pub fn set(&mut self, other: &QVariant) {
83 unsafe {
84 dos_qvariant_assign(self.ptr.load(Ordering::Relaxed),
85 other.ptr.load(Ordering::Relaxed));
86 }
87 }
88}
89
90pub fn throw(qvar: &mut QVariant, flag: bool) {
91 qvar.owned = flag;
92}
93fn new_qvar(ptr: DosQVariant, owned: bool) -> QVariant {
94 QVariant {
95 ptr: AtomicPtr::new(ptr as MutDosQVariant),
96 owned: owned,
97 }
98}
99
100pub fn new_qvariant(ptr: DosQVariant) -> QVariant {
101 new_qvar(ptr, false)
102}
103
104pub fn get_private_variant(from: &QVariant) -> DosQVariant {
105 from.ptr.load(Ordering::Relaxed)
106}
107
108impl Drop for QVariant {
109 fn drop(&mut self) {
110 if self.owned {
111 unsafe { dos_qvariant_delete(self.ptr.load(Ordering::Relaxed)) }
112 }
113 }
114}
115
116#[doc(hidden)]
117impl From<DosQObject> for QVariant {
118 fn from(i: DosQObject) -> Self {
119 unsafe { new_qvar(dos_qvariant_create_qobject(i), true) }
120 }
121}
122
123#[doc(hidden)]
124impl From<DosQAbstractListModel> for QVariant {
125 fn from(i: DosQAbstractListModel) -> Self {
126 unsafe { new_qvar(dos_qvariant_create_qobject(i as DosQObject), true) }
127 }
128}
129
130#[doc(hidden)]
131impl From<DosQVariant> for QVariant {
132 fn from(vptr: DosQVariant) -> Self {
133 new_qvar(vptr, false)
134 }
135}
136
137#[doc(hidden)]
138impl From<MutDosQVariant> for QVariant {
139 fn from(vptr: MutDosQVariant) -> Self {
140 new_qvar(vptr, false)
141 }
142}
143
144#[doc(hidden)]
145impl From<QObject> for QVariant {
146 fn from(i: QObject) -> Self {
147 unsafe { new_qvar(dos_qvariant_create_qobject(get_qobj_ptr(&i)), true) }
148 }
149}
150
151impl<'a> From<&'a [QVariant]> for QVariant {
152 fn from(i: &'a [QVariant]) -> Self {
153 unsafe {
154 let vec = i.iter()
155 .map(|qvar| qvar.ptr.load(Ordering::Relaxed) as DosQVariant)
156 .collect::<Vec<DosQVariant>>();
157 let ptr = vec.as_ptr();
158 forget(vec);
159 new_qvar(dos_qvariant_create_array(i.len() as i32, ptr), true)
160 }
161 }
162}
163
164use std::mem::forget;
165
166impl From<Vec<QVariant>> for QVariant {
167 fn from(i: Vec<QVariant>) -> Self {
168 unsafe {
169 let len = i.len();
170 let vec = i.iter()
171 .map(|qvar| qvar.ptr.load(Ordering::Relaxed) as DosQVariant)
172 .collect::<Vec<DosQVariant>>();
173 let ptr = vec.as_ptr();
174 forget(vec);
175 new_qvar(dos_qvariant_create_array(len as i32, ptr), true)
176 }
177 }
178}
179
180#[doc(hidden)]
181impl<'a> From<&'a QObject> for QVariant {
182 fn from(i: &'a QObject) -> Self {
183 unsafe { new_qvar(dos_qvariant_create_qobject(get_qobj_ptr(i)), true) }
184 }
185}
186
187impl From<i32> for QVariant {
188 fn from(i: i32) -> Self {
189 unsafe { new_qvar(dos_qvariant_create_int(i), true) }
190 }
191}
192
193impl From<f32> for QVariant {
194 fn from(i: f32) -> Self {
195 unsafe { new_qvar(dos_qvariant_create_float(i), true) }
196 }
197}
198
199impl From<f64> for QVariant {
200 fn from(i: f64) -> Self {
201 unsafe { new_qvar(dos_qvariant_create_double(i), true) }
202 }
203}
204
205impl From<bool> for QVariant {
206 fn from(i: bool) -> Self {
207 unsafe { new_qvar(dos_qvariant_create_bool(i), true) }
208 }
209}
210
211impl<'a> From<&'a str> for QVariant {
212 fn from(i: &'a str) -> Self {
213 unsafe {
214 let ptr = stoptr(i);
215 let qvar = new_qvar(dos_qvariant_create_string(ptr), true);
216 // Dropping CString
217 ptrtos(ptr);
218 qvar
219 }
220 }
221}
222
223impl From<String> for QVariant {
224 fn from(i: String) -> Self {
225 QVariant::from(i.as_str())
226 }
227}
228
229// reverse Froms
230impl From<QVariant> for i32 {
231 fn from(i: QVariant) -> Self {
232 unsafe { dos_qvariant_toInt(i.ptr.load(Ordering::Relaxed)) }
233 }
234}
235
236impl<'a> From<&'a QVariant> for i32 {
237 fn from(i: &'a QVariant) -> Self {
238 i.to_int()
239 }
240}
241
242impl From<QVariant> for String {
243 fn from(i: QVariant) -> Self {
244 unsafe {
245 let ch_ar = dos_qvariant_toString(load_self(&i));
246 let res = CStr::from_ptr(ch_ar)
247 .to_string_lossy()
248 .into_owned();
249 dos_chararray_delete(ch_ar);
250 res
251 }
252 }
253}
254
255impl<'a> From<&'a QVariant> for String {
256 fn from(i: &'a QVariant) -> Self {
257 unsafe {
258 let ch_ar = dos_qvariant_toString(load_self(i));
259 let res = CStr::from_ptr(ch_ar)
260 .to_string_lossy()
261 .into_owned();
262 dos_chararray_delete(ch_ar);
263 res
264 }
265 }
266}
267
268fn load_self(s: &QVariant) -> DosQVariant {
269 s.ptr.load(Ordering::Relaxed)
270}
diff --git a/prototype_2016/third_party/qml-rust/src/types.rs b/prototype_2016/third_party/qml-rust/src/types.rs
deleted file mode 100644
index 11b24d4..0000000
--- a/prototype_2016/third_party/qml-rust/src/types.rs
+++ /dev/null
@@ -1,24 +0,0 @@
1use libc;
2
3pub type DosQVariant = *const WQVariant;
4pub type MutDosQVariant = *mut WQVariant;
5pub type DosQObject = *mut WQObject;
6pub type DosQmlApplicationEngine = *mut WQmlApplicationEngine;
7pub type DosQQmlContext = *const WQQmlContext;
8pub type DosQModelIndex = *const WQModelIndex;
9pub type MutDosQHashIntQByteArray = *mut WQHashIntQByteArray;
10pub type DosQMetaObject = *const WQMetaObject;
11pub type DosQAbstractListModel = *mut WQAbstractListModel;
12pub type DosQUrl = *mut WQUrl;
13
14pub type DosCStr = *const libc::c_char;
15
16pub enum WQVariant {}
17pub enum WQObject {}
18pub enum WQmlApplicationEngine {}
19pub enum WQQmlContext {}
20pub enum WQModelIndex {}
21pub enum WQHashIntQByteArray {}
22pub enum WQMetaObject {}
23pub enum WQAbstractListModel {}
24pub enum WQUrl {}
diff --git a/prototype_2016/third_party/qml-rust/src/utils.rs b/prototype_2016/third_party/qml-rust/src/utils.rs
deleted file mode 100644
index 8b9b063..0000000
--- a/prototype_2016/third_party/qml-rust/src/utils.rs
+++ /dev/null
@@ -1,11 +0,0 @@
1use libc;
2
3use std::ffi::CString;
4pub fn stoptr(s: &str) -> *const libc::c_char {
5 let cstr = CString::new(s).unwrap();
6 cstr.into_raw() as *const i8
7}
8
9pub fn ptrtos(ptr: *const i8) -> CString {
10 unsafe { CString::from_raw(ptr as *mut i8) }
11}