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:
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…
Reference in New Issue
Block a user