diff --git a/source/qml/files/Folder.qml b/source/qml/files/Folder.qml index 81a8b5f..1bd07be 100644 --- a/source/qml/files/Folder.qml +++ b/source/qml/files/Folder.qml @@ -1,87 +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: { - console.log(list.currentIndex) 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/source/qml/models/Contacts.qml b/source/qml/models/Contacts.qml index d5d5c39..9554d6b 100644 --- a/source/qml/models/Contacts.qml +++ b/source/qml/models/Contacts.qml @@ -1,115 +1,137 @@ /* * 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" }, { "firstname": "Matt", "lastname": "Byrne", "image": "MattFace.jpg" }, { "firstname": "Santiago", "lastname": "Thorne", - "image": "SantiagoFace.jpg" + "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" + }] }, { "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) } }