-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPost.qml
134 lines (114 loc) · 4.08 KB
/
Post.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
Page {
id: postPage
spacing: 2
readonly property int m_SPACING: 5
readonly property int m_MARGINS: 2
property bool summary: true
header: ToolBar {
id: pageHeaderToolbar
Row {
id: toolBarRow
anchors.fill: parent
spacing: postPage.m_SPACING
Rectangle { //Spacer for left side of page header.
width: 1
height: 1
color: 'transparent'
}
Column {
id: authorColumn
Text {
id: authorNameLabel
text: author_name //provided by postListComponent in PostList.qml
elide: Label.ElideRight
}
Rectangle {
id: authorAvatarRectangle
width: authorNameLabel.contentWidth
height: 54
color: 'transparent'
Rectangle {
width: 52
height: width
clip: true
color: 'transparent'
border.color: 'white'
border.width: 2
anchors.centerIn: parent
Text {
text: 'No Image'
anchors.centerIn: parent
rotation: -45
}
Image {
id: authorAvatarImage
width: parent.width - (parent.border.width * 2)
height: parent.height - (parent.border.width * 2)
source: author_avatar //provided by postListComponent in PostList.qml
sourceSize.width: width
sourceSize.height: height
anchors.centerIn: parent
}
}
}
Rectangle { //Spacer for bottom of picture.
width: authorNameLabel.contentWidth
height: postPage.m_SPACING
color: 'transparent'
}
}
Column {
id: titleColumn
height: parent.height
Label {
id: createdAtLabel
width: postPage.width -
authorColumn.width -
muteButton.width -
(postPage.m_SPACING * 3) - 1
elide: Label.ElideRight
font.bold: true
text: created_at //provided by postListComponent in PostList.qml
}
Text {
id: titleLabel
width: postPage.width -
authorColumn.width -
muteButton.width -
(postPage.m_SPACING * 3) - 1
height: titleColumn.height - createdAtLabel.height
elide: Label.ElideRight
wrapMode: Text.WordWrap
text: post_title //provided by postListComponent in PostList.qml
}
}
ToolButton {
id: muteButton
Layout.alignment: Qt.AlignTop | Qt.AlignRight
text: qsTr("X")
}
}
Component.onCompleted: {}
}
Column {
id: bodyTextColumn
anchors.fill: parent
anchors.margins: postPage.m_MARGINS
Text {
id: postBodyText
width: parent.width
//height: 20
elide: Label.ElideRight
wrapMode: Text.WordWrap
text: post_body //provided by postListComponent in PostList.qml
}
Rectangle { //Spacer for bottom of text.
width: parent.width
height: postPage.m_SPACING
color: 'transparent'
}
}
}