From f3969b09099daf582b5629ef3af222a86a82ac1d Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 17 Aug 2017 22:28:42 +0200 Subject: [PATCH 1/2] Switch off snap behavior --- interface/resources/qml/hifi/Feed.qml | 3 --- 1 file changed, 3 deletions(-) diff --git a/interface/resources/qml/hifi/Feed.qml b/interface/resources/qml/hifi/Feed.qml index c1bd35f49d..201093ebad 100644 --- a/interface/resources/qml/hifi/Feed.qml +++ b/interface/resources/qml/hifi/Feed.qml @@ -237,9 +237,6 @@ Column { textSizeSmall: root.textSizeSmall; stackShadowNarrowing: root.stackShadowNarrowing; shadowHeight: root.stackedCardShadowHeight; - - hoverThunk: function () { scrollToIndex(index); } - unhoverThunk: function () { scrollToIndex(-1); } } } NumberAnimation { From 4eba09214cc1ea939d84f763238a1d1c10d2ef81 Mon Sep 17 00:00:00 2001 From: vladest Date: Fri, 18 Aug 2017 08:11:29 +0200 Subject: [PATCH 2/2] Delegate highlighting to delegate item. Make sure ListView will not snap highlighted item --- interface/resources/qml/hifi/Card.qml | 9 +++++++++ interface/resources/qml/hifi/Feed.qml | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/Card.qml b/interface/resources/qml/hifi/Card.qml index fd76c03e45..678245910b 100644 --- a/interface/resources/qml/hifi/Card.qml +++ b/interface/resources/qml/hifi/Card.qml @@ -46,6 +46,8 @@ Item { property int stackShadowNarrowing: 5; property string defaultThumbnail: Qt.resolvedUrl("../../images/default-domain.gif"); property int shadowHeight: 10; + property bool hovered: false + HifiConstants { id: hifi } function pastTime(timestamp) { // Answer a descriptive string @@ -231,6 +233,13 @@ Item { // to that which is being hovered over. 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; + } MouseArea { anchors.fill: parent; acceptedButtons: Qt.LeftButton; diff --git a/interface/resources/qml/hifi/Feed.qml b/interface/resources/qml/hifi/Feed.qml index 201093ebad..960b62c169 100644 --- a/interface/resources/qml/hifi/Feed.qml +++ b/interface/resources/qml/hifi/Feed.qml @@ -206,9 +206,9 @@ Column { id: scroll; model: suggestions; orientation: ListView.Horizontal; + highlightFollowsCurrentItem: false highlightMoveDuration: -1; highlightMoveVelocity: -1; - highlight: Rectangle { color: "transparent"; border.width: 4; border.color: hifiStyleConstants.colors.primaryHighlight; z: 1; } currentIndex: -1; spacing: 12; @@ -237,6 +237,8 @@ Column { textSizeSmall: root.textSizeSmall; stackShadowNarrowing: root.stackShadowNarrowing; shadowHeight: root.stackedCardShadowHeight; + hoverThunk: function () { hovered = true } + unhoverThunk: function () { hovered = false } } } NumberAnimation {