diff options
Diffstat (limited to 'components/package/contents/ui/MessagePartTree.qml')
-rw-r--r-- | components/package/contents/ui/MessagePartTree.qml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/components/package/contents/ui/MessagePartTree.qml b/components/package/contents/ui/MessagePartTree.qml index d44a1e5e..8bc13e6e 100644 --- a/components/package/contents/ui/MessagePartTree.qml +++ b/components/package/contents/ui/MessagePartTree.qml | |||
@@ -5,7 +5,8 @@ Item { | |||
5 | id: root | 5 | id: root |
6 | property alias rootIndex: visualModel.rootIndex | 6 | property alias rootIndex: visualModel.rootIndex |
7 | property int nestingLevel: 0 | 7 | property int nestingLevel: 0 |
8 | property int desiredHeight: messagePartRect.height | 8 | property int contentHeight: messagePartRect.height |
9 | property int contentWidth: 0 | ||
9 | Rectangle { | 10 | Rectangle { |
10 | id: messagePartRect | 11 | id: messagePartRect |
11 | height: partListView.contentHeight | 12 | height: partListView.contentHeight |
@@ -24,6 +25,7 @@ Item { | |||
24 | anchors.top: delegateRect.top | 25 | anchors.top: delegateRect.top |
25 | anchors.left: delegateRect.left | 26 | anchors.left: delegateRect.left |
26 | width: messagePartRect.width | 27 | width: messagePartRect.width |
28 | height: contentHeight | ||
27 | content: model.text | 29 | content: model.text |
28 | isHtml: model.isHtml | 30 | isHtml: model.isHtml |
29 | visible: model.hasContent | 31 | visible: model.hasContent |
@@ -33,16 +35,19 @@ Item { | |||
33 | height = 0 | 35 | height = 0 |
34 | } | 36 | } |
35 | } | 37 | } |
38 | onContentWidthChanged: { | ||
39 | root.contentWidth = contentWidth > root.contentWidth ? contentWidth : root.contentWidth | ||
40 | } | ||
36 | contentType: model.type | 41 | contentType: model.type |
37 | } | 42 | } |
38 | Loader { | 43 | Loader { |
39 | id: partLoader | 44 | id: partLoader |
40 | anchors.top: contentView.bottom | 45 | anchors.top: contentView.bottom |
41 | anchors.left: contentView.left | 46 | anchors.left: contentView.left |
42 | width: messagePartRect.width | ||
43 | visible: model.hasModelChildren | 47 | visible: model.hasModelChildren |
44 | active: model.hasModelChildren | 48 | active: model.hasModelChildren |
45 | height: item ? item.desiredHeight : 0 | 49 | height: item ? item.contentHeight : 0 |
50 | width: messagePartRect.width | ||
46 | } | 51 | } |
47 | Component.onCompleted: { | 52 | Component.onCompleted: { |
48 | if (model.hasModelChildren) { | 53 | if (model.hasModelChildren) { |