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)
This commit is contained in:
Micah Stanley 2025-04-24 13:42:16 +00:00
parent 9c2e2c7db3
commit a452bc3030
3 changed files with 11 additions and 0 deletions

View file

@ -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;

View file

@ -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:

View file

@ -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);
}