1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

small improvements

This commit is contained in:
Michail Vourlakos 2020-03-24 20:29:10 +02:00
parent 90d1cedc1e
commit a613bb49ba
2 changed files with 9 additions and 0 deletions

View File

@ -188,6 +188,10 @@ bool GenericLayout::isCurrent() const
bool GenericLayout::isInternalContainment(Plasma::Applet *applet) const
{
if (!applet) {
return false;
}
for (const auto containment : m_containments) {
Plasma::Applet *parentApplet = qobject_cast<Plasma::Applet *>(containment->parent());
if (parentApplet && parentApplet == applet) {
@ -200,6 +204,10 @@ bool GenericLayout::isInternalContainment(Plasma::Applet *applet) const
Plasma::Containment *GenericLayout::internalContainmentOf(Plasma::Applet *applet) const
{
if (!applet) {
return nullptr;
}
if (isInternalContainment(applet)) {
for (const auto containment : m_containments) {
Plasma::Applet *parentApplet = qobject_cast<Plasma::Applet *>(containment->parent());

View File

@ -141,6 +141,7 @@ bool ContextMenu::mousePressEvent(QMouseEvent *event)
if (ai && ai->isVisible() && appletContainsMouse) {
applet = ai->applet();
if (m_latteView && m_latteView->layout() && m_latteView->layout()->isInternalContainment(applet)) {
Plasma::Containment *internalC = m_latteView->layout()->internalContainmentOf(applet);