hide docks animation when changing layouts

pull/2/head
Michail Vourlakos 7 years ago
parent 0a73d146c4
commit afcdd1b726

@ -236,16 +236,15 @@ void LayoutManager::confirmDynamicSwitch()
if (m_shouldSwitchToLayout == tempShouldSwitch && m_shouldSwitchToLayout != currentLayoutName()) { if (m_shouldSwitchToLayout == tempShouldSwitch && m_shouldSwitchToLayout != currentLayoutName()) {
qDebug() << "dynamic switch to layout :: " << m_shouldSwitchToLayout; qDebug() << "dynamic switch to layout :: " << m_shouldSwitchToLayout;
emit currentLayoutIsChanging();
if (m_corona->universalSettings()->showInfoWindow()) { if (m_corona->universalSettings()->showInfoWindow()) {
showInfoWindow(i18n("Switching to layout <b>%0</b> ...").arg(m_shouldSwitchToLayout), 4000); showInfoWindow(i18n("Switching to layout <b>%0</b> ...").arg(m_shouldSwitchToLayout), 4000);
QTimer::singleShot(500, [this, tempShouldSwitch]() {
switchToLayout(tempShouldSwitch);
});
} else {
switchToLayout(m_shouldSwitchToLayout);
} }
QTimer::singleShot(500, [this, tempShouldSwitch]() {
switchToLayout(tempShouldSwitch);
});
} else { } else {
m_shouldSwitchToLayout = tempShouldSwitch; m_shouldSwitchToLayout = tempShouldSwitch;
m_dynamicSwitchTimer.start(); m_dynamicSwitchTimer.start();

@ -97,6 +97,7 @@ signals:
void addWidgetsActionChanged(); void addWidgetsActionChanged();
void currentLayoutChanged(); void currentLayoutChanged();
void currentLayoutNameChanged(); void currentLayoutNameChanged();
void currentLayoutIsChanging();
void launchersSignalsChanged(); void launchersSignalsChanged();
void layoutsChanged(); void layoutsChanged();
void menuLayoutsChanged(); void menuLayoutsChanged();

@ -36,6 +36,7 @@ Item{
property bool debugMagager: Qt.application.arguments.indexOf("--mask") >= 0 property bool debugMagager: Qt.application.arguments.indexOf("--mask") >= 0
property bool blockUpdateMask: false 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 inStartup: root.inStartup
property bool normalState : false // this is being set from updateMaskArea property bool normalState : false // this is being set from updateMaskArea
property bool previousNormalState : false // this is only for debugging purposes property bool previousNormalState : false // this is only for debugging purposes
@ -153,6 +154,16 @@ Item{
onPanelMarginChanged: updateMaskArea(); onPanelMarginChanged: updateMaskArea();
} }
Connections{
target: universalLayoutManager
onCurrentLayoutIsChanging: {
manager.inTempHiding = true;
manager.inForceHiding = true;
root.clearZoom();
manager.slotMustBeHide();
}
}
onInStartupChanged: { onInStartupChanged: {
if (!inStartup) { if (!inStartup) {
delayAnimationTimer.start(); delayAnimationTimer.start();
@ -176,15 +187,15 @@ Item{
function slotMustBeShown() { function slotMustBeShown() {
// console.log("show..."); // console.log("show...");
if (!slidingAnimationAutoHiddenIn.running && !inTempHiding){ if (!slidingAnimationAutoHiddenIn.running && !inTempHiding && !inForceHiding){
slidingAnimationAutoHiddenIn.init(); slidingAnimationAutoHiddenIn.init();
} }
} }
function slotMustBeHide() { function slotMustBeHide() {
// console.log("hide...."); // console.log("hide....");
if(!slidingAnimationAutoHiddenOut.running && !dock.visibility.blockHiding if((!slidingAnimationAutoHiddenOut.running && !dock.visibility.blockHiding
&& !dock.visibility.containsMouse) { && !dock.visibility.containsMouse) || inForceHiding) {
slidingAnimationAutoHiddenOut.init(); slidingAnimationAutoHiddenOut.init();
} }
} }

Loading…
Cancel
Save