summaryrefslogtreecommitdiffstats
path: root/framework/qml/ConversationView.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-19 10:10:35 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-19 10:10:35 -0600
commit96348408b0384a6835302524f00f0a6a238cde07 (patch)
tree3ec7c8fcaaf0b06e0ee01aa23fc7528206fae3e2 /framework/qml/ConversationView.qml
parent43fe6d691880e9b8ce834fabb21f15a0cef35046 (diff)
downloadkube-96348408b0384a6835302524f00f0a6a238cde07.tar.gz
kube-96348408b0384a6835302524f00f0a6a238cde07.zip
Fixed mouse interaction with mail content
Previously mouse interaction was blocked by the mouse area in the delegate. An additional problem was after that, that the listview lost focus when the textview got focus which was fixed by introducing a focus scope and aquiring the currentItem status via activeFocus. The downside is that the focus stealing of the webengineview now becomes apparent again, but that can be fixed in qt 5.9. Otherwise this seems to work as expected now.
Diffstat (limited to 'framework/qml/ConversationView.qml')
-rw-r--r--framework/qml/ConversationView.qml14
1 files changed, 8 insertions, 6 deletions
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml
index 92b2a0c1..9eab9afa 100644
--- a/framework/qml/ConversationView.qml
+++ b/framework/qml/ConversationView.qml
@@ -74,8 +74,13 @@ FocusScope {
74 property bool isCurrentItem: false 74 property bool isCurrentItem: false
75 property int index: -1 75 property int index: -1
76 76
77 focus: false 77 focus: true
78 activeFocusOnTab: false 78 activeFocusOnTab: false
79 onActiveFocusChanged: {
80 if (activeFocus) {
81 listView.currentIndex = delegateRoot.index
82 }
83 }
79 84
80 height: sheet.height + Kube.Units.gridUnit 85 height: sheet.height + Kube.Units.gridUnit
81 width: listView.width 86 width: listView.width
@@ -83,12 +88,9 @@ FocusScope {
83 88
84 MouseArea { 89 MouseArea {
85 anchors.fill: parent 90 anchors.fill: parent
91 acceptedButtons: Qt.NoButton
86 hoverEnabled: true 92 hoverEnabled: true
87 onEntered: listView.currentIndex = delegateRoot.index 93 onEntered: delegateRoot.forceActiveFocus(Qt.MouseFocusReason)
88 onClicked: {
89 listView.currentIndex = delegateRoot.index
90 listView.forceActiveFocus(Qt.MouseFocusReason)
91 }
92 } 94 }
93 95
94 MailViewer { 96 MailViewer {