diff --git a/HIG/source/img/BernaFace.jpg b/HIG/source/img/BernaFace.jpg new file mode 100644 index 0000000..4bfb94a Binary files /dev/null and b/HIG/source/img/BernaFace.jpg differ diff --git a/HIG/source/img/MattFace.jpg b/HIG/source/img/MattFace.jpg new file mode 100644 index 0000000..adecb0a Binary files /dev/null and b/HIG/source/img/MattFace.jpg differ diff --git a/HIG/source/img/PhilipFace.jpg b/HIG/source/img/PhilipFace.jpg new file mode 100644 index 0000000..b0c81a9 Binary files /dev/null and b/HIG/source/img/PhilipFace.jpg differ diff --git a/HIG/source/img/SantiagoFace.jpg b/HIG/source/img/SantiagoFace.jpg new file mode 100644 index 0000000..99bd20b Binary files /dev/null and b/HIG/source/img/SantiagoFace.jpg differ diff --git a/HIG/source/img/SusanFace.jpg b/HIG/source/img/SusanFace.jpg new file mode 100644 index 0000000..a7ec68b Binary files /dev/null and b/HIG/source/img/SusanFace.jpg differ diff --git a/HIG/source/qml/addr/Addressbook.qml b/HIG/source/qml/addr/Addressbook.qml new file mode 100644 index 0000000..12cfa5b --- /dev/null +++ b/HIG/source/qml/addr/Addressbook.qml @@ -0,0 +1,224 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 +import org.kde.kirigami 2.7 as Kirigami +import "../models/" as Models + +Kirigami.ApplicationItem { + width: parent.width + height: parent.height + id: root + + property alias gDrawer: global + property alias cDrawer: context + property Item detailPage; + property Item listPage; + property Item historyPage; + property int index: -1 + + property bool wide: false + + property var mydata : Models.Contacts { + Component.onCompleted: { + adjustGlobalDrawer(); + root.pageStack.push(Qt.resolvedUrl("ListPage.qml"), {model: root.mydata}); + listPage = root.pageStack.lastItem; + if (root.index >= 0) { + setIndex(root.index) + } + listPage.currentIndexChanged.connect(function() { + setIndex(listPage.currentIndex); + }); + } + } + + /*pageStack.initialPage: ListPage { + id: list + onCurrentIndexChanged: { + setIndex(list.currentIndex) + } + Kirigami.ColumnView.fillWidth: false + }*/ + + function setIndex(i) { + //return; + console.log("setIndex") + if (root.pageStack.depth == 1) { + root.pageStack.push(Qt.resolvedUrl("DetailPage.qml"), {model: root.mydata.get(i)}); + detailPage = root.pageStack.lastItem; + } + detailPage.model = mydata.get(i) + + if (root.wide) { + if (root.pageStack.depth == 2) { + root.pageStack.push(Qt.resolvedUrl("HistoryPage.qml"), {model: root.mydata.get(i)}) + historyPage = root.pageStack.lastItem; + } + historyPage.model = mydata.get(i) + show3Columns(); + } + else { + show2Columns(); + } + } + + pageStack.defaultColumnWidth: root.width < 320 ? root.width : 320 + pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Auto + + /*DetailPage { + id: detail + visible: false + showHistory: root.wide + Kirigami.ColumnView.fillWidth: true + //Kirigami.ColumnView.reservedSpace: pageStack.defaultColumnWidth * 2 + + Share { + id: share + sheetOpen: true + model: mydata + } + } + + HistoryPage { + id: history + visible: false + //Kirigami.ColumnView.fillWidth: false + }*/ + function show3Columns() { + if (listPage) { + listPage. Kirigami.ColumnView.fillWidth = false + } + if (detailPage) { + detailPage.Kirigami.ColumnView.reservedSpace = pageStack.defaultColumnWidth * 2 + detailPage.Kirigami.ColumnView.fillWidth = true + } + if (historyPage) { + historyPage.Kirigami.ColumnView.fillWidth = false + } + } + + function show2Columns() { + //listPage. Kirigami.ColumnView.fillWidth = true + if (detailPage) { + detailPage.Kirigami.ColumnView.reservedSpace = pageStack.defaultColumnWidth + detailPage.Kirigami.ColumnView.fillWidth = true + } + while (root.pageStack.depth > 2) { + root.pageStack.pop() + } + } + + function adjustGlobalDrawer() { + // Change drawer to collapsible if there is enough space + if (width >= 1100 && !global.collapsible) { + console.log("onWidthChanged collapsible") + global.modal = false; + global.collapsible = true + global.collapsed = true; + global.drawerOpen = true + } + + if (width < 1100 && global.collapsible) { + console.log("onWidthChanged not collapsible") + global.drawerOpen = false + global.collapsible = false + global.modal = true + } + } + + + onWidthChanged: { + // Show 3 columns + if (width >= 1050 && !root.wide) { + console.log("onWidthChanged wide") + root.wide = true + show3Columns(); + } + + // Show 2 columns + if (width < 1050 && root.wide) { + console.log("onWidthChanged narrow") + root.wide = false + show2Columns() + } + + adjustGlobalDrawer(); + } + + globalDrawer: Kirigami.GlobalDrawer { + id: global + title: "Joanne Doe" + titleIcon: "../../img/BernaFace.jpg" + + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Complementary + + topContent: [ + Row { + Layout.alignment: Qt.AlignRight | Qt.AlignBottom + //anchors.right: parent.right + anchors.rightMargin: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing + spacing: Kirigami.Settings.tabletMode ? 2 * Kirigami.Units.largeSpacing : 2 * Kirigami.Units.smallSpacing + //anchors.bottomMargin: 4 * Kirigami.Units.largeSpacing + + Kirigami.Icon { + source: "document-share" + width: Kirigami.Units.iconSizes.smallMedium + height: width + anchors.verticalCenter: parent.verticalCenter + } + Kirigami.Icon { + source: "document-edit" + width: Kirigami.Units.iconSizes.smallMedium + height: width + anchors.verticalCenter: parent.verticalCenter + } + } + ] + actions: [ + Kirigami.Action { + iconName: "document-import" + text: i18n("&Import contacts") + }, + Kirigami.Action { + iconName: "document-export" + text: i18n("&Export contacts") + }, + Kirigami.Action { + iconName: "user-group-delete" + text: i18n("&Merge contacts") + }, + Kirigami.Action { + iconName: "user-group-new" + text: i18n("&Search duplicate contacts") + }, + Kirigami.Action { + iconName: "configure" + text: i18n("&Settings") + } + ] + } + + contextDrawer: Kirigami.ContextDrawer { + id: context + } +} diff --git a/HIG/source/qml/addr/Detail.qml b/HIG/source/qml/addr/Detail.qml new file mode 100644 index 0000000..b265d2c --- /dev/null +++ b/HIG/source/qml/addr/Detail.qml @@ -0,0 +1,182 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import QtQuick 2.2 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import QtGraphicalEffects 1.0 + +import "../lib/" as HIG + + +Flickable { + id: root + property var model; + property alias history: history + signal editClicked() + + HIG.Header { + id: header + content.anchors.leftMargin: root.width > 400 ? 100 : Kirigami.Units.largeSpacing + content.anchors.topMargin: Kirigami.Units.largeSpacing + content.anchors.bottomMargin: Kirigami.Units.largeSpacing + //status: root.contentY == 0 ? 1 : Math.min(1, Math.max(2 / 11, 1 - root.contentY / Kirigami.Units.gridUnit)) + source: "../../img/" + model.image + + + /*Kirigami.ActionToolBar { + anchors.fill: parent + //spacing: (header.width - 3 * Kirigami.Units.iconSizes.medium) / 4 + //anchors.leftMargin: spacing + actions: [ + Kirigami.Action { + iconName: "favorite" + text: "Save as favorite" + }, + Kirigami.Action { + iconName: "favorite" + text: "Save as favorite" + }, + Kirigami.Action { + iconName: "favorite" + text: "Save as favorite" + } + ]}*/ + + stripContent: Row { + anchors.fill: parent + spacing: (header.width - 3 * Kirigami.Units.iconSizes.medium) / 4 + anchors.leftMargin: spacing + + + Kirigami.Icon { + source: "favorite" + width: Kirigami.Units.iconSizes.smallMedium + height: width + anchors.verticalCenter: parent.verticalCenter + } + Kirigami.Icon { + source: "document-share" + width: Kirigami.Units.iconSizes.smallMedium + height: width + anchors.verticalCenter: parent.verticalCenter + } + Kirigami.Icon { + source: "document-edit" + width: Kirigami.Units.iconSizes.smallMedium + height: width + anchors.verticalCenter: parent.verticalCenter + MouseArea { + onClicked: root.editClicked() + anchors.fill: parent + } + } + } + + Kirigami.Heading { + text: model.firstname + " " + model.lastname + //color: Kirigami.Theme.textColor + color: "#fcfcfc" // Hard coded because of the ColorOverlay + level: 1 + width: parent.width + wrapMode: Text.WordWrap + } + } + + Column { + id: comm + anchors.top: header.bottom + anchors.topMargin: 2 * Kirigami.Units.largeSpacing + width: parent.width + + Repeater { + model: root.model.communication + + delegate: Kirigami.BasicListItem { + //height: Kirigami.Units.gridUnit * 2 + id: delegate + contentItem: RowLayout { + spacing: delegate.leftPadding + anchors.verticalCenter: parent.verticalCenter + + Kirigami.Icon { + id: icon + width: Kirigami.Units.iconSizes.smallMedium + height: width + source: model.icon + color: Kirigami.Theme.textColor + Layout.alignment: Qt.AlignVCenter + } + Column { + Layout.alignment: Qt.AlignVCenter + Label { + text: model.text + color: model.default ? Kirigami.Theme.linkColor : Kirigami.Theme.textColor //"#2980b9" : "#232627" + } + Label { + text: model.description + font.pointSize: 8 + color: Kirigami.Theme.textColor //"#7f8c8d" + } + } + Rectangle { + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + + Kirigami.Icon { + visible: typeof model.actions !== "undefined" + source: "kmouth-phrase-new" + width: Kirigami.Units.iconSizes.smallMedium + height: width + anchors.right: parent.right + anchors.rightMargin: Kirigami.Units.largeSpacing + anchors.verticalCenter: parent.verticalCenter + id: call + } + } + } + + /*Component.onCompleted: { + if (typeof model.actions !== "undefined") { + delegate.actions = model.actions + } + }*/ + } + } + } + + Kirigami.Heading { + level: 4 + visible: typeof root.model.history !== "undefined" && root.model.history.count && history.visible + text: "History" + id: hTitle + anchors.top: comm.bottom + anchors.left: parent.left + anchors.topMargin: 2 * Kirigami.Units.largeSpacing + anchors.leftMargin: Kirigami.Units.largeSpacing + } + + History { + id: history + anchors.top: hTitle.bottom + anchors.topMargin: Kirigami.Units.largeSpacing + width: root.width + model: root.model + } +} diff --git a/HIG/source/qml/addr/DetailPage.qml b/HIG/source/qml/addr/DetailPage.qml new file mode 100644 index 0000000..18aba16 --- /dev/null +++ b/HIG/source/qml/addr/DetailPage.qml @@ -0,0 +1,98 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami + +Kirigami.ScrollablePage { + property var model; + visible: false + id: page + title: Kirigami.Settings.tabletMode ? model.firstname : "" + Kirigami.Theme.colorSet: Kirigami.Theme.View + property bool showHistory; + + function showForm() { + + } + + background: Rectangle { + color: Kirigami.Theme.backgroundColor + } + + Detail { + model: page.model + onEditClicked: formOverlay.open() + history.visible: showHistory + } + + FormPage { + id: formOverlay + model: page.model + } + + actions { + left: Kirigami.Action { + iconName: "mail-message" + text: "Write mail" + } + main: Kirigami.Action { + iconName: "call-start" + text: "Make call" + onTriggered: sheet.open() + } + right: Kirigami.Action { + iconName: "kmouth-phrase-new" + text: "Write SMS" + } + } + + contextualActions: [ + Kirigami.Action { + iconName: "favorite" + text: "Select as favorite" + }, + Kirigami.Action { + iconName: "document-share" + text: "Share" + }, + Kirigami.Action { + iconName: "document-edit" + text: "Edit" + }, + Kirigami.Action { + iconName: "edit-image-face-add" + text: "Choose photo" + }, + Kirigami.Action { + iconName: "im-kick-user" + text: "Block number" + }, + Kirigami.Action { + iconName: "delete" + text: "Delete contact" + }, + Kirigami.Action { + iconName: "edit-clear-history" + text: "Delete history" + } + ] +} diff --git a/HIG/source/qml/addr/Form.qml b/HIG/source/qml/addr/Form.qml new file mode 100644 index 0000000..faa88a1 --- /dev/null +++ b/HIG/source/qml/addr/Form.qml @@ -0,0 +1,78 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import QtQuick 2.2 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import QtGraphicalEffects 1.0 + +import "../lib/" as HIG + + +ColumnLayout { + id: root + property var model; + spacing: 2 * Kirigami.Units.largeSpacing + + + Kirigami.FormLayout { + id: form + Layout.preferredWidth: Math.round(page.width * 0.9) + + TextField { + Kirigami.FormData.label: "Firstname:" + text: model.firstname + } + TextField { + Kirigami.FormData.label: "Lastname:" + text: model.lastname + } + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: "Phone" + } + Repeater { + model: root.model.communication + delegate: TextField { + visible: model.type === "phone" + Kirigami.FormData.label: model.description + ":" + text: model.text + } + } + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: "Email" + } + Repeater { + model: root.model.communication + delegate: TextField { + visible: model.type === "email" + Kirigami.FormData.label: model.description + ":" + text: model.text + } + } + Kirigami.Separator { + Kirigami.FormData.isSection: true + } + + Switch { + Kirigami.FormData.label: "Additional fields" + } + } +} diff --git a/HIG/source/qml/addr/FormPage.qml b/HIG/source/qml/addr/FormPage.qml new file mode 100644 index 0000000..7d61a0f --- /dev/null +++ b/HIG/source/qml/addr/FormPage.qml @@ -0,0 +1,53 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami + +Kirigami.OverlaySheet { + property var model; + Kirigami.Theme.colorSet: Kirigami.Theme.View + id: sheet + //Layout.preferredWidth: Math.round(page.width * 0.9) + + background: Rectangle { + color: Kirigami.Theme.backgroundColor + } + + header: Kirigami.Heading { + text: "Edit details" + level: 1 + } + + showCloseButton: true + + footer: Row { + height: childrenRect.height + layoutDirection: Qt.RightToLeft + Button { + text: "Save" + } + } + + Form { + model: sheet.model + } +} diff --git a/HIG/source/qml/addr/History.qml b/HIG/source/qml/addr/History.qml new file mode 100644 index 0000000..7c1bed0 --- /dev/null +++ b/HIG/source/qml/addr/History.qml @@ -0,0 +1,59 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import QtQuick 2.2 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami + +Column { + id: root + property var model; + + Repeater { + model: root.model.history + + delegate: Kirigami.SwipeListItem { + id: listItem + Row { + spacing: listItem.leftPadding + anchors.verticalCenter: parent.verticalCenter + + Kirigami.Icon { + width: Kirigami.Units.iconSizes.smallMedium + height: width + source: model.icon + color: Kirigami.Theme.disabledTextColor //"#232627" + anchors.verticalCenter: parent.verticalCenter + } + Column { + anchors.verticalCenter: parent.verticalCenter + Label { + text: model.text + color: Kirigami.Theme.textColor //"#232627" + } + Label { + text: model.date + font.pointSize: 8 + color: Kirigami.Theme.disabledTextColor // "#7f8c8d" + } + } + } + } + } +} diff --git a/HIG/source/qml/addr/HistoryPage.qml b/HIG/source/qml/addr/HistoryPage.qml new file mode 100644 index 0000000..79587cf --- /dev/null +++ b/HIG/source/qml/addr/HistoryPage.qml @@ -0,0 +1,43 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami + +Kirigami.ScrollablePage { + property var model; + visible: false + id: page + title: "History" + Kirigami.Theme.colorSet: Kirigami.Theme.View + width: 300 + + background: Rectangle { + color: Kirigami.Theme.backgroundColor + } + + + History { + anchors.fill: parent; + width: page.width + model: page.model + } +} diff --git a/HIG/source/qml/addr/List.qml b/HIG/source/qml/addr/List.qml new file mode 100644 index 0000000..64b6f71 --- /dev/null +++ b/HIG/source/qml/addr/List.qml @@ -0,0 +1,74 @@ + +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import QtQuick 2.10 +import QtQuick.Controls 2.2 +import org.kde.kirigami 2.4 as Kirigami +import QtGraphicalEffects 1.0 + +import "../lib/" as HIG + +ListView { + currentIndex: -1 + id: list + + delegate: Kirigami.SwipeListItem { + property alias image: img + onClicked: list.currentIndex = index + id: listItem + + contentItem: Row { + spacing: listItem.leftPadding //Kirigami.Settings.tabletMode ? 2 * Kirigami.Units.largeSpacing : 2 * Kirigami.Units.smallSpacing + + Item { + width: Kirigami.Units.iconSizes.medium + height: width + + Image { + id: img + width: parent.width + height: width + source: "../../img/" + model.image + visible: false + } + OpacityMask { + anchors.fill: img + source: img + maskSource: Rectangle { + height: img.width + width: height + radius: height / 2 + } + } + } + Label { + anchors.verticalCenter: parent.verticalCenter + text: model.firstname + " " + model.lastname + } + } + actions: [ + Kirigami.Action { + iconName: "call-start" + }, + Kirigami.Action { + iconName: "mail-message" + } + ] + } +} diff --git a/HIG/source/qml/addr/ListPage.qml b/HIG/source/qml/addr/ListPage.qml new file mode 100644 index 0000000..9763dd0 --- /dev/null +++ b/HIG/source/qml/addr/ListPage.qml @@ -0,0 +1,76 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami + +Kirigami.ScrollablePage { + property alias currentIndex: list.currentIndex; + property var model; + Kirigami.Theme.colorSet: Kirigami.Theme.View + title: "Address book" + id: page + + //Kirigami.Theme.inherit: false + //Kirigami.Theme.colorSet: Kirigami.Theme.Complementary + + background: Rectangle { + color: Kirigami.Theme.backgroundColor + } + + header: Rectangle { + clip: true + id: header + //color: "#3daee9" + height: searchField.implicitHeight + 2 * Kirigami.Units.largeSpacing + width: root.width + //border.width: 1 + //border.color: "#bdc3c7" + color: Kirigami.Theme.backgroundColor + + TextField { + id: searchField + placeholderText: "Search" + anchors.centerIn: parent + anchors.margins: Kirigami.Units.largeSpacing + width: parent.width - 2 * Kirigami.Units.largeSpacing + } + } + + List { + id: list + width: page.width + height: page.height + model: page.model + } + + actions { + main: Kirigami.Action { + id: add + iconName: "list-add-user" + text: "Create contact" + //icon.color: Kirigami.Theme.positiveTextColor + } + /*right: Kirigami.Action { + iconName: "system-search" + }*/ + } +} diff --git a/HIG/source/qml/addr/Test2.qml b/HIG/source/qml/addr/Test2.qml new file mode 100644 index 0000000..358edc8 --- /dev/null +++ b/HIG/source/qml/addr/Test2.qml @@ -0,0 +1,92 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../models/" as Models +import "../lib/annotate.js" as A + +Kirigami.ApplicationItem { + width: 320 + height: 600 + id: root + + property var mydata : Models.Contacts { + Component.onCompleted: { + detail.model = mydata.get(3) + detail.visible = true + } + } + + pageStack.initialPage: ListPage { + id: list + } + + pageStack.defaultColumnWidth: root.width < 320 ? root.width : 320 + pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Breadcrumb + + DetailPage { + id: detail + visible: false + } + + contextDrawer: Kirigami.ContextDrawer { + id: contextDrawer + } + + /*globalDrawer: Kirigami.GlobalDrawer { + actions: [Kirigami.Action { + iconName: "call-start" + }, + Kirigami.Action { + iconName: "mail-message" + } + ] + }*/ + + Component.onCompleted: { + root.pageStack.push(detail) + } + + + + // HACK + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + var a = new A.An(list); + //a.find("swipelistitem").eq(3).swipe({fromX: +140, fromY: 0, toX: -80, toY: 0}); + //a.find("swipelistitem").eq(3).find("qquickimage").touch(); + } + } + + Timer { + interval: 5000 + repeat: false + running: true + onTriggered: { + var b = new A.An(root); + //b.find("pagerowglobaltoolbarui").find("heading").first().touch(); + } + } +} diff --git a/HIG/source/qml/addr/Test3.qml b/HIG/source/qml/addr/Test3.qml new file mode 100644 index 0000000..288f331 --- /dev/null +++ b/HIG/source/qml/addr/Test3.qml @@ -0,0 +1,53 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.5 as Kirigami +import "../models/" as Models +import "../lib/" as HIG +import "../lib/annotate.js" as A + + +Rectangle { + width: 1600 + height: 1000 + id: root + + HIG.Desktop { + id: desktop + x: 200 + y: 40 + width: parent.width * 0.8 + Addressbook { + index: 3 + } + } + +// Timer { +// interval: 2000 +// repeat: false +// running: true +// onTriggered: { +// desktop.width = 800 +// desktop.state = "LAPTOP" +// } +// } +} diff --git a/HIG/source/qml/components/actionbutton/Actionbutton1.qml b/HIG/source/qml/components/actionbutton/Actionbutton1.qml new file mode 100644 index 0000000..e5f0202 --- /dev/null +++ b/HIG/source/qml/components/actionbutton/Actionbutton1.qml @@ -0,0 +1,37 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + } + +} diff --git a/HIG/source/qml/components/actionbutton/Actionbutton2.qml b/HIG/source/qml/components/actionbutton/Actionbutton2.qml new file mode 100644 index 0000000..6f010f7 --- /dev/null +++ b/HIG/source/qml/components/actionbutton/Actionbutton2.qml @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 3 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/actionbutton/Actionbutton3.qml b/HIG/source/qml/components/actionbutton/Actionbutton3.qml new file mode 100644 index 0000000..8e09528 --- /dev/null +++ b/HIG/source/qml/components/actionbutton/Actionbutton3.qml @@ -0,0 +1,41 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.5 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 800 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 3 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/actionbutton/config.json b/HIG/source/qml/components/actionbutton/config.json new file mode 100644 index 0000000..4fc6c14 --- /dev/null +++ b/HIG/source/qml/components/actionbutton/config.json @@ -0,0 +1,15 @@ +{ + "Actionbutton1.qml": { + "type": "png", + "controls": "mobile" + }, + "Actionbutton2.qml": { + "type": "png", + "controls": "mobile", + "autostart": 0 + }, + "Actionbutton3.qml": { + "type": "png", + "autostart": 0 + } +} diff --git a/HIG/source/qml/components/contextdrawer/Contextdrawer1.qml b/HIG/source/qml/components/contextdrawer/Contextdrawer1.qml new file mode 100644 index 0000000..2eca3bc --- /dev/null +++ b/HIG/source/qml/components/contextdrawer/Contextdrawer1.qml @@ -0,0 +1,59 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 3 + + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + addrbook.cDrawer.open(); + } + } + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/contextdrawer/Contextdrawer2.qml b/HIG/source/qml/components/contextdrawer/Contextdrawer2.qml new file mode 100644 index 0000000..371b236 --- /dev/null +++ b/HIG/source/qml/components/contextdrawer/Contextdrawer2.qml @@ -0,0 +1,58 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 800 + height: 600 + + Addr.Addressbook { + id: addrbook + index: 3 + + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + addrbook.cDrawer.open(); + } + } + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/contextdrawer/config.json b/HIG/source/qml/components/contextdrawer/config.json new file mode 100644 index 0000000..1e40a24 --- /dev/null +++ b/HIG/source/qml/components/contextdrawer/config.json @@ -0,0 +1,11 @@ +{ + "Contextdrawer1.qml": { + "type": "png", + "controls": "mobile", + "autostart": 0 + }, + "Contextdrawer2.qml": { + "type": "png", + "autostart": 0 + } +} diff --git a/HIG/source/qml/components/globaldrawer/Globaldrawer1.qml b/HIG/source/qml/components/globaldrawer/Globaldrawer1.qml new file mode 100644 index 0000000..af85a3a --- /dev/null +++ b/HIG/source/qml/components/globaldrawer/Globaldrawer1.qml @@ -0,0 +1,54 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + addrbook.gDrawer.open(); + } + } + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/globaldrawer/Globaldrawer2.qml b/HIG/source/qml/components/globaldrawer/Globaldrawer2.qml new file mode 100644 index 0000000..62b654f --- /dev/null +++ b/HIG/source/qml/components/globaldrawer/Globaldrawer2.qml @@ -0,0 +1,66 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 800 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 2 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + var b = new A.An(root); + b.find("pagerowglobaltoolbarui").tree(); + b.find("pagerowglobaltoolbarui").find("desktopicon").draw({ + outline: {label: false} + }); + b.find("pagerowglobaltoolbarui").find("qquicktoolbutton").draw({ + outline: {label: false} + }); + } + } + + // HACK + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/globaldrawer/Globaldrawer3.qml b/HIG/source/qml/components/globaldrawer/Globaldrawer3.qml new file mode 100644 index 0000000..11a6313 --- /dev/null +++ b/HIG/source/qml/components/globaldrawer/Globaldrawer3.qml @@ -0,0 +1,58 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 800 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 2 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + addrbook.gDrawer.open(); + } + } + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/globaldrawer/Globaldrawer4.qml b/HIG/source/qml/components/globaldrawer/Globaldrawer4.qml new file mode 100644 index 0000000..d7c47be --- /dev/null +++ b/HIG/source/qml/components/globaldrawer/Globaldrawer4.qml @@ -0,0 +1,72 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 1100 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 2 + gDrawer { + modal: false; + collapsible: true; + collapsed: true; + } + + Component.onCompleted: { + //addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 3000 + repeat: false + running: true + onTriggered: { + addrbook.gDrawer.collapsed = false; + } + } + Timer { + interval: 6000 + repeat: false + running: true + onTriggered: { + addrbook.gDrawer.collapsed = true; + } + } + Timer { + interval: 500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/globaldrawer/config.json b/HIG/source/qml/components/globaldrawer/config.json new file mode 100644 index 0000000..cfcc03d --- /dev/null +++ b/HIG/source/qml/components/globaldrawer/config.json @@ -0,0 +1,20 @@ +{ + "Globaldrawer1.qml": { + "type": "png", + "controls": "mobile", + "autostart": 0 + }, + "Globaldrawer2.qml": { + "type": "png", + "autostart": 0 + }, + "Globaldrawer3.qml": { + "type": "png", + "autostart": 0 + }, + "Globaldrawer4.qml": { + "type": "webm", + "autostart": 0, + "duration": 5 + } +} diff --git a/HIG/source/qml/components/listview/Folder.qml b/HIG/source/qml/components/listview/Folder.qml new file mode 100644 index 0000000..97c0a56 --- /dev/null +++ b/HIG/source/qml/components/listview/Folder.qml @@ -0,0 +1,28 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import org.kde.kirigami 2.7 as Kirigami + +Kirigami.BasicListItem { + id: item + icon: "folder" + label: "Folder " + (index + 1) +} diff --git a/HIG/source/qml/components/listview/Listview1.qml b/HIG/source/qml/components/listview/Listview1.qml new file mode 100644 index 0000000..19bd8de --- /dev/null +++ b/HIG/source/qml/components/listview/Listview1.qml @@ -0,0 +1,64 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtTest 1.2 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 160 + id: root + + ListviewMobile { + + } + + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + var item = a.find("swipelistitem").first(); + //console.log(item.nodes.length) + item.draw({ + "padding": {} + }); + var icon = item.find("qquickimage").first(); + icon.draw({ + "outline": {label: false} + }); + } + } + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } + +} diff --git a/HIG/source/qml/components/listview/Listview2.qml b/HIG/source/qml/components/listview/Listview2.qml new file mode 100644 index 0000000..31a60ce --- /dev/null +++ b/HIG/source/qml/components/listview/Listview2.qml @@ -0,0 +1,64 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.7 as Kirigami +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 200 + id: root + + ListviewMobile { + + } + + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + var item = a.find("swipelistitem").first(); + var label = item.find("qquicklabel").last(); + + label.draw({ + "outline": {label: false}, + "ruler": {horizontal: true, offset: "center"} + }); + var icon = item.find("qquickimage").first(); + icon.draw({ + "outline": {label: false}, + "brace": {to: label} + }); + } + } + Timer { + interval: 2500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/listview/Listview3.qml b/HIG/source/qml/components/listview/Listview3.qml new file mode 100644 index 0000000..0ce9229 --- /dev/null +++ b/HIG/source/qml/components/listview/Listview3.qml @@ -0,0 +1,76 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.10 +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 200 + id: root + + Addr.Addressbook { + width: 800 + height: 600 + index: 1 + } + + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + var item = a.find("swipelistitem").first(); + //console.log(item.nodes.length) + item.draw({ + "padding": {} + }); + /*item.find("qquickrow").draw({ + "outline": {} + }); + item.find("qquicklabel").draw({ + "outline": {} + });*/ + var icon = item.find("qquickimage").first(); + icon.draw({ + "outline": {label: false} + }); + } + } + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + //a.find("swipelistitem").first().hover({"animate": false}); + } + } + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } + +} diff --git a/HIG/source/qml/components/listview/Listview4.qml b/HIG/source/qml/components/listview/Listview4.qml new file mode 100644 index 0000000..6a275b2 --- /dev/null +++ b/HIG/source/qml/components/listview/Listview4.qml @@ -0,0 +1,65 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.10 +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 200 + id: root + + Addr.Addressbook { + width: 800 + height: 600 + index: 1 + } + + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + console.log(a.find("swipelistitem").nodes.length); + var item = a.find("swipelistitem").first(); + var label = item.find("qquicklabel").first(); + + label.draw({ + "outline": {label: false}, + "ruler": {horizontal: true, offset: "center"} + }); + var icon = item.find("qquickimage").first(); + icon.draw({ + "outline": {label: false}, + "brace": {to: label} + }); + } + } + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } + +} diff --git a/HIG/source/qml/components/listview/Listview5.qml b/HIG/source/qml/components/listview/Listview5.qml new file mode 100644 index 0000000..787fdea --- /dev/null +++ b/HIG/source/qml/components/listview/Listview5.qml @@ -0,0 +1,179 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.7 as Kirigami +import QtGraphicalEffects 1.0 +import "../../lib/annotate.js" as A +import "../../models/" as Models + +Rectangle { + width: 620 + height: 300 + id: root + color: "#eff0f1" + + property var mydata : Models.Contacts { + } + + Row { + anchors.fill: parent + spacing: Kirigami.Settings.tabletMode ? 2 * Kirigami.Units.largeSpacing : 2 * Kirigami.Units.smallSpacing + + Rectangle { + border.width: 1 + border.color: "#bdc3c7" + width: 300 + height: root.height + + ListView { + model: root.mydata + anchors.fill: parent + + + delegate: Kirigami.AbstractListItem { + width: 300 + + Row { + spacing: Kirigami.Settings.tabletMode ? 2 * Kirigami.Units.largeSpacing : 2 * Kirigami.Units.smallSpacing + + CheckBox { + checked: index < 2 + anchors.verticalCenter: parent.verticalCenter + text: "" + } + Item { + width: Kirigami.Units.iconSizes.medium + height: width + + Image { + id: img + width: parent.width + height: width + source: "../../../img/" + model.image + visible: false + } + OpacityMask { + anchors.fill: img + source: img + maskSource: Rectangle { + height: img.width + width: height + radius: height / 2 + } + } + } + Label { + anchors.verticalCenter: parent.verticalCenter + text: model.firstname + " " + model.lastname + } + } + } + } + } + + Rectangle { + border.width: 1 + border.color: "#bdc3c7" + width: 300 + height: root.height + + + ListView { + model: root.mydata + anchors.fill: parent + + delegate: Kirigami.AbstractListItem { + width: 300 + + background: Rectangle { + color: index < 2 ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor + + Rectangle { + width: parent.width + height: 1 + color: "#bdc3c7" + anchors.bottom: parent.bottom + } + } + + Row { + spacing: Kirigami.Settings.tabletMode ? 2 * Kirigami.Units.largeSpacing : 2 * Kirigami.Units.smallSpacing + Item { + width: Kirigami.Units.iconSizes.medium + height: width + + Image { + id: img2 + width: parent.width + height: width + source: "../../../img/" + model.image + visible: false + } + OpacityMask { + anchors.fill: img2 + source: img2 + maskSource: Rectangle { + height: img2.width + width: height + radius: height / 2 + } + } + } + Label { + anchors.verticalCenter: parent.verticalCenter + text: model.firstname + " " + model.lastname + } + } + } + } + } + } + + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + return; + var a = new A.An(root); + var item = a.find("abstractlistitem").first(); + //console.log(item.nodes.length) + item.draw({ + "padding": {} + }); + var icon = item.find("qquickimage").first(); + /*icon.draw({ + "outline": {label: false} + }); + var checkbox = item.find("qquickcheckbox").first(); + checkbox.draw({ + "outline": {label: false}, + });*/ + + a.find("abstractlistitem").eq(1).find("qquickcheckbox").draw({ + "ruler": {horizontal: true, offset: "center"} + }); + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/listview/Listview6.qml b/HIG/source/qml/components/listview/Listview6.qml new file mode 100644 index 0000000..2fefd93 --- /dev/null +++ b/HIG/source/qml/components/listview/Listview6.qml @@ -0,0 +1,104 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.7 as Kirigami +import "../../lib/annotate.js" as A + +Rectangle { + width: 1200 + height: 300 + id: root + color: "#eff0f1" + + property var myModel : [1, 2, 3, 4, 5, 6]; + + Row { + anchors.fill: parent + spacing: Kirigami.Settings.tabletMode ? 2 * Kirigami.Units.largeSpacing : 2 * Kirigami.Units.smallSpacing + + Rectangle { + border.width: 1 + border.color: "#bdc3c7" + width: 300 + height: root.height + + ListView { + model: root.myModel + anchors.fill: parent + delegate: Folder { + iconSize: 0 + } + } + } + Rectangle { + border.width: 1 + border.color: "#bdc3c7" + width: 300 + height: root.height + + ListView { + model: root.myModel + anchors.fill: parent + delegate: Folder { + iconSize: Kirigami.Units.iconSizes.small + } + } + } + Rectangle { + border.width: 1 + border.color: "#bdc3c7" + width: 300 + height: root.height + + ListView { + model: root.myModel + anchors.fill: parent + delegate: Folder { + iconSize: Kirigami.Units.iconSizes.medium + } + } + } + Rectangle { + border.width: 1 + border.color: "#bdc3c7" + width: 300 + height: root.height + + ListView { + model: root.myModel + anchors.fill: parent + delegate: Folder { + iconSize: Kirigami.Units.iconSizes.large + } + } + } + } + + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/components/listview/Listview7.qml b/HIG/source/qml/components/listview/Listview7.qml new file mode 100644 index 0000000..abc97f3 --- /dev/null +++ b/HIG/source/qml/components/listview/Listview7.qml @@ -0,0 +1,74 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 220 + id: root + + ListView { + anchors.fill: parent + model: [1,2,3,4] + + delegate: Kirigami.BasicListItem { + icon: "folder" + iconColor: "#27ae60" + iconSize: Kirigami.Units.iconSizes.medium + label: "Folder " + (index + 1) + } + } + + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + var item0 = a.find("basiclistitem").first(); + item0.draw({ + "padding": {} + }); + + var item1 = a.find("basiclistitem").eq(1); + var icon1 = item1.find("desktopicon"); + icon1.draw({ + "outline": {label: false}, + "ruler": {horizontal: true, offset: "center"} + }); + item1.find("qquicklabel").draw({ + "outline": {label: false} + }); + + var item2 = a.find("basiclistitem").eq(3); + var label2 = item2.find("qquicklabel"); + item2.find("desktopicon").draw({ + "outline": {}, + "brace": {to: label2, center: false} + }); + qmlControler.start(); + } + } + +} diff --git a/HIG/source/qml/components/listview/ListviewDesktop.qml b/HIG/source/qml/components/listview/ListviewDesktop.qml new file mode 100644 index 0000000..4a485db --- /dev/null +++ b/HIG/source/qml/components/listview/ListviewDesktop.qml @@ -0,0 +1,62 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtTest 1.2 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Kirigami.ApplicationItem { + width: 800 + height: 600 + id: root + + property var mydata : Models.Contacts { + Component.onCompleted: { + detail.model = mydata.get(0) + detail.visible = true + } + } + + pageStack.initialPage: Addr.ListPage { + id: list + } + + pageStack.defaultColumnWidth: root.width < 320 ? root.width : 320 + pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Auto + + Addr.DetailPage { + id: detail + visible: false + } + + contextDrawer: Kirigami.ContextDrawer { + id: contextDrawer + } + + Component.onCompleted: { + root.pageStack.push(detail) + root.pageStack.push(form) + } + +} diff --git a/HIG/source/qml/components/listview/ListviewMobile.qml b/HIG/source/qml/components/listview/ListviewMobile.qml new file mode 100644 index 0000000..92b8180 --- /dev/null +++ b/HIG/source/qml/components/listview/ListviewMobile.qml @@ -0,0 +1,51 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtTest 1.2 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Kirigami.ApplicationItem { + width: 320 + height: 600 + id: root + + property var mydata : Models.Contacts { + } + + pageStack.initialPage: Addr.ListPage { + id: list + model: root.mydata + } + + pageStack.defaultColumnWidth: root.width + pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Breadcrumb + + + // HACK + TestEvent { + id: event + } + +} diff --git a/HIG/source/qml/components/listview/config.json b/HIG/source/qml/components/listview/config.json new file mode 100644 index 0000000..248444c --- /dev/null +++ b/HIG/source/qml/components/listview/config.json @@ -0,0 +1,32 @@ +{ + "Listview1.qml": { + "type": "png", + "controls": "mobile", + "autostart": 0, + "scale": 2 + }, + "Listview2.qml": { + "type": "png", + "controls": "mobile", + "autostart": 0, + "scale": 2 + }, + "Listview3.qml": { + "type": "png", + "autostart": 0, + "scale": 2 + }, + "Listview4.qml": { + "type": "png", + "autostart": 0, + "scale": 2 + }, + "Listview5.qml": { + "type": "png", + "autostart": 0 + }, + "Listview6.qml": { + "type": "png", + "autostart": 0 + } +} diff --git a/HIG/source/qml/components/swipelistitem/Swipelistitem1.qml b/HIG/source/qml/components/swipelistitem/Swipelistitem1.qml new file mode 100644 index 0000000..8ba2740 --- /dev/null +++ b/HIG/source/qml/components/swipelistitem/Swipelistitem1.qml @@ -0,0 +1,62 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtTest 1.2 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../models/" as Models +import "../../addr/" as Addr +import "../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + } + + + // HACK + TestEvent { + id: event + } + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + var a = new A.An(addrbook); + a.find("swipelistitem").eq(3).swipe({fromX: +140, fromY: 9, toX: -80, toY: 0}); + } + } + + Timer { + interval: 4000 + repeat: false + running: true + onTriggered: { + var a = new A.An(addrbook); + a.find("swipelistitem").eq(3).touch({}); + } + } +} diff --git a/HIG/source/qml/components/swipelistitem/config.json b/HIG/source/qml/components/swipelistitem/config.json new file mode 100644 index 0000000..2b9985d --- /dev/null +++ b/HIG/source/qml/components/swipelistitem/config.json @@ -0,0 +1,11 @@ +{ + "Swipelistitem1.qml": { + "type": "webm", + "controls": "mobile", + "duration": 5 + }, + "Swipelistitem2.qml": { + "type": "webm", + "duration": 5 + } +} diff --git a/HIG/source/qml/files/Folder.qml b/HIG/source/qml/files/Folder.qml new file mode 100644 index 0000000..1bd07be --- /dev/null +++ b/HIG/source/qml/files/Folder.qml @@ -0,0 +1,86 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami + +Kirigami.ScrollablePage { + property alias currentIndex: list.currentIndex; + property var pagemodel; + property var pageroot; + + Kirigami.Theme.colorSet: Kirigami.Theme.View + title: pagemodel.name + id: page + + background: Rectangle { + color: Kirigami.Theme.backgroundColor + } + + /*header: Rectangle { + clip: true + id: header + color: "#3daee9" + height: searchField.implicitHeight + 2 * Kirigami.Units.largeSpacing + width: root.width + //border.width: 1 + //border.color: "#bdc3c7" + + TextField { + id: searchField + placeholderText: "Search" + anchors.centerIn: parent + anchors.margins: Kirigami.Units.largeSpacing + width: parent.width - 2 * Kirigami.Units.largeSpacing + } + }*/ + + ListView { + currentIndex: -1 + id: list + model: pagemodel.subfolder + + delegate: Kirigami.BasicListItem { + onClicked: { + pageroot.pageStack.push(Qt.resolvedUrl("Folder.qml"), {"pagemodel": pagemodel.subfolder.get(index), "pageroot": pageroot}); + } + + contentItem: Row { + spacing: 2 * Kirigami.Units.largeSpacing + + Item { + width: Kirigami.Units.iconSizes.medium + height: width + + Kirigami.Icon { + width: Kirigami.Units.iconSizes.medium + height: width + source: model.icon + } + } + Label { + anchors.verticalCenter: parent.verticalCenter + text: model.name + } + } + } + } +} diff --git a/HIG/source/qml/files/Test.qml b/HIG/source/qml/files/Test.qml new file mode 100644 index 0000000..5105ce9 --- /dev/null +++ b/HIG/source/qml/files/Test.qml @@ -0,0 +1,75 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../models/" as Models +import "../lib/annotate.js" as A + +Kirigami.ApplicationItem { + width: 320 + height: 600 + id: root + + property var mydata : Models.Files { + Component.onCompleted: { + rootFolder.pagemodel = mydata.get(0) + } + } + + pageStack.initialPage: Folder { + id: rootFolder + pageroot: root + } + + pageStack.defaultColumnWidth: root.width < 320 ? root.width : 320 + pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Breadcrumb + + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + a.find("basiclistitem").eq(1).touch(); + } + } + + Timer { + interval: 5000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + a.find("basiclistitem").eq(7).touch(); + } + } + + Timer { + interval: 8000 + repeat: false + running: true + onTriggered: { + var b = new A.An(root); + b.find("pagerowglobaltoolbarui").find("heading").first().touch(); + } + } +} diff --git a/HIG/source/qml/lib/Brace.qml b/HIG/source/qml/lib/Brace.qml index 8ab8cfb..f037c51 100644 --- a/HIG/source/qml/lib/Brace.qml +++ b/HIG/source/qml/lib/Brace.qml @@ -1,152 +1,155 @@ /* * Copyright 2018 Fabian Riethmayer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.2 import QtQuick.Controls 2.2 import org.kde.kirigami 2.4 as Kirigami // Drawing a brace between to obejcts to show the distance between them Item { id: canvas anchors.fill: parent; property Item from property Item to property bool flip: false property bool center: true property string text property string color: "rgba(236, 161, 169, 0.8)" property bool horizontal: true; Rectangle { id: prot color: "#cc93cee9" width: childrenRect.width + 10 height: childrenRect.height + 10 z: 2 Label { x: Kirigami.Units.smallSpacing y: Kirigami.Units.smallSpacing id: label color: "#000" text: canvas.text font.pointSize: 8 lineHeight: 8 height: 8 renderType: Text.QtRendering } } Canvas { anchors.fill: parent; onPaint: { // it might be necessary to calculate scale // because annotation should not be scaled // var scale = T.getScale(canvas.parent) var ctx = getContext("2d"); ctx.strokeStyle = canvas.color; ctx.beginPath(); var cfrom = from.mapToItem(canvas.parent, 0, 0); var cto = to.mapToItem(canvas.parent, 0, 0); // Determine direction // draw either horizontal or vertical if (horizontal) { + // If no label was provided calulate it + if (canvas.text == "") { + if (cfrom.x > cto.x) { + canvas.text = cfrom.x - cto.x - to.width; + } + else { + canvas.text = cto.x - cfrom.x - from.width; + } + } // Calculate anchor points for braces if (!canvas.center) { // Draw from closest borders if (cfrom.x > cto.x) { - // If no label was provided calulate it - if (canvas.text == "") { - canvas.text = cfrom.x - cto.x - to.width; - } cfrom.x = cfrom.x + Math.min(Math.floor(from.width / 2), 2 * Kirigami.Units.smallSpacing) cto.x = cto.x + to.width - Math.min(Math.floor(to.width / 2), 2 * Kirigami.Units.smallSpacing) } else { - // If no label was provided calulate it - if (canvas.text == "") { - canvas.text = (cto.x - cfrom.x - from.width); - } cfrom.x = cfrom.x + from.width - Math.min(Math.floor(from.width / 2), 2 * Kirigami.Units.smallSpacing) cto.x = cto.x + Math.min(Math.floor(to.width / 2), 2 * Kirigami.Units.smallSpacing) } } else { // Draw from the center cfrom.x = cfrom.x + from.width / 2; cto.x = cto.x + to.width / 2; } // Draw the brace ctx.moveTo(cfrom.x, cfrom.y); ctx.lineTo(cfrom.x, cfrom.y - Kirigami.Units.smallSpacing); ctx.lineTo(cto.x, cfrom.y - Kirigami.Units.smallSpacing); ctx.lineTo(cto.x, cfrom.y); // Position label prot.x = (cfrom.x + cto.x) / 2 - prot.width / 2 prot.y = cfrom.y - prot.height - 2 * Kirigami.Units.smallSpacing } else { + // If no label was provided calulate it + if (canvas.text == "") { + if (cfrom.y > cto.y) { + canvas.text = cfrom.y - cto.y - to.height; + } + else { + canvas.text = cto.y - cfrom.y - from.height; + } + } + if (!canvas.center) { // Draw from closest borders if (cfrom.y > cto.y) { - // If no label was provided calulate it - if (canvas.text == "") { - canvas.text = (cto.y - cfrom.y + from.height); - } cfrom.y = cfrom.y + Math.min(Math.floor(from.height / 2), 2 * Kirigami.Units.smallSpacing) cto.y = cto.y + to.height - Math.min(Math.floor(to.height / 2), 2 * Kirigami.Units.smallSpacing) } else { - // If no label was provided calulate it - if (canvas.text == "") { - canvas.text = (cto.y - cfrom.y - from.height); - } cfrom.y = cfrom.y + from.height - Math.min(Math.floor(from.height / 2), 2 * Kirigami.Units.smallSpacing) cto.y = cto.y + Math.min(Math.floor(to.height / 2), 2 * Kirigami.Units.smallSpacing) } } else { // Draw from the center cfrom.y = cfrom.y + from.height / 2; cto.y = cto.y + to.height / 2; } // Draw the brace ctx.moveTo(cfrom.x, cfrom.y); ctx.lineTo(cfrom.x - Kirigami.Units.smallSpacing, cfrom.y); ctx.lineTo(cfrom.x - Kirigami.Units.smallSpacing, cto.y); ctx.lineTo(cfrom.x, cto.y); // Position label prot.x = cfrom.x - prot.width - 2 * Kirigami.Units.smallSpacing prot.y = (cfrom.y + cto.y ) / 2 - prot.height / 2 - 4 } ctx.stroke(); } } } diff --git a/HIG/source/qml/lib/Header.qml b/HIG/source/qml/lib/Header.qml new file mode 100644 index 0000000..baef17d --- /dev/null +++ b/HIG/source/qml/lib/Header.qml @@ -0,0 +1,102 @@ +//import related modules +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import QtGraphicalEffects 1.0 + +//import "MMCQ.js" as MMCQ + + +Rectangle { + id: root + width: parent.width + height: Kirigami.Units.gridUnit * 11 * status + clip: true + default property alias contents: content.data + property alias content: contentContainer + property alias stripContent: strip.data + + property string source; + property string title; + property string subtitle; + property string overview; + property real status : 1; + + // Background image + Image { + anchors.fill: parent + id: bg + source: root.source + fillMode: Image.PreserveAspectCrop + + } + + FastBlur { + anchors.fill: bg + source: bg + radius: 48 + + ColorOverlay { + anchors.fill: parent + source: parent + color: "#66808080" + + BrightnessContrast { + anchors.fill: parent + source: parent + brightness: 0 + contrast: 0 + } + } + } + + + // Container for the content of the header + Item { + anchors.fill: parent + anchors.bottomMargin: strip.children.length > 0 ? strip.height : 0 + + Item { + id: contentContainer + anchors.fill: parent + anchors.margins: Kirigami.Units.gridUnit + anchors.leftMargin: 200 + + Image { + id: img + source: root.source + height: contentContainer.height + width: contentContainer.height + fillMode: Image.PreserveAspectCrop + //visible: false + } + /*OpacityMask { + anchors.fill: img + source: img + maskSource: Rectangle { + height: img.width + width: height + radius: height / 2 + } + }*/ + Item { + id: content + height: childrenRect.height + anchors.left: img.right + anchors.right: parent.right + anchors.leftMargin: Kirigami.Units.gridUnit + anchors.bottom: img.bottom + } + } + } + + Rectangle { + id: strip + color: "#66F0F0F0" + anchors.bottom: parent.bottom; + height: 2 * Kirigami.Units.gridUnit + width: parent.width + visible: children.length > 0 + } +} diff --git a/HIG/source/qml/lib/Mouse.qml b/HIG/source/qml/lib/Mouse.qml index c509c22..867d927 100644 --- a/HIG/source/qml/lib/Mouse.qml +++ b/HIG/source/qml/lib/Mouse.qml @@ -1,117 +1,140 @@ /* * Copyright 2018 Fabian Riethmayer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.2 import QtTest 1.2 import org.kde.kirigami 2.4 as Kirigami // Drawing a brace between to obejcts to show the distance between them Item { id: canvas anchors.fill: parent; property int px property int py + property bool animate: true z: 2 Rectangle { id: ind x: cursor.x - width / 2 y: cursor.y - width / 2 + 5 z: 2 width: Kirigami.Units.iconSizes.medium height: width color: "#9911d116" radius: width / 2 visible: false NumberAnimation on width { id: indAnim duration: 300 running: false onStopped: { ind.visible = false; event.mouseClick(canvas.parent, px, py, Qt.LeftButton, Qt.NoModifier, 0) } } } TestEvent { id: event } Image { id: cursor source: "../../img/left_ptr.png" visible: false width: Kirigami.Units.iconSizes.medium height: Kirigami.Units.iconSizes.medium z: 3 ParallelAnimation { running: false id: cursorAnimation NumberAnimation { id: cursorAnimationX target: cursor property: "x" duration: 1000 } NumberAnimation { id: cursorAnimationY target: cursor property: "y" duration: 1000 } } } + Timer { + id: moveMouse + interval: 50 + repeat: true + running: false + onTriggered: { + event.mouseMove(canvas.parent, cursor.x, cursor.y, 0, Qt.NoButton); + } + } + // Animate mouse to x/y and then click function click() { cursor.x = px - 60; cursor.y = py + 60; cursor.visible = true; cursorAnimation.onStopped.connect(function() { ind.visible = true; indAnim.to = Kirigami.Units.iconSizes.smallMedium; indAnim.start(); + moveMouse.stop(); }); cursorAnimationX.to = px; cursorAnimationY.to = py; cursorAnimation.start(); + moveMouse.start(); } function hover() { - cursor.x = px - 60; - cursor.y = py + 60; - cursor.visible = true; - - cursorAnimation.onStopped.connect(function() { + if (canvas.animate) { + cursor.x = px - 60; + cursor.y = py + 60; + cursor.visible = true; + + cursorAnimation.onStopped.connect(function() { + event.mouseMove(canvas.parent, px, py, 0, Qt.NoButton); + moveMouse.stop(); + }); + + cursorAnimationX.to = px; + cursorAnimationY.to = py; + cursorAnimation.start(); + moveMouse.start(); + } + else { + cursor.x = px; + cursor.y = py; + cursor.visible = true; event.mouseMove(canvas.parent, px, py, 0, Qt.NoButton); - }); - - cursorAnimationX.to = px; - cursorAnimationY.to = py; - cursorAnimation.start(); + } } } diff --git a/HIG/source/qml/lib/Padding.qml b/HIG/source/qml/lib/Padding.qml index 50ab5d3..48a0ab5 100644 --- a/HIG/source/qml/lib/Padding.qml +++ b/HIG/source/qml/lib/Padding.qml @@ -1,148 +1,158 @@ /* * Copyright 2018 Fabian Riethmayer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.2 import QtQuick.Controls 2.2 import org.kde.kirigami 2.4 as Kirigami // Show the padding of an element Item { anchors.fill: parent; property string color: "rgba(147,206,233, 0.8)" property bool label: false property Item item property Item root : container.parent property var padding: [] z: 10 id: container Text { id: top color: "#da4453" font.pointSize: 8 lineHeight: 8 height: 8 z: 2 } Text { id: right color: "#da4453" font.pointSize: 8 lineHeight: 8 height: 8 z: 2 } Text { id: bottom color: "#da4453" font.pointSize: 8 lineHeight: 8 height: 8 z: 2 } Text { id: left color: "#da4453" font.pointSize: 8 lineHeight: 8 height: 8 z: 2 } Canvas { anchors.fill: parent; id: canvas onPaint: { // Determen padding var padding; if (typeof container.padding === "number") { padding = { "top": container.padding, "right": container.padding, "bottom": container.padding, "left": container.padding } } else if (Array.isArray(container.padding) && container.padding.length == 4) { padding = { "top": container.padding[0], "right": container.padding[1], "bottom": container.padding[2], "left": container.padding[3] } } else { padding = { "top": item.topPadding, "right": item.rightPadding, "bottom": item.bottomPadding, "left": item.leftPadding } } // setup drawing context var offset; var cItem = item.mapToItem(container.root, 0, 0); var ctx = getContext("2d"); ctx.strokeStyle = container.color; - ctx.beginPath(); + // Draw top + ctx.beginPath(); ctx.lineWidth = padding.top; offset = ctx.lineWidth / 2; ctx.moveTo(cItem.x + offset, cItem.y + offset); - ctx.lineTo(cItem.x + item.width - offset, cItem.y + offset); + ctx.lineTo(cItem.x + item.width, cItem.y + offset); + ctx.stroke(); // Draw right + ctx.beginPath(); ctx.lineWidth = padding.right; offset = ctx.lineWidth / 2; - ctx.lineTo(cItem.x + item.width - offset, cItem.y + item.height - offset); + ctx.moveTo(cItem.x + item.width - offset, cItem.y); + ctx.lineTo(cItem.x + item.width - offset, cItem.y + item.height); + ctx.stroke(); // Draw bottom + ctx.beginPath(); ctx.lineWidth = padding.bottom; offset = ctx.lineWidth / 2; - ctx.lineTo(cItem.x + offset, cItem.y + item.height - offset); + ctx.moveTo(cItem.x + item.width, cItem.y + item.height - offset); + ctx.lineTo(cItem.x, cItem.y + item.height - offset); + ctx.stroke(); // Draw left - ctx.lineWidth = padding.bottom; + ctx.beginPath(); + ctx.lineWidth = padding.left; offset = ctx.lineWidth / 2; - ctx.lineTo(cItem.x + offset, cItem.y + offset); + ctx.moveTo(cItem.x + offset, cItem.y + item.height); + ctx.lineTo(cItem.x + offset, cItem.y); + ctx.stroke(); ctx.stroke(); // Write labels top.text = padding.top; top.x = cItem.x + item.width / 2; - top.y = cItem.y - 4 - padding.top / 2; + top.y = Math.max(cItem.y - top.height + padding.top / 2, 0); right.text = padding.right; - right.x = cItem.x + item.width - right.width + padding.right / 2; + right.x = Math.min(cItem.x + item.width - right.width / 2 - padding.right / 2, root.width - right.width); right.y = cItem.y + item.height / 2 - right.height; bottom.text = padding.bottom; bottom.x = cItem.x + item.width / 2; - bottom.y = cItem.y + item.height - bottom.height - 4 + padding.bottom / 2; + bottom.y = Math.min(cItem.y + item.height - bottom.height - padding.bottom / 2, root.height); left.text = padding.left; - left.x = cItem.x - padding.left / 2; - left.y = cItem.x + item.height / 2 - left.height; - + left.x = Math.max(cItem.x - padding.left / 2 - left.width / 2, 0); + left.y = cItem.y + item.height / 2 - left.height; } } } diff --git a/HIG/source/qml/lib/Touch.qml b/HIG/source/qml/lib/Touch.qml index 61928f5..1ed2253 100644 --- a/HIG/source/qml/lib/Touch.qml +++ b/HIG/source/qml/lib/Touch.qml @@ -1,147 +1,160 @@ /* * Copyright 2018 Fabian Riethmayer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.2 import org.kde.kirigami 2.4 as Kirigami import QtTest 1.2 // Drawing a brace between to obejcts to show the distance between them Item { id: canvas anchors.fill: parent; property int fromX property int fromY property int toX property int toY property int dur: 300 property var sequence; property int i: 0 + /*MouseArea { + anchors.fill: parent + onPressed: { + console.log(mouse.x + "x" + mouse.y) + } + }*/ + Rectangle { id: ind z: 1 width: height height: Kirigami.Units.iconSizes.smallMedium color: "#331d99f3" radius: height / 2 visible: false x: cursor.x NumberAnimation on width { id: indAnim duration: dur running: false } } Image { id: cursor source: "../../img/transform-browse.svg" visible: false width: Kirigami.Units.iconSizes.smallMedium height: Kirigami.Units.iconSizes.smallMedium z: 2 NumberAnimation on x { id: xAnim duration: dur running: false } NumberAnimation on y { id: yAnim running: false duration: dur onStopped: { timer.start() } } } TestEvent { id: event } Timer { id: timer interval: 300 repeat: false running: false onTriggered: { ind.visible = false; cursor.visible = false; swipeTimer.stop(); } } Timer { id: swipeTimer interval: 30 repeat: true running: false onTriggered: { i++; var stepX = (toX - fromX) / timer.interval * swipeTimer.interval var stepY = (toY - fromY) / timer.interval * swipeTimer.interval - sequence.move(1, canvas, fromX + i * stepX, toY + i * stepY); + sequence.move(1, canvas.parent, fromX + i * stepX, toY + i * stepY); + //console.log("move: " + (fromX + i * stepX) + "x" + (toY + i * stepY)) sequence.commit(); } } // Animate swipe function swipe() { cursor.x = fromX - Kirigami.Units.iconSizes.smallMedium; - cursor.y = fromY; + cursor.y = fromY - Kirigami.Units.iconSizes.smallMedium; cursor.visible = true; ind.y = fromY; ind.visible = true; xAnim.to = toX; xAnim.start(); yAnim.to = toY; yAnim.start(); indAnim.to = Math.abs(fromX - toX); indAnim.start(); - sequence = event.touchEvent(canvas); - sequence.press(1, canvas, fromX, fromY); + sequence = event.touchEvent(canvas.parent); + sequence.press(1, canvas.parent, fromX, fromY); + //console.log("press: " + fromX + "x" + fromY) sequence.commit(); i = 0; + swipeTimer.start(); + timer.start(); timer.triggered.connect(function() { - sequence.release(1, canvas, toX, toY); + sequence.release(1, canvas.parent, toX, toY); + //console.log("release: " + toX + "x" + toY) sequence.commit(); }); + } function touch() { cursor.x = toX; cursor.y = toY; cursor.visible = true; timer.start() timer.triggered.connect(function() { sequence = event.touchEvent(canvas); sequence.press(1, canvas, toX, toY); sequence.commit(); sequence.release(1, canvas, toX, toY); sequence.commit(); }); } } diff --git a/HIG/source/qml/lib/annotate.js b/HIG/source/qml/lib/annotate.js index f1a1c9f..0b2bfa4 100644 --- a/HIG/source/qml/lib/annotate.js +++ b/HIG/source/qml/lib/annotate.js @@ -1,325 +1,346 @@ var ruler = Qt.createComponent("Ruler.qml"); var brace = Qt.createComponent("Brace.qml"); var outline = Qt.createComponent("Outline.qml"); var messure = Qt.createComponent("Messure.qml"); var padding = Qt.createComponent("Padding.qml"); var mouse = Qt.createComponent("Mouse.qml"); var touch = Qt.createComponent("Touch.qml"); // get classname and strip _QML of the name function getClassName(obj) { var str = obj.toString(); str = str.substring(0, str.indexOf("(")); if (str.search(/_QML/) !== -1) { str = str.substring(0, str.indexOf("_QML")); } return str.toLowerCase(); } // Merge 2 objects of options function getOpts(opts, choices) { for (var choice in choices) { opts[choice] = choices[choice]; } return opts; } // An extended array of QML elements function An(node) { this.nodes = []; if (typeof node === "undefined") { this.nodes = [] } else if (typeof node === "Array") { this.nodes = node; } else { this.nodes = [node]; } } // Find an An of QML elements from this point down the subtrees An.prototype.find = function(selector) { var result = new An(); if (typeof selector === "string") { selector = new Select(selector); } /* for debugging for (var member in this) { if (typeof this[member] !== "function") { console.log(member + ": " + this[member]); } }*/ // iterate threw the children // apply the selector and traverse down the tree for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; for (var i = 0; i < node.children.length; i++) { if (selector.match(node.children[i])) { // Add matching element to result result.nodes.push(node.children[i]); } if (node.children[i].children.length) { // Merge matching results of subrtree var child = new An(node.children[i]); result.concat(child.find(selector)); } } } return result; } An.prototype.inspect = function() { for (var member in this.nodes[0]) { if (typeof this[member] !== "function") { console.log(member + ": " + this[member]); } } return this; } // Search only direct children An.prototype.children = function(selector) { var result = new An(); if (typeof selector === "string") { selector = new Select(selector); } for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; for (var i = 0; i < node.children.length; i++) { if (selector.match(node.children[i])) { // Add matching element to result result.nodes.push(node.children[i]); } } } return result; } An.prototype.concat = function(n) { this.nodes = this.nodes.concat(n.nodes); } An.prototype.first = function() { if (this.nodes.length > 0) { return new An(this.nodes[0]); } return new An(); } An.prototype.last = function() { if (this.nodes.length > 0) { return new An(this.nodes[this.nodes.length - 1]); } return new An(); } An.prototype.eq = function(n) { if (this.nodes.length > n) { return new An(this.nodes[n]); } return new An(); } /** * Simulate a mouse click on the nodes */ An.prototype.click = function(opt) { var options = getOpts({ x: 0, y: 0 }, opt); for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; var x = node.mapToItem(null, 0, 0).x + Math.floor(node.width / 2) + options.x; var y = node.mapToItem(null, 0, 0).y + Math.floor(node.height / 2) + options.y; var m = mouse.createObject(root, {px: x, py: y}); m.click(); } return this; } /** * Simulate a touch the nodes */ An.prototype.touch = function(opt) { var options = getOpts({ x: 0, y: 0 }, opt); for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; var x = node.mapToItem(null, 0, 0).x + Math.floor(node.width / 2) + options.x; var y = node.mapToItem(null, 0, 0).y + Math.floor(node.height / 2) + options.y; var m = touch.createObject(root, {toX: x, toY: y}); m.touch(); } return this; } /** * Simulate a mouse hover on the nodes */ An.prototype.hover = function(opt) { var options = getOpts({ x: 0, - y: 0 + y: 0, + animate: true }, opt); for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; var x = node.mapToItem(null, 0, 0).x + Math.floor(node.width / 2) + options.x; var y = node.mapToItem(null, 0, 0).y + Math.floor(node.height / 2) + options.y; - var m = mouse.createObject(root, {px: x, py: y}); + var m = mouse.createObject(root, {px: x, py: y, animate: options.animate}); m.hover(); } return this; } /** * Simulate a touch */ An.prototype.swipe = function(opt) { var options = getOpts({ fromX: 0, fromY: 0, toX: 0, toY: 0 }, opt); for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; var x = node.mapToItem(null, 0, 0).x + Math.floor(node.width / 2) + options.fromX; var y = node.mapToItem(null, 0, 0).y + Math.floor(node.height / 2) - Kirigami.Units.iconSizes.smallMedium / 2 + options.fromY; var t = touch.createObject(root, {fromX: x, fromY: y, toX: x + options.toX, toY: y + options.toY}); t.swipe(); } return this; } /** * Draw a tree of all the elements */ An.prototype.tree = function(lvl) { if (typeof lvl === "undefined") { lvl = "" } /* for debug for (var member in this.nodes) { if (typeof this[member] !== "function") { console.log("|" + lvl + " " + member + ": " + (typeof this[member])); } }*/ for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; - console.log("|" + lvl + " " + getClassName(node) + " " + node.toString()); + console.log("|" + lvl + " " + getClassName(node) + " " + node.toString() + " " + node.children.length); for (var i = 0; i < node.children.length; i++) { var child = new An(node.children[i]); child.tree(lvl + "--"); } } } /** * Drawing annotation on the nodes */ An.prototype.draw = function(obj) { - console.log(this.nodes) + //console.log(this.nodes) for (var n = 0; n < this.nodes.length; n++) { var node = this.nodes[n]; var opt; for (var type in obj) { if (Array.isArray(obj[type])) { for (var i = 0; i < obj[type].length; i++) { this._draw(node, type, obj[type][i]); } } else { this._draw(node, type, obj[type]); } } } return this; } /** * Internal method to draw */ An.prototype._draw = function(node, type, opt) { //console.log("drawing " + type) switch (type) { case "outline": + // Create outline object outline.createObject(root, {item: node, label: opt.label, aspectratio: opt.aspectratio}); break case "ruler": + // Draw ruler to show alignment + if (opt.offset) { + // No need for left or top since these are the defaults + switch (opt.offset) { + case "center": + opt.offset = opt.horizontal ? node.mapToItem(null, 0, 0).y + node.height / 2 : node.mapToItem(null, 0, 0).x + node.width / 2 + break; + case "bottom": + opt.offset = node.mapToItem(null, 0, 0).y + node.height + break; + case "right": + opt.offset = node.mapToItem(null, 0, 0).x + node.width + break; + } + } + var options = getOpts({ offset: opt.horizontal ? node.mapToItem(null, 0, 0).y : node.mapToItem(null, 0, 0).x, horizontal: false }, opt); ruler.createObject(root, options); break case "padding": + // Show padding around an object var options = getOpts({ padding: opt.padding }, opt); padding.createObject(root, {item: node, padding: options.padding}); break case "brace": + // Create a brace between two objects brace.createObject(root, {"from": node, "to": opt.to.nodes[0], "text": opt.text, "center": opt.center, "horizontal": opt.horizontal}); break case "messure": + // Messure distance between two objects messure.createObject(root, {"from": node, "to": opt.to.nodes[0], "type": opt.type}); break } } /** * Selector for qml elements */ function Select(str) { // TODO support more complex syntax // - multiple nodenames, hirachy, ... if (str.search(/\{/) !== -1) { this.nodeName = str.substring(0, str.indexOf("{")); var members = str.match(/\{.+\}/); try { this.attrs = JSON.parse(members[0]); } catch(e) { console.log("Could not parse attributes"); console.log(e); } } else { this.nodeName = str; } } /** * Check if the node matches the selector */ Select.prototype.match = function(node) { if (this.nodeName === "*" || getClassName(node) === this.nodeName) { if (typeof this.attrs !== "undefined") { // TODO only return true if all attributes match for (var attr in this.attrs) { if (typeof node[attr] !== "undefined" && node[attr].toString() === this.attrs[attr]) { return true; } } } else { return true; } } return false; } diff --git a/HIG/source/qml/models/Contacts.qml b/HIG/source/qml/models/Contacts.qml new file mode 100644 index 0000000..bd410e3 --- /dev/null +++ b/HIG/source/qml/models/Contacts.qml @@ -0,0 +1,209 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import QtQuick 2.6 + +ListModel { + id: model + // Pattern + ListElement { + firstname: "" + lastname: "" + image: "" + communication: [ + ListElement { + icon: "" + text: "+12 34 1234 5678" + description: "mobile" + type: "phone" + actions: [ + ListElement { + icon: "" + } + ] + } + ] + } + + Component.onCompleted: { + model.clear() + var data = [{ + "firstname": "Berna", + "lastname": "Hicks", + "image": "BernaFace.jpg", + "communication": [{ + "icon": "call-start", + "type": "phone", + "text": "+12 34 1234 5678", + "description": "Mobile private", + "default": true, + "actions": [{ + "icon": "kmouth-phrase-new", + "text": "SMS" + }] + }, { + "icon": "", + "type": "phone", + "text": "+12 34 1234 5678", + "description": "VOIP" + }, { + "type": "email", + "icon": "mail-message", + "text": "susan@kde.org", + "default": true, + "description": "E-Mail private" + }], + "history": [{ + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + }, { + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + },{ + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + }] + }, { + "firstname": "Matt", + "lastname": "Byrne", + "image": "MattFace.jpg" + }, { + "firstname": "Santiago", + "lastname": "Thorne", + "image": "SantiagoFace.jpg", + "communication": [{ + "icon": "call-start", + "type": "phone", + "text": "+12 34 1234 5678", + "description": "Mobile private", + "default": true, + "actions": [{ + "icon": "kmouth-phrase-new", + "text": "SMS" + }] + }, { + "icon": "", + "type": "phone", + "text": "+12 34 1234 5678", + "description": "VOIP" + }, { + "type": "email", + "icon": "mail-message", + "text": "susan@kde.org", + "default": true, + "description": "E-Mail private" + }], + "history": [{ + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + }, { + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + },{ + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + }] + }, { + "firstname": "Susan", + "lastname": "Hoffman", + "image": "SusanFace.jpg", + "communication": [{ + "icon": "call-start", + "type": "phone", + "text": "+12 34 1234 5678", + "description": "Mobile private", + "default": true, + "actions": [{ + "icon": "kmouth-phrase-new", + "text": "SMS" + }] + }, { + "icon": "", + "type": "phone", + "text": "+12 34 1234 5678", + "description": "VOIP" + }, { + "type": "email", + "icon": "mail-message", + "text": "susan@kde.org", + "default": true, + "description": "E-Mail private" + }], + "history": [{ + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + }, { + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + },{ + "icon": "call-start", + "text": "+12 34 1234 5678", + "date": "2018-10-10" + }, { + "icon": "mail-message", + "text": "Lorem ipsum", + "date": "2018-10-10" + }] + }, { + "firstname": "Philip", + "lastname": "Steele", + "image": "PhilipFace.jpg" + }] + model.insert(0, data) + } +} diff --git a/HIG/source/qml/models/Files.qml b/HIG/source/qml/models/Files.qml new file mode 100644 index 0000000..64a5d9d --- /dev/null +++ b/HIG/source/qml/models/Files.qml @@ -0,0 +1,105 @@ + +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import QtQuick 2.6 + +ListModel { + id: model + // Pattern + ListElement { + name: "" + icon: "" + + subfolder: [ + ListElement { + name: "" + icon: "" + subfolder: ListElement { + name: "" + icon: "" + + subfolder: [ + ListElement { + name: "" + icon: "" + subfolder: ListElement { + name: "" + icon: "" + } + } + ] + } + } + ] + } + + Component.onCompleted: { + model.clear() + var data = [{ + "name": "HIG", + "icon": "folder-development", + "subfolder": [{ + "name": "build", + "icon": "folder-blue" + }, { + "name": "source", + "icon": "folder-development", + "subfolder": [{ + "name": "components", + "icon": "folder-text" + }, { + "name": "img", + "icon": "folder-picture" + }, { + "name": "introduction", + "icon": "folder-text" + }, { + "name": "layout", + "icon": "folder-text" + }, { + "name": "patterns", + "icon": "folder-text" + }, { + "name": "qml", + "icon": "folder-blue", + "subfolder": [{ + "name": "ui", + "icon": "folder-text" + }, { + "name": "lib", + "icon": "folder-text" + }, { + "name": "models", + "icon": "folder-text" + }] + }, { + "name": "resources", + "icon": "folder-text" + }, { + "name": "style", + "icon": "folder-blue" + }, { + "name": "video", + "icon": "folder-video" + }] + }] + }] + model.insert(0, data) + } +} diff --git a/HIG/source/qml/patterns/command/content/Content1.qml b/HIG/source/qml/patterns/command/content/Content1.qml new file mode 100644 index 0000000..7aa6593 --- /dev/null +++ b/HIG/source/qml/patterns/command/content/Content1.qml @@ -0,0 +1,74 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../../models/" as Models +import "../../../addr/" as Addr +import "../../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 2 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + var a = new A.An(addrbook.detailPage); + a.find("header").find("qquickrow").find("desktopicon").first().draw({ + "outline": {label: false} + }); + a.find("qquickcolumn").first().find("basiclistitem").first().find("qquickrectangle").find("desktopicon").draw({ + "outline": {label: false} + }); + } + } + Timer { + interval: 1500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/patterns/command/content/config.json b/HIG/source/qml/patterns/command/content/config.json new file mode 100644 index 0000000..121622b --- /dev/null +++ b/HIG/source/qml/patterns/command/content/config.json @@ -0,0 +1,7 @@ +{ + "Content1.qml": { + "type": "png", + "controls": "mobile", + "autostart": "false" + } +} diff --git a/HIG/source/qml/patterns/command/toolbar/Toolbar1.qml b/HIG/source/qml/patterns/command/toolbar/Toolbar1.qml new file mode 100644 index 0000000..3e93343 --- /dev/null +++ b/HIG/source/qml/patterns/command/toolbar/Toolbar1.qml @@ -0,0 +1,59 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../../models/" as Models +import "../../../addr/" as Addr +import "../../../lib/annotate.js" as A + +Rectangle { + width: 800 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 0 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + var a = new A.An(addrbook.detailPage); + a.find("abstractpageheader").find("privateactiontoolbutton").last().click(); + } + } + Timer { + interval: 5000 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/patterns/command/toolbar/config.json b/HIG/source/qml/patterns/command/toolbar/config.json new file mode 100644 index 0000000..f10c7ad --- /dev/null +++ b/HIG/source/qml/patterns/command/toolbar/config.json @@ -0,0 +1,6 @@ +{ + "Toolbar1.qml": { + "type": "png", + "autostart": "false" + } +} diff --git a/HIG/source/qml/patterns/content/form/Form1.qml b/HIG/source/qml/patterns/content/form/Form1.qml new file mode 100644 index 0000000..09c21e6 --- /dev/null +++ b/HIG/source/qml/patterns/content/form/Form1.qml @@ -0,0 +1,54 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import "../../../addr/" as Addr + +Rectangle { + width: 800 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 0 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + addrbook.detailPage.form.open(); + //contextDrawer.open(); + } + } + Timer { + interval: 2500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/patterns/content/form/Form2.qml b/HIG/source/qml/patterns/content/form/Form2.qml new file mode 100644 index 0000000..5fe5323 --- /dev/null +++ b/HIG/source/qml/patterns/content/form/Form2.qml @@ -0,0 +1,54 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import "../../../addr/" as Addr + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + index: 0 + Component.onCompleted: { + addrbook.pageStack.push(addrbook.detailPage) + } + } + + // HACK + Timer { + interval: 1000 + repeat: false + running: true + onTriggered: { + addrbook.detailPage.form.open(); + //contextDrawer.open(); + } + } + Timer { + interval: 2500 + repeat: false + running: true + onTriggered: { + qmlControler.start(); + } + } +} diff --git a/HIG/source/qml/patterns/content/form/config.json b/HIG/source/qml/patterns/content/form/config.json new file mode 100644 index 0000000..728c022 --- /dev/null +++ b/HIG/source/qml/patterns/content/form/config.json @@ -0,0 +1,11 @@ +{ + "Form1.qml": { + "type": "png", + "autostart": "false" + }, + "Form2.qml": { + "type": "png", + "autostart": "false", + "controls": "mobile" + } +} diff --git a/HIG/source/qml/patterns/navigation/breadcrumbs/Breadcrumb1.qml b/HIG/source/qml/patterns/navigation/breadcrumbs/Breadcrumb1.qml new file mode 100644 index 0000000..a632a5b --- /dev/null +++ b/HIG/source/qml/patterns/navigation/breadcrumbs/Breadcrumb1.qml @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../../models/" as Models +import "../../../addr/" as Addr +import "../../../lib/annotate.js" as A + +Rectangle { + width: 320 + height: 600 + id: root + + Addr.Addressbook { + id: addrbook + } + + // HACK + Timer { + interval: 4000 + repeat: false + running: true + onTriggered: { + var a = new A.An(addrbook); + a.find("swipelistitem").eq(3).find("qquickimage").touch(); + } + } + + Timer { + interval: 8000 + repeat: false + running: true + onTriggered: { + var b = new A.An(addrbook); + b.find("pagerowglobaltoolbarui").find("heading").first().touch(); + } + } +} diff --git a/HIG/source/qml/patterns/navigation/breadcrumbs/config.json b/HIG/source/qml/patterns/navigation/breadcrumbs/config.json new file mode 100644 index 0000000..8d0d583 --- /dev/null +++ b/HIG/source/qml/patterns/navigation/breadcrumbs/config.json @@ -0,0 +1,7 @@ +{ + "Breadcrumb1.qml": { + "type": "webm", + "duration": 10, + "controls": "mobile" + } +} diff --git a/HIG/source/qml/patterns/navigation/column/Column1.qml b/HIG/source/qml/patterns/navigation/column/Column1.qml new file mode 100644 index 0000000..ea5fa55 --- /dev/null +++ b/HIG/source/qml/patterns/navigation/column/Column1.qml @@ -0,0 +1,85 @@ +/* + * Copyright 2018 Fabian Riethmayer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.6 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 +import org.kde.kirigami 2.4 as Kirigami +import "../../../models/" as Models +import "../../../files/" as Files +import "../../../lib/annotate.js" as A + +Kirigami.ApplicationItem { + width: 320 + height: 600 + id: root + + property var mydata : Models.Files { + Component.onCompleted: { + rootFolder.pagemodel = mydata.get(0) + } + } + + pageStack.initialPage: Files.Folder { + id: rootFolder + pageroot: root + } + + pageStack.defaultColumnWidth: root.width < 320 ? root.width : 320 + pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Breadcrumb + + Timer { + interval: 2000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + a.find("basiclistitem").eq(1).touch(); + } + } + + Timer { + interval: 5000 + repeat: false + running: true + onTriggered: { + var a = new A.An(root); + a.find("basiclistitem").eq(7).touch(); + } + } + + Timer { + interval: 8000 + repeat: false + running: true + onTriggered: { + var b = new A.An(root); + b.swipe({fromX: -100, toX: 250}); + } + } + Timer { + interval: 11000 + repeat: false + running: true + onTriggered: { + var b = new A.An(root); + b.swipe({fromX: -50, toX: -100}); + } + } +} diff --git a/HIG/source/qml/patterns/navigation/column/config.json b/HIG/source/qml/patterns/navigation/column/config.json new file mode 100644 index 0000000..74ba692 --- /dev/null +++ b/HIG/source/qml/patterns/navigation/column/config.json @@ -0,0 +1,7 @@ +{ + "Column1.qml": { + "type": "webm", + "duration": 14, + "controls": "mobile" + } +} diff --git a/source/img/Content1.png b/source/img/Content1.png new file mode 100644 index 0000000..9d533ca Binary files /dev/null and b/source/img/Content1.png differ diff --git a/source/img/Toolbar1.png b/source/img/Toolbar1.png new file mode 100644 index 0000000..f6922d5 Binary files /dev/null and b/source/img/Toolbar1.png differ