From 84714d6f9435b59045c08c76eb556663d1ee36d4 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 2 Feb 2017 21:23:40 +0100 Subject: add initial contact controller and contact detail view --- components/package/contents/ui/People.qml | 90 +++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) (limited to 'components/package/contents') diff --git a/components/package/contents/ui/People.qml b/components/package/contents/ui/People.qml index 47dd82ec..810ae0f4 100644 --- a/components/package/contents/ui/People.qml +++ b/components/package/contents/ui/People.qml @@ -22,6 +22,8 @@ import QtQuick.Controls 1.4 as Controls import QtQuick.Layouts 1.1 import org.kde.kirigami 1.0 as Kirigami +import org.kube.framework.domain 1.0 as KubeFramework + Popup { @@ -120,14 +122,102 @@ Popup { } Item { + + KubeFramework.ContactController { + id: contactController + } + height: parent.height Layout.fillWidth: true ToolBar { + id: detailToolBar width: parent.width height: Kirigami.Units.gridUnit * 2 } + + Rectangle { + + anchors { + top: detailToolBar.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + //margins: Kirigami.Units.largeSpacing + } + + color: Krigami.Theme.viewBackgroundColor + + ColumnLayout { + + anchors { + top: parent.top + left: parent.left + margins: Kirigami.Units.smallSpacing + } + + width: parent.width + + Avatar { + id: avatar + + + height: Kirigami.Units.gridUnit * 2.5 + width: height + + name: contactController.name + } + + Text { + color: Kirigami.Theme.textColor + opacity: 0.8 + + text: contactController.name + + font.weight: Font.DemiBold + } + + Text { + color: Kirigami.Theme.textColor + text: "Email" + font.weight: Font.DemiBold + opacity: 0.8 + } + + ColumnLayout { + Repeater { + model: contactController.emails + + RowLayout { + Text { text: modelData } + Controls.ToolButton { + iconName: "edit-delete" + + onClicked: { + contactController.removeEmail(modelData) + } + } + } + } + + RowLayout { + TextField { + id: newEmail + } + + Button { + text: "Add email" + + onClicked: { + contactController.addEmail(newEmail.text) + newEmail.text = ""; + } + } + } + } + } + } } } } -- cgit v1.2.3