better detection if we are on the fav strip

This commit is contained in:
Marco Martin 2015-04-11 10:28:05 +02:00
parent fa2d6b0258
commit f9b30c1f95

View file

@ -116,7 +116,7 @@ MouseEventListener {
property bool scrollDown: true property bool scrollDown: true
repeat: true repeat: true
interval: 10 interval: 10
onTriggered: { onTriggered: {return;
applicationsView.contentY += scrollDown ? 8 : -8; applicationsView.contentY += scrollDown ? 8 : -8;
if (applicationsView.dragData) { if (applicationsView.dragData) {
dragDelegate.updateRow(); dragDelegate.updateRow();
@ -188,15 +188,19 @@ MouseEventListener {
if (!autoScrollTimer.running) { if (!autoScrollTimer.running) {
var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y);
if (mouse.y < root.height / 4) { //FAVORITES
if (applicationsView.headerItem.favoritesStrip.contains(pos)) {
autoScrollTimer.running = false; autoScrollTimer.running = false;
//SCROLL UP
} else if (applicationsView.contentY > 0 && mouse.y < root.buttonHeight + root.height / 4) { } else if (applicationsView.contentY > 0 && mouse.y < root.buttonHeight + root.height / 4) {
autoScrollTimer.scrollDown = false; autoScrollTimer.scrollDown = false;
autoScrollTimer.running = true; autoScrollTimer.running = true;
//SCROLL DOWN
} else if (!applicationsView.atYEnd && mouse.y > 3 * (root.height / 4)) { } else if (!applicationsView.atYEnd && mouse.y > 3 * (root.height / 4)) {
autoScrollTimer.scrollDown = true; autoScrollTimer.scrollDown = true;
autoScrollTimer.running = true; autoScrollTimer.running = true;
//DON't SCROLL
} else { } else {
autoScrollTimer.running = false; autoScrollTimer.running = false;
} }