From a049f07095ec3865e43f2698112aea1acbd17261 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 5 Nov 2023 09:13:37 -0800 Subject: [PATCH] homescreens/folio: Allow app grid overshoot, and fix app drawer opening state --- containments/homescreens/folio/README.md | 8 ++++---- containments/homescreens/folio/homescreenstate.cpp | 2 +- .../folio/package/contents/ui/AppDrawerGrid.qml | 6 +++--- .../homescreens/folio/package/contents/ui/HomeScreen.qml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/containments/homescreens/folio/README.md b/containments/homescreens/folio/README.md index ae34420c..ff4874f8 100644 --- a/containments/homescreens/folio/README.md +++ b/containments/homescreens/folio/README.md @@ -18,16 +18,16 @@ As such, all of the positioning and placement of delegates on the screen are top - If an app gets uninstalled, the homescreen UI needs to ensure that delegates are updated - BUG: landscape favourites bar duplication when dragging icon from it sometimes - BUG: can't insert delegates in-between very well in landscape favourites bar -- can make the touch area only the icon? +- BUG: drag and drop animation when rejected on a different page +- IMPROVEMENT: can make the touch area only the icon? + - FEATURE: add widget import/export - FEATURE: keyboard navigation - FEATURE: touchpad navigation - FEATURE: option to darken wallpaper - FEATURE: option to turn off row/column swap -- BUG: drag and drop animation when rejected on a different page - - FEATURE: animate homescreen config opening -- RESTORE app drawer overshoot +- RESTORE: app drawer overshoot - PERFORMANCE: ensure that the widget config overlays are in loaders diff --git a/containments/homescreens/folio/homescreenstate.cpp b/containments/homescreens/folio/homescreenstate.cpp index 6be3ed24..a713b8db 100644 --- a/containments/homescreens/folio/homescreenstate.cpp +++ b/containments/homescreens/folio/homescreenstate.cpp @@ -1050,7 +1050,7 @@ void HomeScreenState::determineSwipeTypeAfterThreshold(qreal totalDeltaX, qreal break; case ViewState::AppDrawerView: setSwipeState(SwipeState::SwipingAppDrawerGrid); - cancelAppDrawerAnimations(); + // don't call cancelAppDrawerAnimations(), so we don't have it half open case ViewState::FolderView: case ViewState::SettingsView: // no vertical behaviour in folder or settings view diff --git a/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml b/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml index 2c8d0caa..194e9437 100644 --- a/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml +++ b/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml @@ -34,7 +34,7 @@ MobileShell.GridView { cellWidth: effectiveContentWidth / Math.min(Math.floor(effectiveContentWidth / (Folio.FolioSettings.delegateIconSize + Kirigami.Units.largeSpacing * 3.5)), 8) cellHeight: cellWidth + reservedSpaceForLabel - boundsBehavior: Flickable.StopAtBounds + boundsBehavior: Flickable.DragAndOvershootBounds readonly property int columns: Math.floor(effectiveContentWidth / cellWidth) readonly property int rows: Math.ceil(root.count / columns) @@ -90,8 +90,8 @@ MobileShell.GridView { Folio.HomeScreenState.startDelegateAppDrawerDrag( centerX - Folio.HomeScreenState.pageCellWidth / 2, centerY - Folio.HomeScreenState.pageCellHeight / 2, - delegate.pressPosition.x, - delegate.pressPosition.y, + delegate.pressPosition.x * (Folio.HomeScreenState.pageCellWidth / root.cellWidth), + delegate.pressPosition.y * (Folio.HomeScreenState.pageCellHeight / root.cellHeight), model.delegate.application.storageId ); } diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml index 5914f24c..4c522c30 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml @@ -101,11 +101,11 @@ Item { interactive: root.interactive && settings.homeScreenInteractive && - !appDrawer.flickable.moving && - (appDrawer.flickable.atYBeginning || // disable the swipe area when we are swiping in the app drawer, and not in drag-and-drop + (appDrawer.flickable.contentY <= 10 || // disable the swipe area when we are swiping in the app drawer, and not in drag-and-drop Folio.HomeScreenState.swipeState === Folio.HomeScreenState.AwaitingDraggingDelegate || Folio.HomeScreenState.swipeState === Folio.HomeScreenState.DraggingDelegate || - Folio.HomeScreenState.swipeState === Folio.HomeScreenState.SwipingAppDrawerGrid) + Folio.HomeScreenState.swipeState === Folio.HomeScreenState.SwipingAppDrawerGrid || + Folio.HomeScreenState.viewState !== Folio.HomeScreenState.AppDrawerView) onSwipeStarted: { homeScreenState.swipeStarted();