From afcdd1b726a08307b5d328eb96164fa0ceb92988 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 3 Jan 2018 21:02:16 +0200 Subject: [PATCH] hide docks animation when changing layouts --- app/layoutmanager.cpp | 11 +++++------ app/layoutmanager.h | 1 + .../package/contents/ui/VisibilityManager.qml | 17 ++++++++++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/app/layoutmanager.cpp b/app/layoutmanager.cpp index b47965f89..235ccc7cb 100644 --- a/app/layoutmanager.cpp +++ b/app/layoutmanager.cpp @@ -236,16 +236,15 @@ void LayoutManager::confirmDynamicSwitch() if (m_shouldSwitchToLayout == tempShouldSwitch && m_shouldSwitchToLayout != currentLayoutName()) { qDebug() << "dynamic switch to layout :: " << m_shouldSwitchToLayout; + emit currentLayoutIsChanging(); + if (m_corona->universalSettings()->showInfoWindow()) { showInfoWindow(i18n("Switching to layout %0 ...").arg(m_shouldSwitchToLayout), 4000); - - QTimer::singleShot(500, [this, tempShouldSwitch]() { - switchToLayout(tempShouldSwitch); - }); - } else { - switchToLayout(m_shouldSwitchToLayout); } + QTimer::singleShot(500, [this, tempShouldSwitch]() { + switchToLayout(tempShouldSwitch); + }); } else { m_shouldSwitchToLayout = tempShouldSwitch; m_dynamicSwitchTimer.start(); diff --git a/app/layoutmanager.h b/app/layoutmanager.h index 22a97b669..c41ce2596 100644 --- a/app/layoutmanager.h +++ b/app/layoutmanager.h @@ -97,6 +97,7 @@ signals: void addWidgetsActionChanged(); void currentLayoutChanged(); void currentLayoutNameChanged(); + void currentLayoutIsChanging(); void launchersSignalsChanged(); void layoutsChanged(); void menuLayoutsChanged(); diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 6850a4681..48a4bef9f 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -36,6 +36,7 @@ Item{ property bool debugMagager: Qt.application.arguments.indexOf("--mask") >= 0 property bool blockUpdateMask: false + property bool inForceHiding: false //is used when the docks are forced in hiding e.g. when changing layouts property bool inStartup: root.inStartup property bool normalState : false // this is being set from updateMaskArea property bool previousNormalState : false // this is only for debugging purposes @@ -153,6 +154,16 @@ Item{ onPanelMarginChanged: updateMaskArea(); } + Connections{ + target: universalLayoutManager + onCurrentLayoutIsChanging: { + manager.inTempHiding = true; + manager.inForceHiding = true; + root.clearZoom(); + manager.slotMustBeHide(); + } + } + onInStartupChanged: { if (!inStartup) { delayAnimationTimer.start(); @@ -176,15 +187,15 @@ Item{ function slotMustBeShown() { // console.log("show..."); - if (!slidingAnimationAutoHiddenIn.running && !inTempHiding){ + if (!slidingAnimationAutoHiddenIn.running && !inTempHiding && !inForceHiding){ slidingAnimationAutoHiddenIn.init(); } } function slotMustBeHide() { // console.log("hide...."); - if(!slidingAnimationAutoHiddenOut.running && !dock.visibility.blockHiding - && !dock.visibility.containsMouse) { + if((!slidingAnimationAutoHiddenOut.running && !dock.visibility.blockHiding + && !dock.visibility.containsMouse) || inForceHiding) { slidingAnimationAutoHiddenOut.init(); } }