From 699958ee8d39176da230fa6193cd7c91e08b5165 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 26 Jul 2017 13:56:21 -0600 Subject: Standard ListDelegate onClicked handler --- components/kube/contents/ui/ComposerView.qml | 1 - components/kube/contents/ui/LogView.qml | 1 - framework/qml/ListDelegate.qml | 5 +++++ framework/qml/MailListView.qml | 2 -- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/kube/contents/ui/ComposerView.qml b/components/kube/contents/ui/ComposerView.qml index 1bf1406b..02af63c1 100644 --- a/components/kube/contents/ui/ComposerView.qml +++ b/components/kube/contents/ui/ComposerView.qml @@ -148,7 +148,6 @@ Kube.View { color: Kube.Colors.textColor border.width: 0 - onClicked: ListView.view.currentIndex = index Item { id: content diff --git a/components/kube/contents/ui/LogView.qml b/components/kube/contents/ui/LogView.qml index c2fe2472..d5f9f710 100644 --- a/components/kube/contents/ui/LogView.qml +++ b/components/kube/contents/ui/LogView.qml @@ -57,7 +57,6 @@ Controls.SplitView { delegate: Kube.ListDelegate { border.color: Kube.Colors.buttonColor border.width: 1 - onClicked: ListView.view.currentIndex = index Kube.Label { id: description anchors { diff --git a/framework/qml/ListDelegate.qml b/framework/qml/ListDelegate.qml index fd654e4c..6d6a5d08 100644 --- a/framework/qml/ListDelegate.qml +++ b/framework/qml/ListDelegate.qml @@ -33,6 +33,11 @@ T.ItemDelegate { hoverEnabled: true highlighted: ListView.isCurrentItem + onClicked: { + ListView.view.currentIndex = index + ListView.view.forceActiveFocus() + } + background: Kube.DelegateBackground { id: background border.color: Kube.Colors.buttonColor diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index 9de30313..d4e0672b 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml @@ -107,8 +107,6 @@ FocusScope { //Required for D&D property var mail: model.mail - onClicked: ListView.view.currentIndex = index - width: scrollbar.visible ? listView.width - scrollbar.width : listView.width height: Kube.Units.gridUnit * 5 -- cgit v1.2.3