From 236f8ce48b159eedec937f930c05429623d9dbc7 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Mon, 9 Jul 2018 22:50:22 +0800 Subject: [PATCH] Change press to hover. --- qml/component/MessageDelegate.qml | 12 ++++++------ qml/form/ListForm.qml | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/qml/component/MessageDelegate.qml b/qml/component/MessageDelegate.qml index 29c7c77..b03cecd 100644 --- a/qml/component/MessageDelegate.qml +++ b/qml/component/MessageDelegate.qml @@ -18,6 +18,7 @@ Item { } MouseArea { + id: baseMouseArea anchors.fill: parent ToolTip.visible: pressed @@ -42,12 +43,10 @@ Item { displayText: author.displayName MouseArea { - id: mouseArea - anchors.fill: parent - ToolTip.visible: pressed - ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval + hoverEnabled: true + ToolTip.visible: containsMouse ToolTip.text: author.displayName } } @@ -103,8 +102,9 @@ Item { MouseArea { anchors.fill: parent - ToolTip.visible: pressed - ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval + hoverEnabled: true + propagateComposedEvents: true + ToolTip.visible: containsMouse ToolTip.text: visible ? content.body : "" } } diff --git a/qml/form/ListForm.qml b/qml/form/ListForm.qml index eba7feb..14492e3 100644 --- a/qml/form/ListForm.qml +++ b/qml/form/ListForm.qml @@ -27,8 +27,7 @@ Item { height: 80 onClicked: listView.currentIndex = index - ToolTip.visible: pressed - ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval + ToolTip.visible: mini && hovered ToolTip.text: name contentItem: RowLayout {