Don't show the error unless page is Active
[harmattan/cameraplus] / qml / PostCapturePage.qml
index 5767de1..460389f 100644 (file)
@@ -1,4 +1,25 @@
 // -*- qml -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
 import QtQuick 1.1
 import com.nokia.meego 1.1
 import QtCamera 1.0
@@ -44,7 +65,7 @@ CameraPage {
                 anchors.fill: parent
 
                 path: Path {
-                        startX: - view.width
+                        startX: -view.width
                         startY: view.height / 2
                         PathLine { x: view.width * 2; y: view.height / 2 }
                 }
@@ -74,8 +95,6 @@ CameraPage {
                         }
                 }
 
-                // TODO: tap post capture and then immediately back and you can see the error
-                // and the standby widget underneath it.
                 delegate: Item {
                         width: view.width
                         height: view.height
@@ -84,7 +103,7 @@ CameraPage {
                                 width: view.width - 10
                                 height: view.height
                                 anchors.centerIn: parent
-                                visible: item.error
+                                visible: item.error && page.status == PageStatus.Active
                                 text: qsTr("Failed to load preview");
                                 verticalAlignment: Text.AlignVCenter
                                 horizontalAlignment: Text.AlignHCenter
@@ -98,6 +117,13 @@ CameraPage {
                                 width: view.width - 10
                                 height: view.height
                                 anchors.centerIn: parent
+
+                                MouseArea {
+                                        id: mouse
+                                        anchors.fill: parent
+                                        enabled: true
+                                        onClicked: toolBar.visible = !toolBar.visible
+                                }
                         }
                 }
         }
@@ -111,4 +137,26 @@ CameraPage {
                         ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: { cam.start(); pageStack.pop(); } }
                 }
         }
+
+        Rectangle {
+                // TODO: transitions
+                id: rect
+                anchors.top: parent.top
+                height: toolBar.height
+                width: parent.width
+                color: "black"
+                opacity: toolBar.opacity
+                visible: toolBar.visible
+                Row {
+                        anchors.fill: parent
+
+                        Label {
+
+                        }
+
+                        Label {
+
+                        }
+                }
+        }
 }