mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
folio: Fix some state transitions
Fixes some potential state problems when transitioning to the app drawer.
This commit is contained in:
parent
e480114d53
commit
e5cb775830
2 changed files with 12 additions and 4 deletions
|
|
@ -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]() {
|
||||
|
|
|
|||
|
|
@ -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 ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue