Shared Views have highest priority

--Shared views can be positioned to all free edges
including those occupied by Central layouts and the
Central layouts update their views accordingly
pull/5/head
Michail Vourlakos 6 years ago
parent c6cd3f4685
commit 24e25944db

@ -230,6 +230,9 @@ void CentralLayout::setSharedLayout(SharedLayout *layout)
m_sharedConnections << connect(m_sharedLayout, &Layout::AbstractLayout::nameChanged, this, [this]() {
setSharedLayoutName(m_sharedLayout->name());
});
m_sharedConnections << connect(m_sharedLayout, &Layout::GenericLayout::viewEdgeChanged, this, [this]() {
syncLatteViewsToScreens();
});
} else {
setSharedLayoutName(QString());
}

@ -564,6 +564,7 @@ void GenericLayout::containmentDestroyed(QObject *cont)
view->deleteLater();
emit viewEdgeChanged();
emit viewsCountChanged();
}
}
@ -588,6 +589,7 @@ void GenericLayout::destroyedChanged(bool destroyed)
m_latteViews[sender] = m_waitingLatteViews.take(static_cast<Plasma::Containment *>(sender));
}
emit viewEdgeChanged();
emit viewsCountChanged();
}
@ -616,6 +618,7 @@ void GenericLayout::addNewView()
}
m_corona->addViewForLayout(name());
emit viewEdgeChanged();
}
void GenericLayout::addView(Plasma::Containment *containment, bool forceOnPrimary, int explicitScreen, Layout::ViewsMap *occupied)

@ -189,20 +189,20 @@ int SharedLayout::viewsCount() const
QList<Plasma::Types::Location> SharedLayout::availableEdgesForView(QScreen *scr, Latte::View *forView) const
{
using Plasma::Types;
/* using Plasma::Types;
QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge,
Types::TopEdge, Types::RightEdge};
if (!m_corona) {
return edges;
}
}*/
return Layout::GenericLayout::availableEdgesForView(scr, forView);
}
QList<Plasma::Types::Location> SharedLayout::freeEdges(QScreen *scr) const
{
using Plasma::Types;
/* using Plasma::Types;
QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge,
Types::TopEdge, Types::RightEdge};
@ -214,14 +214,14 @@ QList<Plasma::Types::Location> SharedLayout::freeEdges(QScreen *scr) const
if (current) {
return current->freeEdges(scr);
}
}*/
return Layout::GenericLayout::freeEdges(scr);
}
QList<Plasma::Types::Location> SharedLayout::freeEdges(int screen) const
{
using Plasma::Types;
/* using Plasma::Types;
QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge,
Types::TopEdge, Types::RightEdge};
@ -233,7 +233,7 @@ QList<Plasma::Types::Location> SharedLayout::freeEdges(int screen) const
if (current) {
return current->freeEdges(screen);
}
}*/
return Layout::GenericLayout::freeEdges(screen);
}

Loading…
Cancel
Save