From e5cb775830c5beec0c98b977d5843eac1414f11e Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Fri, 5 Dec 2025 11:51:41 -0500 Subject: [PATCH] folio: Fix some state transitions Fixes some potential state problems when transitioning to the app drawer. --- containments/homescreens/folio/homescreenstate.cpp | 12 +++++++++--- .../homescreens/folio/qml/FolioHomeScreen.qml | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/containments/homescreens/folio/homescreenstate.cpp b/containments/homescreens/folio/homescreenstate.cpp index dc708f4d..ed78538c 100644 --- a/containments/homescreens/folio/homescreenstate.cpp +++ b/containments/homescreens/folio/homescreenstate.cpp @@ -73,7 +73,9 @@ void HomeScreenState::init() m_closeSearchWidgetAnim = setupAnimation("searchWidgetY", animDuration, QEasingCurve::OutExpo, SEARCH_WIDGET_OPEN_DIST); connect(m_closeSearchWidgetAnim, &QPropertyAnimation::finished, this, [this]() { - setViewState(ViewState::PageView); + if (m_viewState == ViewState::SearchWidgetView) { + setViewState(ViewState::PageView); + } }); m_pageAnim = setupAnimation("pageViewX", animDuration, QEasingCurve::OutExpo, 0); @@ -87,7 +89,9 @@ void HomeScreenState::init() m_closeFolderAnim = setupAnimation("folderOpenProgress", animDuration, QEasingCurve::OutExpo, 0.0); connect(m_closeFolderAnim, &QPropertyAnimation::finished, this, [this]() { - setViewState(ViewState::PageView); + if (m_viewState == ViewState::FolderView) { + setViewState(ViewState::PageView); + } setCurrentFolder(nullptr); setFolderViewX(0); // reset to first page m_folderPageNum = 0; @@ -107,7 +111,9 @@ void HomeScreenState::init() m_closeSettingsAnim = setupAnimation("settingsOpenProgress", animDuration, QEasingCurve::InOutExpo, 0.0); connect(m_closeSettingsAnim, &QPropertyAnimation::finished, this, [this]() { - setViewState(ViewState::PageView); + if (m_viewState == ViewState::SettingsView) { + setViewState(ViewState::PageView); + } }); connect(this, &HomeScreenState::viewWidthChanged, this, [this]() { diff --git a/containments/homescreens/folio/qml/FolioHomeScreen.qml b/containments/homescreens/folio/qml/FolioHomeScreen.qml index ff09dc4f..de3c6c2c 100644 --- a/containments/homescreens/folio/qml/FolioHomeScreen.qml +++ b/containments/homescreens/folio/qml/FolioHomeScreen.qml @@ -124,7 +124,9 @@ Item { interactive: root.interactive && settingsLoader.homeScreenInteractive && - (appDrawer.flickable.contentY <= 10 || // disable the swipe area when we are swiping in the app drawer, and not in drag-and-drop + (appDrawer.flickable.atYBeginning || // there are cases where contentY > 0 but atYBeginning is true + 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 ||