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:
parent
90d1cedc1e
commit
a613bb49ba
@ -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());
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user