|
|
@ -52,7 +52,7 @@ VisibilityManagerPrivate::VisibilityManagerPrivate(PlasmaQuick::ContainmentView
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
connect(&timerHide, &QTimer::timeout, this, [this]() {
|
|
|
|
connect(&timerHide, &QTimer::timeout, this, [this]() {
|
|
|
|
if (!blockHiding && !isHidden) {
|
|
|
|
if (!blockHiding && !isHidden && !dragEnter) {
|
|
|
|
qDebug() << "must be hide";
|
|
|
|
qDebug() << "must be hide";
|
|
|
|
emit this->q->mustBeHide();
|
|
|
|
emit this->q->mustBeHide();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -212,7 +212,7 @@ inline void VisibilityManagerPrivate::raiseDock(bool raise)
|
|
|
|
if (!timerShow.isActive()) {
|
|
|
|
if (!timerShow.isActive()) {
|
|
|
|
timerShow.start();
|
|
|
|
timerShow.start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (!blockHiding) {
|
|
|
|
} else if (!blockHiding && !dragEnter) {
|
|
|
|
timerShow.stop();
|
|
|
|
timerShow.stop();
|
|
|
|
|
|
|
|
|
|
|
|
if (!timerHide.isActive())
|
|
|
|
if (!timerHide.isActive())
|
|
|
@ -222,9 +222,12 @@ inline void VisibilityManagerPrivate::raiseDock(bool raise)
|
|
|
|
|
|
|
|
|
|
|
|
void VisibilityManagerPrivate::updateHiddenState()
|
|
|
|
void VisibilityManagerPrivate::updateHiddenState()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (dragEnter)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
switch (mode) {
|
|
|
|
switch (mode) {
|
|
|
|
case Dock::AutoHide:
|
|
|
|
case Dock::AutoHide:
|
|
|
|
raiseDock(false);
|
|
|
|
raiseDock(containsMouse);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case Dock::DodgeActive:
|
|
|
|
case Dock::DodgeActive:
|
|
|
@ -365,21 +368,43 @@ inline void VisibilityManagerPrivate::restoreConfig()
|
|
|
|
|
|
|
|
|
|
|
|
bool VisibilityManagerPrivate::event(QEvent *ev)
|
|
|
|
bool VisibilityManagerPrivate::event(QEvent *ev)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (ev->type() == QEvent::Enter && !containsMouse) {
|
|
|
|
switch (ev->type()) {
|
|
|
|
|
|
|
|
case QEvent::Enter:
|
|
|
|
|
|
|
|
if (containsMouse)
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
containsMouse = true;
|
|
|
|
containsMouse = true;
|
|
|
|
emit q->containsMouseChanged();
|
|
|
|
emit q->containsMouseChanged();
|
|
|
|
|
|
|
|
|
|
|
|
if (mode != Dock::AlwaysVisible)
|
|
|
|
if (mode != Dock::AlwaysVisible)
|
|
|
|
raiseDock(true);
|
|
|
|
raiseDock(true);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (ev->type() == QEvent::Leave && containsMouse) {
|
|
|
|
break;
|
|
|
|
|
|
|
|
case QEvent::Leave:
|
|
|
|
|
|
|
|
if (!containsMouse)
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
containsMouse = false;
|
|
|
|
containsMouse = false;
|
|
|
|
emit q->containsMouseChanged();
|
|
|
|
emit q->containsMouseChanged();
|
|
|
|
|
|
|
|
updateHiddenState();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case QEvent::DragEnter:
|
|
|
|
|
|
|
|
dragEnter = true;
|
|
|
|
|
|
|
|
emit q->mustBeShown();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case QEvent::DragLeave:
|
|
|
|
|
|
|
|
case QEvent::Drop:
|
|
|
|
|
|
|
|
dragEnter = false;
|
|
|
|
updateHiddenState();
|
|
|
|
updateHiddenState();
|
|
|
|
} else if (ev->type() == QEvent::Show) {
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case QEvent::Show:
|
|
|
|
wm->setDockDefaultFlags();
|
|
|
|
wm->setDockDefaultFlags();
|
|
|
|
restoreConfig();
|
|
|
|
restoreConfig();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return QObject::event(ev);
|
|
|
|
return QObject::event(ev);
|
|
|
|