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
work/m_layershell
Michail Vourlakos 3 years ago
parent 59360176ee
commit c9515a0353

@ -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;

@ -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;

@ -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);

Loading…
Cancel
Save