homescreen/folio: Fix folder apps still being Interactable when outside current page

This fixes an issue where apps in the folder can still be interacted with when outside the current page.
This commit is contained in:
Micah Stanley 2024-11-10 00:05:10 +00:00 committed by Devin Lin
parent f52bf0bd71
commit ca7b79e0b7

View file

@ -176,6 +176,11 @@ Folio.DelegateTouchArea {
readonly property int cellWidth: folio.HomeScreenState.pageCellWidth
readonly property int cellHeight: folio.HomeScreenState.pageCellHeight
readonly property bool outsideView: {
const appPosition = x + folio.HomeScreenState.folderViewX;
return (appPosition < -folderCellSize || appPosition > folderBackground.width)
}
readonly property var dragState: folio.HomeScreenState.dragState
readonly property bool isDropPositionThis: dragState.candidateDropPosition.location === Folio.DelegateDragPosition.Folder &&
dragState.candidateDropPosition.folderPosition === index
@ -235,6 +240,7 @@ Folio.DelegateTouchArea {
// do not show if the drop animation is running to this delegate
visible: !(root.homeScreen.dropAnimationRunning && delegate.isDropPositionThis)
enabled: !delegate.outsideView
// don't show label in drag and drop mode
labelOpacity: delegate.opacity