Forward wheel events to the wallpaper
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=857101
This commit is contained in:
parent
dcaf4a4b8a
commit
6d24078bc7
@ -991,6 +991,20 @@ void Containment::keyPressEvent(QKeyEvent *event)
|
||||
|
||||
void Containment::wheelEvent(QGraphicsSceneWheelEvent *event)
|
||||
{
|
||||
if (d->wallpaper) {
|
||||
QGraphicsItem* item = scene()->itemAt(event->scenePos());
|
||||
if (item == this) {
|
||||
event->ignore();
|
||||
d->wallpaper->mouseWheelEvent(event);
|
||||
|
||||
if (event->isAccepted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
|
||||
if (containmentType() == DesktopContainment) {
|
||||
QGraphicsItem* item = scene()->itemAt(event->scenePos());
|
||||
if (item == this) {
|
||||
|
@ -217,6 +217,11 @@ void Wallpaper::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
Q_UNUSED(event)
|
||||
}
|
||||
|
||||
void Wallpaper::mouseWheelEvent(QGraphicsSceneWheelEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
}
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
#include "wallpaper.moc"
|
||||
|
@ -186,6 +186,14 @@ class PLASMA_EXPORT Wallpaper : public QObject
|
||||
*/
|
||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
|
||||
/**
|
||||
* Mouse wheel event. To prevent further propagation of the event,
|
||||
* the event must be accepted.
|
||||
*
|
||||
* @param event the wheel event object
|
||||
*/
|
||||
virtual void mouseWheelEvent(QGraphicsSceneWheelEvent *event);
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
* This signal indicates that wallpaper needs to be repainted.
|
||||
|
Loading…
Reference in New Issue
Block a user