]> git.sur5r.net Git - minitube/commitdiff
Added call superclass methods
author <> <>
Sun, 11 Apr 2010 12:38:02 +0000 (14:38 +0200)
committerFlavio <flavio@Lauras-MacBook.local>
Sun, 11 Apr 2010 12:38:02 +0000 (14:38 +0200)
Bettere mouse movement handling

src/videoareawidget.cpp

index b1781ac2be18be8ebc568aaffc9b1438e2d138a2..f4b48e6ecae75303d638cf5dafd44646abfe2a98 100644 (file)
@@ -68,8 +68,10 @@ void VideoAreaWidget::mouseDoubleClickEvent(QMouseEvent *event) {
 }
 
 void VideoAreaWidget::mousePressEvent(QMouseEvent *event) {
-    switch(event->button() == Qt::RightButton)
-            emit rightClicked();
+    QWidget::mousePressEvent(event);
+
+    if(event->button() == Qt::RightButton)
+        emit rightClicked();
 }
 
 void VideoAreaWidget::dragEnterEvent(QDragEnterEvent *event) {
@@ -95,14 +97,21 @@ void VideoAreaWidget::dropEvent(QDropEvent *event) {
 }
 
 void VideoAreaWidget::mouseMoveEvent(QMouseEvent *event) {
-    // qDebug() << "VideoAreaWidget::mouseMoveEvent" << event->pos();
+    QWidget::mouseMoveEvent(event);
 
     QWidget* mainWindow = window();
-    bool visible = event->pos().y() <= 0;
+    if (!mainWindow->isFullScreen()) return;
+
+    // qDebug() << "VideoAreaWidget::mouseMoveEvent" << event->pos();
+
+    const int x = event->pos().x();
+    const int y = event->pos().y();
+
+    bool visible = y <= 0;
     bool ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenToolbar", Qt::DirectConnection, Q_ARG(bool, visible));
     if (!ret) qDebug() << "showFullscreenToolbar invokeMethod failed";
 
-    visible = event->pos().x() <= 0;
+    visible = x <= 0;
     ret = QMetaObject::invokeMethod(mainWindow, "showFullscreenPlaylist", Qt::DirectConnection, Q_ARG(bool, visible));
     if (!ret) qDebug() << "showFullscreenPlaylist invokeMethod failed";
 }