From: Georg Grabler Date: Sat, 5 Feb 2011 16:47:15 +0000 (+0000) Subject: * I think i fixed the dualscreen behaviour now by differing between out-of-screen... X-Git-Tag: 1.4.1~2^2~4^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9fa89c655abe22639ecc8a34ba3f1d18fc77d644;p=minitube * I think i fixed the dualscreen behaviour now by differing between out-of-screen and in-screen behaviour --- 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"; }