accept all buttons

so menus for all mouse events can be generated
This commit is contained in:
Marco Martin 2013-08-27 11:12:32 +02:00
parent 8596b9c43b
commit 7c139742a6

View File

@ -43,8 +43,7 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
: AppletInterface(parent),
m_wallpaperInterface(0)
{
//TODO: will accept all events specified as registered with containment actions
setAcceptedMouseButtons(Qt::RightButton);
setAcceptedMouseButtons(Qt::AllButtons);
qmlRegisterType<ContainmentInterface>();
@ -229,11 +228,16 @@ QString ContainmentInterface::activity() const
void ContainmentInterface::mousePressEvent(QMouseEvent *event)
{
event->accept();
event->setAccepted(containment()->containmentActions().contains(Plasma::ContainmentActions::eventToString(event)));
}
void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event)
{
if (!containment()->containmentActions().contains(Plasma::ContainmentActions::eventToString(event))) {
event->setAccepted(false);
return;
}
QMenu desktopMenu;
//FIXME: very inefficient appletAt() implementation