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()) {
qDebug() << "dynamic switch to layout :: " << m_shouldSwitchToLayout;
emit currentLayoutIsChanging();
if (m_corona->universalSettings()->showInfoWindow()) {
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 {
m_shouldSwitchToLayout = tempShouldSwitch;
m_dynamicSwitchTimer.start();

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

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

Loading…
Cancel
Save