support wheel events
This commit is contained in:
parent
7c139742a6
commit
5ecb5185f7
@ -263,6 +263,22 @@ void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event)
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void ContainmentInterface::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
const QString trigger = Plasma::ContainmentActions::eventToString(event);
|
||||
Plasma::ContainmentActions *plugin = containment()->containmentActions().value(trigger);
|
||||
|
||||
if (plugin) {
|
||||
if (event->delta() < 0) {
|
||||
plugin->performNextAction();
|
||||
} else {
|
||||
plugin->performPreviousAction();
|
||||
}
|
||||
} else {
|
||||
event->setAccepted(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ContainmentInterface::addAppletActions(QMenu &desktopMenu, Plasma::Applet *applet, QEvent *event)
|
||||
|
@ -65,6 +65,7 @@ protected:
|
||||
void init();
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
void wheelEvent(QWheelEvent *event);
|
||||
|
||||
void addAppletActions(QMenu &desktopMenu, Plasma::Applet *applet, QEvent *event);
|
||||
void addContainmentActions(QMenu &desktopMenu, QEvent *event);
|
||||
|
Loading…
Reference in New Issue
Block a user