~ken-vandine/gwibber/friends-transitional

« back to all changes in this revision

Viewing changes to qml/ThreadView.qml

  • Committer: Ken VanDine
  • Date: 2013-04-05 15:54:38 UTC
  • Revision ID: ken.vandine@canonical.com-20130405155438-3rhbg5qwsos2wx93
transitional package depending on the renamed friends-app package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.0
2
 
import Ubuntu.Components 0.1
3
 
import Friends 0.1
4
 
 
5
 
Item {
6
 
    height: threadListView.height + pictureImage.height
7
 
    width: parent.width
8
 
    anchors {
9
 
        bottomMargin: units.gu(2)
10
 
    }
11
 
 
12
 
    StreamModel {
13
 
        id: streamModel
14
 
        stream: "reply_to/"+messageId
15
 
    }
16
 
 
17
 
 
18
 
    FriendsUtils {
19
 
        id: friendsUtils
20
 
    }
21
 
 
22
 
    Column {
23
 
        id: threadListView
24
 
        width: parent.width
25
 
        Repeater {
26
 
            width: parent.width
27
 
            model: streamModel
28
 
            delegate: Item {
29
 
                id: threadItem
30
 
                width: parent.width - units.gu(8)
31
 
                anchors {
32
 
                    right: parent.right
33
 
                    leftMargin: units.gu(8)
34
 
                    rightMargin: units.gu(2)
35
 
                    bottomMargin: units.gu(2)
36
 
                }
37
 
                height: status_update_content.height
38
 
 
39
 
                UbuntuShape {
40
 
                    id: avatarImage
41
 
                    radius: "small"
42
 
                    height: units.dp(32)
43
 
                    width: units.dp(32)
44
 
                    anchors {
45
 
                        left: parent.left
46
 
                        top: parent.top
47
 
                        leftMargin: units.gu(1)
48
 
                        topMargin: units.gu(1)
49
 
                    }
50
 
                    image: Image {
51
 
                        source: Qt.resolvedUrl(column_10)
52
 
                        asynchronous: true
53
 
                        fillMode: Image.PreserveAspectFit
54
 
                    }
55
 
                }
56
 
 
57
 
                Item {
58
 
                    id: status_update_content
59
 
                    anchors {
60
 
                        left: avatarImage.right
61
 
                        right: parent.right
62
 
                        top: parent.top
63
 
                        topMargin: units.gu(1)
64
 
                        leftMargin: units.gu(1)
65
 
                        bottomMargin: units.gu(1)
66
 
                        rightMargin: units.gu(1)
67
 
                    }
68
 
                    width: parent.width - avatarImage.width
69
 
                    height: childrenRect.height + units.gu(1)
70
 
 
71
 
                    Column {
72
 
                        width: parent.width
73
 
                        spacing: 0
74
 
                        anchors {
75
 
                            left: parent.left;
76
 
                            right: parent.right
77
 
                            bottomMargin: units.gu(2)
78
 
                        }
79
 
                        Label {
80
 
                            text: column_4
81
 
                            fontSize: "small"
82
 
                            font.bold: true
83
 
                            width: parent.width
84
 
                        }
85
 
                        Label {
86
 
                            id: messageText
87
 
                            text: column_9
88
 
                            wrapMode: Text.WrapAtWordBoundaryOrAnywhere
89
 
                            width: parent.width - units.gu(3)
90
 
                            fontSize: "small"
91
 
                            onLinkActivated: {
92
 
                                console.log(link + " link activated");
93
 
                                Qt.openUrlExternally(link);
94
 
                            }
95
 
                        }
96
 
                    }
97
 
                    Row {
98
 
                        anchors.right: parent.right
99
 
                        anchors.rightMargin: units.gu(1)
100
 
                        anchors.top: parent.top
101
 
                        spacing: units.gu(1)
102
 
 
103
 
                        Text {
104
 
                            id: time
105
 
                            text: friendsUtils.createTimeString(column_8)
106
 
                            font.family: "Ubuntu"
107
 
                            font.pointSize: 8
108
 
                            color: "gray"
109
 
                        }
110
 
                    }
111
 
                }
112
 
            }
113
 
        }
114
 
    }
115
 
}