diff --git a/containments/homescreens/folio/folioapplicationfolder.cpp b/containments/homescreens/folio/folioapplicationfolder.cpp index 6ec9fcaf..e597ab76 100644 --- a/containments/homescreens/folio/folioapplicationfolder.cpp +++ b/containments/homescreens/folio/folioapplicationfolder.cpp @@ -282,16 +282,17 @@ QPointF ApplicationFolderModel::getDelegatePosition(int index) return {0, 0}; } auto delegate = m_folder->m_delegates[index]; - qreal pageContentWidth = m_folder->m_homeScreen->homeScreenState()->folderPageContentWidth(); - qreal margin = horizontalPageMargin(); + qreal pageContentSize = m_folder->m_homeScreen->homeScreenState()->folderPageContentWidth(); + qreal topMargin = verticalPageMargin(); + qreal leftMargin = horizontalPageMargin(); - int cellSize = pageContentWidth / numGridLengthOnPage(); + int cellSize = pageContentSize / numGridLengthOnPage(); qreal cellWitdhRecenter = (cellSize - m_folder->m_homeScreen->homeScreenState()->pageCellWidth()) / 2; qreal cellHeightRecenter = (cellSize - m_folder->m_homeScreen->homeScreenState()->pageCellHeight()) / 2; - qreal xPosition = cellWitdhRecenter + margin + delegate.columnIndex * cellSize; - qreal yPosition = cellHeightRecenter + delegate.rowIndex * cellSize; + qreal xPosition = cellWitdhRecenter + leftMargin + delegate.columnIndex * cellSize; + qreal yPosition = cellHeightRecenter + topMargin + delegate.rowIndex * cellSize; return {xPosition, yPosition}; } diff --git a/containments/homescreens/folio/homescreenstate.cpp b/containments/homescreens/folio/homescreenstate.cpp index da1441cb..cdac52ce 100644 --- a/containments/homescreens/folio/homescreenstate.cpp +++ b/containments/homescreens/folio/homescreenstate.cpp @@ -703,8 +703,11 @@ QPointF HomeScreenState::getFolderDelegateScreenPosition(int position) return {0, 0}; } auto pos = m_currentFolder->applications()->getDelegatePosition(position); - qreal x = pos.x() + (m_viewWidth - m_folderPageWidth) / 2; - qreal y = pos.y() + (m_viewHeight - m_folderPageHeight) / 2; + + qreal x = pos.x() + (m_viewWidth - m_viewLeftPadding - m_viewRightPadding - m_folderPageWidth) / 2; + qreal y = pos.y() + (m_viewHeight - m_viewTopPadding - m_viewBottomPadding - m_folderPageHeight) / 2; + x += m_viewLeftPadding; + y += m_viewTopPadding; return {x, y}; } diff --git a/containments/homescreens/folio/package/contents/ui/FolderView.qml b/containments/homescreens/folio/package/contents/ui/FolderView.qml index 53c415eb..2e318c16 100644 --- a/containments/homescreens/folio/package/contents/ui/FolderView.qml +++ b/containments/homescreens/folio/package/contents/ui/FolderView.qml @@ -177,8 +177,8 @@ Folio.DelegateTouchArea { readonly property int cellHeight: folio.HomeScreenState.pageCellHeight readonly property bool outsideView: { - const appPosition = x + folio.HomeScreenState.folderViewX; - return (appPosition < -folderCellSize || appPosition > folderBackground.width) + const appPosition = x + (cellWidth - folderCellSize) / 2 + folio.HomeScreenState.folderViewX; + return (appPosition <= -folderCellSize || appPosition >= folderBackground.width); } readonly property var dragState: folio.HomeScreenState.dragState