diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-11 18:16:56 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-11 18:16:56 +0200 |
commit | bf1c1d8398dd1ea6d37db7f2a7fa5c3c4dd1ea12 (patch) | |
tree | 970d056c22b16044450def166946843944585921 | |
parent | eae257f889d300f6d8b81ff80d81501bcfe933bf (diff) | |
parent | edf9151701488982cacb736f79097fdab8e38ef6 (diff) | |
download | kube-bf1c1d8398dd1ea6d37db7f2a7fa5c3c4dd1ea12.tar.gz kube-bf1c1d8398dd1ea6d37db7f2a7fa5c3c4dd1ea12.zip |
Merge branch 'develop' of git://anongit.kde.org/kube into develop
-rw-r--r-- | components/package/contents/ui/SingleMailView.qml | 205 |
1 files changed, 125 insertions, 80 deletions
diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml index 0248c3bd..ea8a7730 100644 --- a/components/package/contents/ui/SingleMailView.qml +++ b/components/package/contents/ui/SingleMailView.qml | |||
@@ -20,130 +20,157 @@ import QtQuick.Controls 1.3 | |||
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 |
21 | import org.kde.kirigami 1.0 as Kirigami | 21 | import org.kde.kirigami 1.0 as Kirigami |
22 | 22 | ||
23 | import QtQml 2.2 as QtQml | ||
24 | |||
23 | import org.kube.framework.domain 1.0 as KubeFramework | 25 | import org.kube.framework.domain 1.0 as KubeFramework |
24 | import org.kube.framework.theme 1.0 | 26 | import org.kube.framework.theme 1.0 |
25 | 27 | ||
26 | Rectangle { | 28 | Item { |
27 | id: root | 29 | id: root |
28 | property variant mail; | ||
29 | 30 | ||
30 | color: "grey" | 31 | property variant mail; |
31 | 32 | ||
32 | ScrollView { | 33 | ScrollView { |
34 | |||
33 | anchors.fill: parent | 35 | anchors.fill: parent |
34 | 36 | ||
35 | ListView { | 37 | ListView { |
36 | anchors.verticalCenter: parent.verticalCenter | 38 | anchors.fill: parent |
37 | 39 | ||
38 | width: parent.width | 40 | model: KubeFramework.MailListModel { |
41 | mail: root.mail | ||
42 | } | ||
39 | 43 | ||
40 | header: Item { | 44 | header: Item { |
41 | height: Kirigami.Units.largeSpacing | 45 | height: Kirigami.Units.gridUnit |
42 | } | 46 | width: parent.width |
43 | 47 | ||
44 | footer: Item { | 48 | } |
45 | height: Kirigami.Units.largeSpacing * 3 | ||
46 | } | ||
47 | 49 | ||
48 | model: KubeFramework.MailListModel { | 50 | footer: Item { |
49 | mail: root.mail | 51 | height: Kirigami.Units.gridUnit * 2 |
50 | } | 52 | width: parent.width |
53 | } | ||
51 | 54 | ||
52 | delegate: Item { | 55 | delegate: Item { |
53 | 56 | ||
54 | width: root.width | 57 | height: sheet.height + Kirigami.Units.gridUnit * 2 |
55 | implicitHeight: content.height | 58 | width: parent.width |
56 | 59 | ||
57 | Rectangle { | 60 | Rectangle { |
58 | id: content | 61 | id: sheet |
59 | anchors.centerIn: parent | 62 | anchors.centerIn: parent |
63 | implicitHeight: header.height + body.height + (Kirigami.Units.gridUnit * 2.5) * 2 + footer.height | ||
64 | width: parent.width - Kirigami.Units.gridUnit * 4 | ||
60 | 65 | ||
61 | width: parent.width * 0.9 | 66 | //TODO bookmark |
62 | implicitHeight: header.height + body.height + footer.height + Kirigami.Units.gridUnit * 8 | 67 | /* |
68 | ToolButton { | ||
69 | iconName: "bookmark-new" | ||
63 | 70 | ||
71 | } | ||
72 | */ | ||
64 | Item { | 73 | Item { |
65 | id: header | 74 | id: header |
66 | 75 | ||
67 | anchors { | 76 | height: Kirigami.Units.gridUnit * 5 |
68 | top: parent.top | 77 | width: parent.width |
69 | topMargin: Kirigami.Units.largeSpacing | ||
70 | horizontalCenter: parent.horizontalCenter | ||
71 | } | ||
72 | 78 | ||
73 | width: parent.width - Kirigami.Units.largeSpacing * 2 | 79 | Row { |
74 | height: Kirigami.Units.gridUnit * 6 | 80 | id: headerContent |
81 | anchors { | ||
82 | left: seperator.left | ||
83 | bottom: seperator.top | ||
84 | bottomMargin: height * 0.25 | ||
85 | } | ||
75 | 86 | ||
87 | spacing: Kirigami.Units.largeSpacing / 2 | ||
76 | 88 | ||
77 | Avatar { | 89 | Avatar { |
78 | id: avatar | 90 | id: avatar |
79 | 91 | ||
80 | height: Kirigami.Units.gridUnit * 4 | 92 | height: Kirigami.Units.gridUnit * 2.5 |
81 | width: height | 93 | width: height |
82 | 94 | ||
83 | name: model.senderName | 95 | name: model.sender |
84 | } | 96 | } |
85 | 97 | ||
86 | Text { | 98 | ColumnLayout { |
87 | 99 | ||
88 | anchors { | 100 | RowLayout { |
89 | bottom: parent.bottom | ||
90 | left: parent.left | ||
91 | bottomMargin: Kirigami.Units.smallSpacing | ||
92 | } | ||
93 | 101 | ||
94 | text: model.subject | 102 | Text { |
95 | renderType: Text.NativeRendering | 103 | text: model.senderName |
96 | color: Kirigami.Theme.textColor | ||
97 | } | ||
98 | 104 | ||
99 | Text { | 105 | font.weight: Font.DemiBold |
106 | color: Kirigami.Theme.textColor | ||
107 | opacity: 0.75 | ||
108 | } | ||
100 | 109 | ||
101 | anchors { | 110 | //TODO not yet in model |
102 | top: avatar.top | 111 | /* |
103 | left: avatar.right | 112 | Text { |
104 | leftMargin: Kirigami.Units.smallSpacing | 113 | text: model.senderAd |
105 | } | ||
106 | 114 | ||
107 | text: model.senderName | 115 | color: Kirigami.Theme.textColor |
116 | opacity: 0.75 | ||
117 | } | ||
118 | */ | ||
119 | } | ||
108 | 120 | ||
109 | renderType: Text.NativeRendering | 121 | RowLayout { |
110 | color: Kirigami.Theme.textColor | 122 | Kirigami.Label { |
123 | text: "To:" | ||
124 | } | ||
125 | Text { | ||
126 | text: "TODO TODO TODO"//model.receivers TODO not yet in model | ||
127 | |||
128 | color: Kirigami.Theme.textColor | ||
129 | opacity: 0.75 | ||
130 | } | ||
131 | } | ||
132 | } | ||
111 | } | 133 | } |
112 | 134 | ||
113 | Text { | 135 | Text { |
114 | 136 | ||
115 | anchors { | 137 | anchors { |
116 | right: parent.right | 138 | right: seperator.right |
139 | bottom: headerContent.top | ||
117 | } | 140 | } |
141 | |||
118 | text: Qt.formatDateTime(model.date) | 142 | text: Qt.formatDateTime(model.date) |
119 | 143 | ||
120 | renderType: Text.NativeRendering | 144 | font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 |
121 | color: Kirigami.Theme.textColor | 145 | color: Kirigami.Theme.textColor |
146 | opacity: 0.75 | ||
122 | } | 147 | } |
123 | 148 | ||
124 | Rectangle { | 149 | Rectangle { |
150 | id: seperator | ||
125 | 151 | ||
126 | anchors { | 152 | anchors { |
127 | bottom: border.top | 153 | bottom: parent.bottom |
128 | right: border.right | 154 | horizontalCenter: parent.horizontalCenter |
129 | } | 155 | } |
130 | 156 | ||
131 | height: Kirigami.Units.iconSizes.small | 157 | width: parent.width - Kirigami.Units.gridUnit * 2 |
132 | width: height | 158 | height: 1 |
133 | 159 | ||
134 | color: Kirigami.Theme.complementaryBackgroundColor | 160 | color: Kirigami.Theme.textColor |
135 | opacity: 0.5 | 161 | opacity: 0.5 |
136 | } | 162 | } |
137 | 163 | ||
138 | Rectangle { | 164 | Rectangle { |
139 | id: border | 165 | anchors { |
140 | 166 | bottom: seperator.top | |
141 | anchors.bottom: parent.bottom | 167 | right: seperator.right |
142 | width: parent.width | 168 | } |
143 | height: 1 | ||
144 | 169 | ||
145 | color: Kirigami.Theme.complementaryBackgroundColor | 170 | height: Kirigami.Units.gridUnit |
171 | width: height | ||
146 | 172 | ||
173 | color: Kirigami.Theme.textColor | ||
147 | opacity: 0.5 | 174 | opacity: 0.5 |
148 | } | 175 | } |
149 | } | 176 | } |
@@ -153,9 +180,11 @@ Rectangle { | |||
153 | 180 | ||
154 | anchors { | 181 | anchors { |
155 | top: header.bottom | 182 | top: header.bottom |
156 | topMargin: Kirigami.Units.largeSpacing * 2 | 183 | left: parent.left |
157 | left: header.left | 184 | right: parent.right |
158 | leftMargin: Kirigami.Units.largeSpacing | 185 | leftMargin: avatar.height + Kirigami.Units.gridUnit |
186 | rightMargin: avatar.height + Kirigami.Units.gridUnit | ||
187 | topMargin: avatar.height | ||
159 | } | 188 | } |
160 | 189 | ||
161 | width: header.width - Kirigami.Units.largeSpacing * 2 | 190 | width: header.width - Kirigami.Units.largeSpacing * 2 |
@@ -167,21 +196,37 @@ Rectangle { | |||
167 | Item { | 196 | Item { |
168 | id: footer | 197 | id: footer |
169 | 198 | ||
170 | anchors { | 199 | anchors.bottom: parent.bottom |
171 | bottom: parent.bottom | 200 | |
172 | bottomMargin: Kirigami.Units.largeSpacing | 201 | height: Kirigami.Units.gridUnit * 3 |
173 | horizontalCenter: parent.horizontalCenter | 202 | width: parent.width |
174 | } | 203 | |
204 | Text { | ||
205 | |||
206 | anchors{ | ||
207 | verticalCenter: parent.verticalCenter | ||
208 | left: parent.left | ||
209 | leftMargin: Kirigami.Units.gridUnit | ||
210 | } | ||
175 | 211 | ||
176 | width: header.width | 212 | text: "Delete Mail" |
177 | height: Kirigami.Units.gridUnit | 213 | color: Kirigami.Theme.textColor |
214 | opacity: 0.5 | ||
215 | } | ||
178 | 216 | ||
179 | ToolButton { | 217 | ToolButton { |
180 | text: "Delete Email" | 218 | anchors{ |
219 | verticalCenter: parent.verticalCenter | ||
220 | right: parent.right | ||
221 | rightMargin: Kirigami.Units.gridUnit | ||
222 | } | ||
223 | |||
224 | iconName: "mail-reply-sender" | ||
181 | } | 225 | } |
182 | } | 226 | } |
227 | |||
183 | } | 228 | } |
184 | } | 229 | } |
185 | } | 230 | } |
186 | } | 231 | } |
187 | } | 232 | } \ No newline at end of file |