From 7595bd5ef02ded978d24cac2fae00c7db9467f9c Mon Sep 17 00:00:00 2001 From: Rob Halff Date: Tue, 10 May 2011 14:49:06 +0200 Subject: [PATCH] Hide toolbar and playlist in fullscreen on mouseleave (multiscreen) --- src/videoareawidget.cpp | 14 ++++++++++++++ src/videoareawidget.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/videoareawidget.cpp b/src/videoareawidget.cpp index 3cc5bd6..1381b0e 100644 --- a/src/videoareawidget.cpp +++ b/src/videoareawidget.cpp @@ -122,3 +122,17 @@ void VideoAreaWidget::mouseMoveEvent(QMouseEvent *event) { ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenPlaylist", Qt::DirectConnection, Q_ARG(bool, visible)); if (!ret) qDebug() << "showFullscreenPlaylist invokeMethod failed"; } + +void VideoAreaWidget::leaveEvent(QMouseEvent *event) { + QWidget::leaveEvent(event); + + QWidget* mainWindow = window(); + if (!mainWindow->isFullScreen()) return; + + bool visible = false; + bool ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenToolbar", Qt::DirectConnection, Q_ARG(bool, visible)); + if (!ret) qDebug() << "showFullscreenToolbar invokeMethod failed"; + + ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenPlaylist", Qt::DirectConnection, Q_ARG(bool, visible)); + if (!ret) qDebug() << "showFullscreenPlaylist invokeMethod failed"; +} diff --git a/src/videoareawidget.h b/src/videoareawidget.h index e1f7cea..60112f5 100644 --- a/src/videoareawidget.h +++ b/src/videoareawidget.h @@ -32,6 +32,7 @@ protected: void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); void mouseMoveEvent(QMouseEvent *event); + void leaveEvent(QMouseEvent *event); private: QStackedLayout *stackedLayout; -- 2.39.5