Merge pull request #14395 from ctrlaltdavid/M19859

Fix Goto app clicks not working
This commit is contained in:
Jeff Clinton 2018-11-15 09:56:56 -08:00 committed by GitHub
commit c72dd3d690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 17 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,31 +237,38 @@ 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
z: 1
}
MouseArea {
anchors.fill: parent;
acceptedButtons: Qt.LeftButton;
anchors.fill: parent
acceptedButtons: Qt.LeftButton
hoverEnabled: true
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();
}
}
}
MouseArea {
// Separate MouseArea for click handling so that it doesn't interfere with hovering and interaction
// with containing ListView.
anchors.fill: parent
acceptedButtons: Qt.LeftButton
hoverEnabled: false
onClicked: {
Tablet.playSound(TabletEnums.ButtonClick);
goFunction("hifi://" + hifiUrl);
}
hoverEnabled: true;
onEntered: {
Tablet.playSound(TabletEnums.ButtonHover);
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;

View file

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