mirror of
https://github.com/jellyfin/jellyfin-media-player.git
synced 2024-11-23 05:59:43 +00:00
Merge pull request #42 from shemanaev/mouse-buttons-fix
Add Back/Forward mouse buttons handler.
This commit is contained in:
commit
e15cff1aa2
@ -7,6 +7,7 @@
|
||||
#include "settings/SettingsComponent.h"
|
||||
#include "input/InputKeyboard.h"
|
||||
#include "KonvergoWindow.h"
|
||||
#include <QQuickItem>
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QObject>
|
||||
@ -85,6 +86,22 @@ bool EventFilter::eventFilter(QObject* watched, QEvent* event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::MouseButtonPress)
|
||||
{
|
||||
QMouseEvent* mouseEvent = dynamic_cast<QMouseEvent*>(event);
|
||||
|
||||
if (mouseEvent) {
|
||||
QQuickItem* webView = window->findChild<QQuickItem*>("web");
|
||||
|
||||
if (mouseEvent->button() == Qt::BackButton)
|
||||
QMetaObject::invokeMethod(webView, "goBack");
|
||||
|
||||
if (mouseEvent->button() == Qt::ForwardButton)
|
||||
QMetaObject::invokeMethod(webView, "goForward");
|
||||
}
|
||||
}
|
||||
|
||||
return QObject::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user