]> git.sur5r.net Git - minitube/blobdiff - src/videoareawidget.cpp
Imported Upstream version 1.6
[minitube] / src / videoareawidget.cpp
index 3cc5bd6ae61d9d7bfd4270102057ba88256a92a3..7411b221122dd946aa45df0c339d1f008641e647 100644 (file)
@@ -11,6 +11,7 @@ VideoAreaWidget::VideoAreaWidget(QWidget *parent) : QWidget(parent) {
     p.setBrush(QPalette::Window, Qt::black);
     setPalette(p);
     setAutoFillBackground(true);
+    setStyleSheet("background:black");
 #endif
 
     // hidden message widget
@@ -106,6 +107,7 @@ void VideoAreaWidget::dropEvent(QDropEvent *event) {
 void VideoAreaWidget::mouseMoveEvent(QMouseEvent *event) {
     QWidget::mouseMoveEvent(event);
 
+#ifdef Q_WS_X11
     QWidget* mainWindow = window();
     if (!mainWindow->isFullScreen()) return;
 
@@ -121,4 +123,21 @@ void VideoAreaWidget::mouseMoveEvent(QMouseEvent *event) {
     visible = x <= 10;
     ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenPlaylist", Qt::DirectConnection, Q_ARG(bool, visible));
     if (!ret) qDebug() << "showFullscreenPlaylist invokeMethod failed";
+#endif
+}
+
+void VideoAreaWidget::leaveEvent(QMouseEvent *event) {
+    QWidget::leaveEvent(event);
+
+#ifdef Q_WS_X11
+    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";
+#endif
 }