From 9fa89c655abe22639ecc8a34ba3f1d18fc77d644 Mon Sep 17 00:00:00 2001 From: Georg Grabler Date: Sat, 5 Feb 2011 16:47:15 +0000 Subject: [PATCH] * I think i fixed the dualscreen behaviour now by differing between out-of-screen and in-screen behaviour --- src/MainWindow.cpp | 10 ++++++++++ src/videoareawidget.cpp | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 2064ce9..95f715d 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -89,6 +89,16 @@ MainWindow::~MainWindow() { } bool MainWindow::eventFilter(QObject *obj, QEvent *event) { + if (event->type() == QEvent::MouseMove && this->m_fullscreen) { + QMouseEvent *mouseEvent = static_cast (event); + int x = mouseEvent->pos().x(); + int y = mouseEvent->pos().y(); + + if (y < 0 && (obj == this->mainToolBar || !(y <= 10-this->mainToolBar->height() && y >= 0-this->mainToolBar->height() ))) + this->mainToolBar->setVisible(false); + if (x < 0) + this->mediaView->setPlaylistVisible(false); + } if (event->type() == QEvent::ToolTip) { // kill tooltips return true; diff --git a/src/videoareawidget.cpp b/src/videoareawidget.cpp index f4b48e6..2b1c6d1 100644 --- a/src/videoareawidget.cpp +++ b/src/videoareawidget.cpp @@ -107,11 +107,11 @@ void VideoAreaWidget::mouseMoveEvent(QMouseEvent *event) { const int x = event->pos().x(); const int y = event->pos().y(); - bool visible = y <= 0; + bool visible = y <= 10; bool ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenToolbar", Qt::DirectConnection, Q_ARG(bool, visible)); if (!ret) qDebug() << "showFullscreenToolbar invokeMethod failed"; - visible = x <= 0; + visible = x <= 10; ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenPlaylist", Qt::DirectConnection, Q_ARG(bool, visible)); if (!ret) qDebug() << "showFullscreenPlaylist invokeMethod failed"; } -- 2.39.5