From: Rob Halff Date: Tue, 10 May 2011 12:49:06 +0000 (+0200) Subject: Hide toolbar and playlist in fullscreen on mouseleave (multiscreen) X-Git-Tag: 1.4.3~4^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7595bd5ef02ded978d24cac2fae00c7db9467f9c;p=minitube Hide toolbar and playlist in fullscreen on mouseleave (multiscreen) --- 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;