smooth slide-in/out after startup and view removal

work/spdx
Michail Vourlakos 4 years ago
parent f68aac0501
commit 8c23f267ed

@ -758,7 +758,7 @@ void GenericLayout::containmentDestroyed(QObject *cont)
if (view) {
view->disconnectSensitiveSignals();
view->positioner()->hideOnExit();
view->positioner()->hideOnExit(containment->location());
view->deleteLater();
emit viewEdgeChanged();

@ -294,11 +294,15 @@ QString Positioner::currentScreenName() const
return m_screenNameToFollow;
}
void Positioner::hideOnExit()
void Positioner::hideOnExit(Plasma::Types::Location location)
{
auto slideLocation = WindowSystem::AbstractWindowInterface::Slide::None;
switch (m_view->containment()->location()) {
if (location == Plasma::Types::Floating && m_view->containment()) {
location = m_view->containment()->location();
}
switch (location) {
case Plasma::Types::TopEdge:
slideLocation = WindowSystem::AbstractWindowInterface::Slide::Top;
break;
@ -324,6 +328,12 @@ void Positioner::hideOnExit()
m_view->setVisible(false);
}
void Positioner::showInStartup()
{
hideOnExit();
m_view->setVisible(true);
}
void Positioner::onCurrentLayoutIsSwitching(const QString &layoutName)
{
if (!m_view || !m_view->layout() || m_view->layout()->name() != layoutName || !m_view->isVisible()) {

@ -108,7 +108,8 @@ public slots:
//! that might prevent them. It must be called with care.
void immediateSyncGeometry();
void hideOnExit();
void showInStartup();
void hideOnExit(Plasma::Types::Location location = Plasma::Types::Floating);
void initDelayedSignals();
void updateWaylandId();

@ -83,7 +83,9 @@ View::View(Plasma::Corona *corona, QScreen *targetScreen, bool byPassWM)
m_interface(new ViewPart::ContainmentInterface(this)),
m_parabolic(new ViewPart::Parabolic(this)),
m_sink(new ViewPart::EventsSink(this))
{
{
setVisible(false);
//! needs to be created after Effects because it catches some of its signals
//! and avoid a crash from View::winId() at the same time
m_positioner = new ViewPart::Positioner(this);
@ -177,6 +179,10 @@ View::View(Plasma::Corona *corona, QScreen *targetScreen, bool byPassWM)
if (m_positioner) {
//! immediateSyncGeometry helps avoiding binding loops from containment qml side
m_positioner->immediateSyncGeometry();
if (m_inStartup) {
m_inStartup = false;
m_positioner->showInStartup();
}
}
connect(this->containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus)));

@ -401,6 +401,7 @@ private:
bool m_containsDrag{false};
bool m_containsMouse{false};
bool m_inDelete{false};
bool m_inStartup{true};
bool m_isPreferredForShortcuts{false};
bool m_onPrimary{true};
bool m_screenEdgeMarginEnabled{false};

Loading…
Cancel
Save