diff options
-rw-r--r-- | components/package/contents/ui/MailListView.qml | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index a26dcc2b..3f0ebcaa 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml | |||
@@ -20,7 +20,6 @@ import QtQuick 2.7 | |||
20 | import QtQuick.Controls 2.0 | 20 | import QtQuick.Controls 2.0 |
21 | import QtQuick.Controls 1.4 as Controls | 21 | import QtQuick.Controls 1.4 as Controls |
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 |
23 | import QtQml 2.2 as QtQml | ||
24 | 23 | ||
25 | import org.kde.kirigami 1.0 as Kirigami | 24 | import org.kde.kirigami 1.0 as Kirigami |
26 | 25 | ||
@@ -114,6 +113,10 @@ Item { | |||
114 | //END keyboard nav | 113 | //END keyboard nav |
115 | 114 | ||
116 | currentIndex: root.currentIndex | 115 | currentIndex: root.currentIndex |
116 | onCurrentItemChanged: { | ||
117 | root.currentMail = currentItem.currentData.domainObject; | ||
118 | root.isDraft = currentItem.currentData.draft; | ||
119 | } | ||
117 | 120 | ||
118 | model: KubeFramework.MailListModel { | 121 | model: KubeFramework.MailListModel { |
119 | parentFolder: root.parentFolder | 122 | parentFolder: root.parentFolder |
@@ -122,22 +125,11 @@ Item { | |||
122 | delegate: Item { | 125 | delegate: Item { |
123 | id: origin | 126 | id: origin |
124 | 127 | ||
128 | property variant currentData: model | ||
129 | |||
125 | width: delegateRoot.width | 130 | width: delegateRoot.width |
126 | height: delegateRoot.height | 131 | height: delegateRoot.height |
127 | 132 | ||
128 | QtQml.Binding { | ||
129 | target: root | ||
130 | property: "currentMail" | ||
131 | when: listView.currentIndex == index | ||
132 | value: model.domainObject | ||
133 | } | ||
134 | QtQml.Binding { | ||
135 | target: root | ||
136 | property: "isDraft" | ||
137 | when: listView.currentIndex == index | ||
138 | value: model.draft | ||
139 | } | ||
140 | |||
141 | Item { | 133 | Item { |
142 | id: delegateRoot | 134 | id: delegateRoot |
143 | 135 | ||