From b9590bf688a5792e38a834676fa7ce0dc6a57900 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Sat, 23 Apr 2016 18:21:51 +0200 Subject: brush up mailListDelegate according to VDGs suggestions --- components/package/contents/ui/MailListView.qml | 83 +++++++++++++++++++------ 1 file changed, 64 insertions(+), 19 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index 01c9b68b..75162c39 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml @@ -45,47 +45,92 @@ Controls.ScrollView { focus: true delegate: Kirigami.AbstractListItem { + id: mailListDelegate + width: listView.width - height: Unit.size * 12 enabled: true supportsMouseEvents: true - checked: listView.currentIndex == index + checked: listView.currentIndex == index onClicked: { listView.currentIndex = model.index root.currentMail = model.domainObject } - RowLayout { - Avatar { - id: avatar + //Content + Item { + width: parent.width + height: Kirigami.Units.gridUnit * 4 - height: Unit.size * 9 - width: height + RowLayout { - name: model.senderName - } + anchors { + top: parent.top + bottom: parent.bottom + left: parent.left + } - ColumnLayout { + Avatar { + id: avatar - Kirigami.Label { - text: model.senderName + height: textItem.height + width: height - font.weight: Font.DemiBold + name: model.senderName } - Kirigami.Label { - text: model.subject - } + ColumnLayout { + id: textItem + height: Kirigami.Units.gridUnit * 3 + + Text{ + text: model.subject + + color: mailListDelegate.checked ? Kirigami.Theme.textColor : model.unread ? "#1d99f3" : Kirigami.Theme.textColor + font.weight: model.unread || model.important ? Font.DemiBold : Font.Normal + } + + Text { + text: model.senderName + + color: Kirigami.Theme.textColor + } - Kirigami.Label { - text: Qt.formatDateTime(model.date) + Text { + text: Qt.formatDateTime(model.date) - font.weight: Font.Light + font.weight: Font.Light + + opacity: 0.5 + } } } + Rectangle { + + anchors { + right: parent.right + bottom: parent.bottom + bottomMargin: 5 + } + + color: "lightgrey" //TODO wait for Kirigami pallete update + + height: Kirigami.Units.gridUnit * 2 + width: height + + visible: mailListDelegate.checked ? false : model.unread + + radius: 100 + + Text { + anchors.centerIn: parent + text: "+1" //TODO wait for thread implementation + color: Kirigami.Theme.complementaryTextColor + font.weight: Font.DemiBold + } + } } } } -- cgit v1.2.3