Fix Goto app clicks not working

Includes better card highlighting fix.
This commit is contained in:
David Rowe 2018-11-14 15:27:18 +13:00
parent 7ffba9d987
commit 010f7121a3
2 changed files with 11 additions and 13 deletions

View file

@ -49,7 +49,6 @@ 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 }
@ -238,7 +237,7 @@ Item {
property var unhoverThunk: function () { };
Rectangle {
anchors.fill: parent
visible: root.hovered && !root.scrolling
visible: root.hovered
color: "transparent"
border.width: 4
border.color: hifiStyleConstants.colors.primaryHighlight
@ -252,17 +251,17 @@ Item {
goFunction("hifi://" + hifiUrl);
}
hoverEnabled: true;
onEntered: {
Tablet.playSound(TabletEnums.ButtonHover);
hoverThunk();
onContainsMouseChanged: {
// Use onContainsMouseChanged rather than onEntered and onExited because the latter aren't always
// triggered correctly - e.g., if drag rightwards from right hand side of a card to the next card
// onExited doesn't fire, in which case can end up with two cards highlighted.
if (containsMouse) {
Tablet.playSound(TabletEnums.ButtonHover);
hoverThunk();
} else {
unhoverThunk();
}
}
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;

View file

@ -141,7 +141,6 @@ Column {
textSizeSmall: root.textSizeSmall;
stackShadowNarrowing: root.stackShadowNarrowing;
shadowHeight: root.stackedCardShadowHeight;
scrolling: scroll.moving
hoverThunk: function () {
hovered = true;