From a4626f5306ed3c5e52c28bb49d61ec50c7c2f329 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Fri, 5 Apr 2013 00:19:21 +0200 Subject: add avatars to topic view --- qml/TopicPage.qml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'qml') diff --git a/qml/TopicPage.qml b/qml/TopicPage.qml index 9835a06..ebaa2c6 100644 --- a/qml/TopicPage.qml +++ b/qml/TopicPage.qml @@ -77,23 +77,51 @@ Page { spacing: 2 Item { + id: authorInfo + width: parent.width height: childrenRect.height + Image { + id: authorIcon + height: 48 + width: 48 + fillMode: Image.PreserveAspectFit + source: model.icon + sourceSize.height: 48 + } + Text { - anchors.top: parent.top - anchors.left: parent.left + id: authorName text: model.userName font: UiConstants.SmallTitleFont textFormat: Text.PlainText } + Text { + id: authorTime anchors.top: parent.top anchors.right: parent.right text: model.humanTime font: UiConstants.SubtitleFont textFormat: Text.PlainText } + + states: State { + name: "with-image" + when: authorIcon.status === Image.Ready + + AnchorChanges { + target: authorName + anchors.bottom: authorIcon.bottom + anchors.left: authorIcon.right + } + + PropertyChanges { + target: authorName + anchors.leftMargin: UiConstants.ButtonSpacing + } + } } Text { -- cgit v1.2.3