From 1a129335dd93d44253d3e11bcf77cc633a0f007e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 30 Oct 2018 19:57:07 +1300 Subject: [PATCH] Fix Goto app cards staying highlighted if move off dialog while dragging --- interface/resources/qml/hifi/Card.qml | 18 +++++++++++++----- interface/resources/qml/hifi/Feed.qml | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/hifi/Card.qml b/interface/resources/qml/hifi/Card.qml index 83bf1e2c54..e848dcd862 100644 --- a/interface/resources/qml/hifi/Card.qml +++ b/interface/resources/qml/hifi/Card.qml @@ -49,6 +49,7 @@ Item { property string defaultThumbnail: Qt.resolvedUrl("../../images/default-domain.gif"); property int shadowHeight: 10; property bool hovered: false + property bool scrolling: false HifiConstants { id: hifi } @@ -236,11 +237,12 @@ Item { property var hoverThunk: function () { }; property var unhoverThunk: function () { }; Rectangle { - anchors.fill: parent; - visible: root.hovered - color: "transparent"; - border.width: 4; border.color: hifiStyleConstants.colors.primaryHighlight; - z: 1; + anchors.fill: parent + visible: root.hovered && !root.scrolling + color: "transparent" + border.width: 4 + border.color: hifiStyleConstants.colors.primaryHighlight + z: 1 } MouseArea { anchors.fill: parent; @@ -255,6 +257,12 @@ Item { hoverThunk(); } onExited: unhoverThunk(); + onCanceled: unhoverThunk(); + } + MouseArea { + // This second mouse area causes onEntered to fire on the first if you scroll just a little and the cursor stays on + // the original card. I.e., the original card is re-highlighted if the cursor is on it after scrolling finishes. + anchors.fill: parent } StateImage { id: actionIcon; diff --git a/interface/resources/qml/hifi/Feed.qml b/interface/resources/qml/hifi/Feed.qml index 346481fe1f..a8337530c6 100644 --- a/interface/resources/qml/hifi/Feed.qml +++ b/interface/resources/qml/hifi/Feed.qml @@ -141,6 +141,8 @@ Column { textSizeSmall: root.textSizeSmall; stackShadowNarrowing: root.stackShadowNarrowing; shadowHeight: root.stackedCardShadowHeight; + scrolling: scroll.moving + hoverThunk: function () { hovered = true; if(root.autoScrollTimerEnabled) {