Fix 'hover-to-pause' functionality of AutoScroll Featured Stories list in the goto app

This commit is contained in:
Roxanne Skelly 2018-08-14 15:28:22 -07:00
parent 987d8569ae
commit 5a8da4ce97

View file

@ -141,8 +141,14 @@ Column {
textSizeSmall: root.textSizeSmall;
stackShadowNarrowing: root.stackShadowNarrowing;
shadowHeight: root.stackedCardShadowHeight;
hoverThunk: function () { hovered = true }
unhoverThunk: function () { hovered = false }
hoverThunk: function () {
hovered = true;
autoScrollTimer.stop();
}
unhoverThunk: function () {
hovered = false;
autoScrollTimer.start();
}
}
onCountChanged: {
@ -156,25 +162,7 @@ Column {
onCurrentIndexChanged: {
if (root.autoScrollTimerEnabled) {
autoScrollTimer.interval = suggestions.get(scroll.currentIndex).time_before_autoscroll_ms;
if (!feedMouseArea.containsMouse) {
autoScrollTimer.start();
}
}
}
MouseArea {
id: feedMouseArea;
enabled: root.autoScrollTimerEnabled;
anchors.fill: parent;
hoverEnabled: true;
propagateComposedEvents: true;
onEntered: {
if (autoScrollTimer.running) {
autoScrollTimer.stop();
}
}
onExited: {
autoScrollTimer.restart();
autoScrollTimer.start();
}
}
}