]> git.sur5r.net Git - minitube/commitdiff
Hide toolbar and playlist in fullscreen on mouseleave (multiscreen)
authorRob Halff <rob.halff@gmail.com>
Tue, 10 May 2011 12:49:06 +0000 (14:49 +0200)
committerRob Halff <rob.halff@gmail.com>
Tue, 10 May 2011 12:49:06 +0000 (14:49 +0200)
src/videoareawidget.cpp
src/videoareawidget.h

index 3cc5bd6ae61d9d7bfd4270102057ba88256a92a3..1381b0e7c0e764a26d1b444c7840dc65ad44e13d 100644 (file)
@@ -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";
+}
index e1f7cea3d16c5cadea95b2c7d5b29f43575c1f21..60112f56fdddbf6b67f967be0c3778f589f18bb2 100644 (file)
@@ -32,6 +32,7 @@ protected:
     void dragEnterEvent(QDragEnterEvent *event);
     void dropEvent(QDropEvent *event);
     void mouseMoveEvent(QMouseEvent *event);
+    void leaveEvent(QMouseEvent *event);
 
 private:
     QStackedLayout *stackedLayout;