mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 05:21:11 +02:00
Merge pull request #14395 from ctrlaltdavid/M19859
Fix Goto app clicks not working
This commit is contained in:
commit
c72dd3d690
2 changed files with 22 additions and 17 deletions
|
@ -49,7 +49,6 @@ Item {
|
||||||
property string defaultThumbnail: Qt.resolvedUrl("../../images/default-domain.gif");
|
property string defaultThumbnail: Qt.resolvedUrl("../../images/default-domain.gif");
|
||||||
property int shadowHeight: 10;
|
property int shadowHeight: 10;
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
property bool scrolling: false
|
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
@ -238,31 +237,38 @@ Item {
|
||||||
property var unhoverThunk: function () { };
|
property var unhoverThunk: function () { };
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: root.hovered && !root.scrolling
|
visible: root.hovered
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
border.width: 4
|
border.width: 4
|
||||||
border.color: hifiStyleConstants.colors.primaryHighlight
|
border.color: hifiStyleConstants.colors.primaryHighlight
|
||||||
z: 1
|
z: 1
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton;
|
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: {
|
onClicked: {
|
||||||
Tablet.playSound(TabletEnums.ButtonClick);
|
Tablet.playSound(TabletEnums.ButtonClick);
|
||||||
goFunction("hifi://" + hifiUrl);
|
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 {
|
StateImage {
|
||||||
id: actionIcon;
|
id: actionIcon;
|
||||||
|
|
|
@ -141,7 +141,6 @@ Column {
|
||||||
textSizeSmall: root.textSizeSmall;
|
textSizeSmall: root.textSizeSmall;
|
||||||
stackShadowNarrowing: root.stackShadowNarrowing;
|
stackShadowNarrowing: root.stackShadowNarrowing;
|
||||||
shadowHeight: root.stackedCardShadowHeight;
|
shadowHeight: root.stackedCardShadowHeight;
|
||||||
scrolling: scroll.moving
|
|
||||||
|
|
||||||
hoverThunk: function () {
|
hoverThunk: function () {
|
||||||
hovered = true;
|
hovered = true;
|
||||||
|
|
Loading…
Reference in a new issue