From a452bc30306d30b4126ad13c63b74c452d9b2866 Mon Sep 17 00:00:00 2001 From: Micah Stanley Date: Thu, 24 Apr 2025 13:42:16 +0000 Subject: [PATCH] Folio: Settings Component Bugfix Fixes a bug where if one presses and holds the home screen to bring up the settings component, then swipes up to access the application drawer while the settings component open animation is playing, both the drawer and settings component will be visible on screen at the same time. Fixing this was achieved by setting swipe state back to none whenever the settings component is opening and a onSwipeMove event happens. Video of the bug. ![Screencast_20250423_151033](/uploads/7f4f04617c42d5898322a8fa5ef306b8/Screencast_20250423_151033.webm) --- containments/homescreens/folio/homescreenstate.cpp | 5 +++++ containments/homescreens/folio/homescreenstate.h | 1 + .../homescreens/folio/package/contents/ui/HomeScreen.qml | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/containments/homescreens/folio/homescreenstate.cpp b/containments/homescreens/folio/homescreenstate.cpp index ab84c058..9c09daa9 100644 --- a/containments/homescreens/folio/homescreenstate.cpp +++ b/containments/homescreens/folio/homescreenstate.cpp @@ -971,6 +971,11 @@ void HomeScreenState::swipeEnded() setSwipeState(SwipeState::None); } +void HomeScreenState::swipeCancelled() +{ + setSwipeState(SwipeState::None); +} + void HomeScreenState::swipeMoved(qreal totalDeltaX, qreal totalDeltaY, qreal deltaX, qreal deltaY) { m_movingUp = deltaY > 0; diff --git a/containments/homescreens/folio/homescreenstate.h b/containments/homescreens/folio/homescreenstate.h index 9614ba8c..40053f36 100644 --- a/containments/homescreens/folio/homescreenstate.h +++ b/containments/homescreens/folio/homescreenstate.h @@ -341,6 +341,7 @@ public Q_SLOTS: // from SwipeArea void swipeStarted(qreal deltaX, qreal deltaY); void swipeEnded(); + void swipeCancelled(); void swipeMoved(qreal totalDeltaX, qreal totalDeltaY, qreal deltaX, qreal deltaY); private: diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml index 215307cf..e03f5d5f 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml @@ -121,6 +121,11 @@ Item { homeScreenState.swipeEnded(); } onSwipeMove: (totalDeltaX, totalDeltaY, deltaX, deltaY) => { + // cancel swipe when settings component is opening to prevent conflicts + if (folio.HomeScreenState.settingsOpenProgress && folio.HomeScreenState.viewState !== Folio.HomeScreenState.SettingsView) { + homeScreenState.swipeCancelled(); + return; + } homeScreenState.swipeMoved(totalDeltaX, totalDeltaY, deltaX, deltaY); }