setAcceptDrops(true);
+ mouseTimer = new QTimer(this);
+ mouseTimer->setInterval(3000);
+ mouseTimer->setSingleShot(true);
+ connect(mouseTimer, SIGNAL(timeout()), SLOT(hideMouse()));
+
QTimer::singleShot(0, this, SLOT(checkForUpdate()));
}
}
#endif
+#ifndef Q_WS_X11
+ // mac::IsFullScreen(winId())
+ if (event->type() == QEvent::MouseMove && m_fullscreen) {
+
+ // show the normal cursor
+ unsetCursor();
+ // then hide it again after a few seconds
+ mouseTimer->start();
+
+ QMouseEvent *mouseEvent = static_cast<QMouseEvent*> (event);
+ const int x = mouseEvent->pos().x();
+ const QString className = QString(obj->metaObject()->className());
+ const bool isHoveringVideo = className == "QGLWidget";
+ // qDebug() << obj << x << isHoveringVideo << mediaView->isPlaylistVisible();
+ if (mediaView->isPlaylistVisible()) {
+ if (isHoveringVideo && x > 5) mediaView->setPlaylistVisible(false);
+ } else {
+ bool visible = (isHoveringVideo && x >= 0 && x < 5);
+ mediaView->setPlaylistVisible(visible);
+ }
+ }
+#endif
+
if (event->type() == QEvent::ToolTip) {
// kill tooltips
return true;
}
// standard event processing
- return QObject::eventFilter(obj, event);
+ return QMainWindow::eventFilter(obj, event);
}
void MainWindow::createActions() {
if (views->currentWidget() == mediaView)
mediaView->setFocus();
+
+ if (!m_fullscreen) {
+ mouseTimer->stop();
+ unsetCursor();
+ }
}
void MainWindow::compactView(bool enable) {
showMedia(searchParams);
}
}
+
+void MainWindow::hideMouse() {
+ setCursor(Qt::BlankCursor);
+ mediaView->setPlaylistVisible(false);
+}
#include "playlistwidget.h"
#include "refinesearchwidget.h"
#include "sidebarwidget.h"
+#ifdef APP_MAC
+#include "macfullscreen.h"
+#endif
namespace The {
NetworkAccess* http();
videoAreaWidget = new VideoAreaWidget(this);
// videoAreaWidget->setMinimumSize(320,240);
-#ifdef APP_MAC_NO
+#ifdef APP_MAC
// mouse autohide does not work on the Mac (no mouseMoveEvent)
videoWidget = new Phonon::VideoWidget(this);
#else
sidebar->getRefineSearchWidget()->setSearchParams(searchParams);
sidebar->hideSuggestions();
+
}
void MediaView::searchAgain() {
}
void MediaView::setPlaylistVisible(bool visible) {
+ if (splitter->widget(0)->isVisible() == visible) return;
splitter->widget(0)->setVisible(visible);
+ listView->setFocus();
+}
+
+bool MediaView::isPlaylistVisible() {
+ return splitter->widget(0)->isVisible();
}
void MediaView::timerPlay() {