Hide post capture toolbar immediately when we start video playback
[harmattan/cameraplus] / qml / PostCaptureView.qml
index 603798b..b0bf1d6 100644 (file)
@@ -24,7 +24,10 @@ import QtQuick 2.0
 import CameraPlus 1.0
 import QtCamera 1.0
 
+// TODO: qrc:/qml/PostCaptureView.qml:104:5: QML CameraToolBar: Binding loop detected for property "height"
 Item {
+    id: postCaptureView
+
     property Camera camera: null
     property bool pressed: view.currentItem ? view.currentItem.playing : false
     property int policyMode: view.currentItem && view.currentItem.playing ?
@@ -32,6 +35,15 @@ Item {
         CameraResources.Image
     property bool available: view.currentItem ? view.currentItem.itemData.available : false
 
+    Connections {
+        target: view.currentItem
+        onPlayingChanged: {
+            if (view.currentItem.playing) {
+                hideTimer.running = false
+            }
+        }
+    }
+
     ShareHelper {
         id: share
         settings: platformSettings
@@ -107,6 +119,8 @@ Item {
         anchors.bottomMargin: show ? 20 : -1 * (height + 20)
         anchors.left: parent.left
         anchors.leftMargin: 20
+        anchors.right: parent.right
+        anchors.rightMargin: 20
         opacity: 0.8
 
         property bool show: deleteDialog.isOpen || deleteDialog.isOpening ||
@@ -114,31 +128,34 @@ Item {
             (view.currentItem && view.currentItem.error) && !view.currentItem.playing
 
         Behavior on anchors.bottomMargin {
-            PropertyAnimation { duration: 200; }
+            PropertyAnimation { duration: view.currentItem && view.currentItem.playing ? 0 : 200 }
         }
 
-        items: [
+        tools: CameraToolBarTools {
             CameraToolIcon {
                 iconId: !available ? cameraTheme.favoriteDisabledIconId : view.currentItem.itemData.favorite ? cameraTheme.favoriteMarkIconId : cameraTheme.favoriteUnmarkIconId
                 onClicked: {
                     addOrRemoveFavorite()
                     restartTimer()
                 }
-            },
+            }
+
             CameraToolIcon {
                 iconId: available ? cameraTheme.shareEnabledIconId : cameraTheme.shareDisabledIconId
                 onClicked: {
                     shareCurrentItem()
                     restartTimer()
                 }
-            },
+            }
+
             CameraToolIcon {
                 iconId: available ? cameraTheme.deleteEnabledIconId : cameraTheme.deleteDisabledIconId
                 onClicked: {
                     deleteCurrentItem()
                     restartTimer()
                 }
-            },
+            }
+
             CameraToolIcon {
                 iconId: cameraTheme.menuIconId
                 onClicked: {
@@ -146,7 +163,7 @@ Item {
                     restartTimer()
                 }
             }
-        ]
+        }
     }
 
     CameraQueryDialog {
@@ -203,7 +220,7 @@ Item {
         radius: toolBar.radius
 
         Behavior on anchors.topMargin {
-            PropertyAnimation { duration: 200; }
+            PropertyAnimation { duration: view.currentItem && view.currentItem.playing ? 0 : 200 }
         }
 
         Flow {