@@ -478,27 +478,55 @@ Rectangle {
478 anchors.fill: appContainer
478 anchors.fill: appContainer
479 propagateComposedEvents: true
479 propagateComposedEvents: true
480 hoverEnabled: true
480 hoverEnabled: true
482+ property int scrollAreaWidth: root.width / 3
483+ property bool progressiveScrollingEnabled: false
481 onMouseXChanged: {
485 onMouseXChanged: {
482 mouse.accepted = false
486 mouse.accepted = false
488+ // Find the howered item and mark it active
483 var mapped = mapToItem(appContainer, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
489 var mapped = mapToItem(appContainer, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
484 var itemUnder = appContainer.childAt(mapped.x, mapped.y)
490 var itemUnder = appContainer.childAt(mapped.x, mapped.y)
485 if (itemUnder) {
491 if (itemUnder) {
486 mapped = mapToItem(itemUnder, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
492 mapped = mapToItem(itemUnder, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
487 var delegateChild = itemUnder.childAt(mapped.x, mapped.y)
493 var delegateChild = itemUnder.childAt(mapped.x, mapped.y)
494+ print("delegateChild", delegateChild)
488− if (delegateChild.objectName === "decoratedWindow") {
495+ if (delegateChild.objectName === "decoratedWindow" || delegateChild.objectName === "tileInfo") {
489 appRepeater.highlightedIndex = appRepeater.indexOf(itemUnder)
496 appRepeater.highlightedIndex = appRepeater.indexOf(itemUnder)
500+ var margins = spreadFlickable.width * 0.05;
502+ if (!progressiveScrollingEnabled && mouseX < spreadFlickable.width - scrollAreaWidth) {
503+ progressiveScrollingEnabled = true
506+ // do we need to scroll?
507+ if (mouseX < scrollAreaWidth) {
508+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
509+ var contentX = (1 - progress) * (spreadFlickable.contentWidth - spreadFlickable.width)
510+ spreadFlickable.contentX = Math.max(0, Math.min(spreadFlickable.contentX, contentX))
512+ if (mouseX > spreadFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
513+ var progress = Math.min(1, (mouseX - (spreadFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
514+ var contentX = progress * (spreadFlickable.contentWidth - spreadFlickable.width)
515+ spreadFlickable.contentX = Math.min(spreadFlickable.contentWidth - spreadFlickable.width, Math.max(spreadFlickable.contentX, contentX))
493 onPressed: mouse.accepted = false
518 onPressed: mouse.accepted = false
496 FloatingFlickable {
521 FloatingFlickable {
497 id: spreadFlickable
522 id: spreadFlickable
523+ objectName: "spreadFlickable"
498 anchors.fill: parent
524 anchors.fill: parent
499 contentWidth: Math.max(6, ApplicationManager.count) * Math.min(height / 4, width / 5)
525 contentWidth: Math.max(6, ApplicationManager.count) * Math.min(height / 4, width / 5)
500 enabled: false
526 enabled: false
528+ onContentXChanged: print("cx", contentX)
502 function snapTo(contentX) {
530 function snapTo(contentX) {
503 snapAnimation.stop();
531 snapAnimation.stop();
504 snapAnimation.to = contentX
532 snapAnimation.to = contentX
@@ -623,6 +651,7 @@ Rectangle {
623 from: "*"
651 from: "*"
624 to: "altTab"
652 to: "altTab"
625 SequentialAnimation {
653 SequentialAnimation {
654+ PropertyAction { target: hoverMouseArea; property: "progressiveScrollingEnabled"; value: false }
626 PropertyAction { target: appRepeater; property: "highlightedIndex"; value: Math.min(ApplicationManager.count - 1, 1) }
655 PropertyAction { target: appRepeater; property: "highlightedIndex"; value: Math.min(ApplicationManager.count - 1, 1) }
627 PauseAnimation { duration: 50 }
656 PauseAnimation { duration: 50 }
628 PropertyAction { target: workspaceSelector; property: "visible" }
657 PropertyAction { target: workspaceSelector; property: "visible" }