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

activate through mouse wheel more applets

--when an applet is not identified as expandable
but on the other hand has activated the flag
activationTogglesExpanded then for those
applets the mouse wheel option should also
trigger an activation event
This commit is contained in:
Michail Vourlakos 2021-10-15 01:38:24 +03:00
parent 59360176ee
commit c9515a0353
3 changed files with 27 additions and 1 deletions

View File

@ -449,6 +449,29 @@ bool ContainmentInterface::appletIsExpandable(PlasmaQuick::AppletQuickItem *appl
|| Latte::Layouts::Storage::self()->isSubContainment(m_view->layout(), appletQuickItem->applet()));
}
bool ContainmentInterface::appletIsActivationTogglesExpanded(const int id) const
{
if (!m_view->containment() || !m_view->inReadyState()) {
return false;
}
for (const auto applet : m_view->containment()->applets()) {
if (applet && applet->id() == (uint)id) {
if (Layouts::Storage::self()->isSubContainment(m_view->layout(), applet)) {
return true;
}
PlasmaQuick::AppletQuickItem *ai = applet->property("_plasma_graphicObject").value<PlasmaQuick::AppletQuickItem *>();
if (ai) {
return ai->isActivationTogglesExpanded();
}
}
}
return false;
}
bool ContainmentInterface::hasExpandedApplet() const
{
return m_expandedAppletIds.count() > 0;

View File

@ -82,6 +82,7 @@ public slots:
Q_INVOKABLE bool appletIsExpandable(const int id) const;
Q_INVOKABLE bool appletIsExpanded(const int id) const;
Q_INVOKABLE bool appletIsActivationTogglesExpanded(const int id) const;
Q_INVOKABLE bool isApplication(const QUrl &url) const;

View File

@ -660,7 +660,9 @@ Item {
blockWheel = true;
scrollDelayer.start();
if (appletItem.containsPos(pos) && root.latteView.extendedInterface.appletIsExpandable(applet.id)) {
if (appletItem.containsPos(pos)
&& (root.latteView.extendedInterface.appletIsExpandable(applet.id)
|| (root.latteView.extendedInterface.appletIsActivationTogglesExpanded(applet.id)))) {
var angle = angleDelta.y / 8;
var expanded = root.latteView.extendedInterface.appletIsExpanded(applet.id);