camerauis/cameraxui/cxui/src/cxuiview.cpp
changeset 40 2922f70fca82
parent 39 c5025ea871a1
child 37 64817133cd1d
--- a/camerauis/cameraxui/cxui/src/cxuiview.cpp	Thu Jul 15 01:46:05 2010 +0300
+++ b/camerauis/cameraxui/cxui/src/cxuiview.cpp	Thu Jul 15 01:49:11 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <QGraphicsItem>
 #include <QProcess>
+#include <QGraphicsSceneEvent>
 #include <hbtoolbar.h>
 #include <hbnotificationdialog.h>
 #include <hbframeitem.h>
@@ -45,7 +46,8 @@
         mSlider(NULL),
         mToolbar(NULL),
         mIndicators(NULL),
-        mHideControlsTimeout(this)
+        mHideControlsTimeout(this),
+        mControlsFeedback(HbFeedback::BasicItem)
 {
     CX_DEBUG_IN_FUNCTION();
 }
@@ -357,4 +359,36 @@
     }
 }
 
+/*!
+ * Handle mouse press events on this view. Needed to implement toggling of
+ * controls and playing feedback.
+ * \param event event to be handled
+ */
+void CxuiView::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+    //! @todo temporary workaround for title bar mouse event handling bug
+    if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70) {
+        mControlsFeedback.setModalities(HbFeedback::All);
+        mControlsFeedback.play();
+        event->accept();
+    }
+}
+
+/*!
+ * Handle mouse release events on this view. Needed to implement toggling of
+ * controls and playing feedback.
+ * \param event to be handled
+ */
+void CxuiView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+    //! @todo temporary workaround for title bar mouse event handling bug
+    if (event->type() == QEvent::GraphicsSceneMouseRelease && event->scenePos().y() > 70) {
+        // todo: sound disabling doesn't work in orbit yet so don't do feedback on release
+        // needs to be enabled when orbit support is done
+        //mControlsFeedback.setModalities(HbFeedback::Tactile);
+        //mControlsFeedback.play();
+        toggleControls();
+        event->accept();
+    }
+}
 // End of file