}
bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
- if (this->mediaView->isVisible()) {
- if (event->type() == QEvent::MouseMove) {
- QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
-
- const int x = mouseEvent->pos().x();
- const int y = mouseEvent->pos().y();
-
- if (x >= 0 && x <= 10 && this->m_fullscreen) {
- this->mediaView->setPlaylistVisible(true);
- } else if ((x > this->mediaView->getPlaylistSize().width() || x < 0) && this->m_fullscreen) {
- this->mediaView->setPlaylistVisible(false);
- } else if (!this->m_fullscreen){
- this->mediaView->setPlaylistVisible(true);
- }
-
- if (y >= 0 && y <= 10 && this->m_fullscreen) {
- this->mainToolBar->setVisible(true);
- } else if ((y > this->mainToolBar->size().height() || y < 0) && this->m_fullscreen) {
- this->mainToolBar->setVisible(false);
- } else if (!this->m_fullscreen) {
- this->mainToolBar->setVisible(true);
- }
- }
- if (event->type() == QEvent::FocusOut && this->m_fullscreen) {
+ if (event->type() == QEvent::MouseMove && this->m_fullscreen) {
+ QMouseEvent *mouseEvent = static_cast<QMouseEvent*> (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);
- this->mainToolBar->setVisible(false);
- }
}
+
if (event->type() == QEvent::ToolTip) {
// kill tooltips
return true;