Get rid of meego InfoBanner usage and move to a home grown component
authorMohammed Sameer <msameer@foolab.org>
Sun, 15 Sep 2013 02:31:48 +0000 (05:31 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sun, 15 Sep 2013 02:31:48 +0000 (05:31 +0300)
qml/CameraInfoBanner.qml [moved from qml/harmattan/CameraInfoBanner.qml with 50% similarity]
qml/harmattan/harmattan.qrc
qml/qml.qrc

similarity index 50%
rename from qml/harmattan/CameraInfoBanner.qml
rename to qml/CameraInfoBanner.qml
index bb16045..74e1eac 100644 (file)
  */
 
 import QtQuick 1.1
-import com.nokia.extras 1.1
 
-InfoBanner {
+Rectangle {
+    property alias text: label.text
+    property bool shown: false
+
+    width: parent.width - 16
+    height: label.height * 2
+    y: shown ? 8 : - (height + 8)
+    anchors.horizontalCenter: parent.horizontalCenter
+    color: "black"
+    border.color: "gray"
+    radius: 20
+
+    Behavior on y {
+        NumberAnimation {duration: 200}
+    }
+
+    Timer {
+        id: timer
+        repeat: false
+        interval: 3000
+        onTriggered: hide()
+    }
+
+    MouseArea {
+        anchors.fill: parent
+        onClicked: parent.hide()
+    }
+
+    CameraLabel {
+        id: label
+        anchors.verticalCenter: parent.verticalCenter
+        elide: Text.ElideRight
+        maximumLineCount: 1
+        x: 16
+    }
+
+    function show() {
+        shown = true
+        timer.restart()
+    }
+
+    function hide() {
+        shown = false
+        timer.stop()
+    }
 }
index f4d4ac1..1a77f0f 100644 (file)
@@ -10,7 +10,6 @@
        <file>CameraButtonRow.qml</file>
        <file>CameraQueryDialog.qml</file>
        <file>CameraWindow.qml</file>
-       <file>CameraInfoBanner.qml</file>
        <file>CameraButtonStyle.qml</file>
        <file>FullScreenThumbnail.qml</file>
        <file>CameraPositionSource.qml</file>
index 64101e9..541dba2 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE RCC>
 <RCC version="1.0">
     <qresource prefix="/qml">
+       <file>CameraInfoBanner.qml</file>
        <file>CameraSettings.qml</file>
        <file>CameraTheme.qml</file>
        <file>CameraToolBar.js</file>