Replace icons with text for image resolution indicator
authorMohammed Sameer <msameer@foolab.org>
Thu, 8 Aug 2013 21:33:58 +0000 (00:33 +0300)
committerMohammed Sameer <msameer@foolab.org>
Thu, 8 Aug 2013 21:33:58 +0000 (00:33 +0300)
qml/ImageOverlay.qml
qml/harmattan/CameraTheme.qml

index e62c6e0..20c9d9e 100644 (file)
@@ -177,11 +177,18 @@ Item {
                 source: "image://theme/" + cameraTheme.flashIndicatorIcon(settings.imageFlashMode)
             }
 
-            Indicator {
-                id: resolutionIndicator
-                property string imageAspectRatio: settings.device == 1 ? settings.secondaryImageAspectRatio : settings.primaryImageAspectRatio
-                property string imageResolution: settings.device == 1 ? settings.secondaryImageResolution : settings.primaryImageResolution
-                source: "image://theme/" + cameraTheme.imageIcon(imageAspectRatio, imageResolution, settings.device)
+            CameraLabel {
+                anchors.left: parent.left
+                anchors.right: parent.right
+                anchors.leftMargin: 5
+                anchors.rightMargin: 5
+                anchors.topMargin: 5
+                anchors.bottomMargin: 5
+                property string mp: imageSettings.currentResolutionMegapixel == "" ? "?" : imageSettings.currentResolutionMegapixel
+                text: qsTr("%1M").arg(mp)
+                font.bold: true
+                verticalAlignment: Text.AlignVCenter
+                horizontalAlignment: Text.AlignHCenter
             }
 
             Indicator {
index c17fcad..f6e27b8 100644 (file)
@@ -96,30 +96,6 @@ QtObject {
         }
     }
 
-    property variant __imageData: [
-        ["3:2", "low", "icon-m-camera-resolution-3m"],
-        ["3:2", "medium", "icon-m-camera-resolution-6m"],
-        ["3:2", "high", "icon-m-camera-resolution-7m"],
-        ["4:3", "low", "icon-m-camera-resolution-3m"],
-        ["4:3", "medium", "icon-m-camera-resolution-6m"],
-        ["4:3", "high", "icon-m-camera-resolution-8m"],
-        ["16:9", "low", "icon-m-camera-resolution-3m"],
-        ["16:9", "medium", "icon-m-camera-resolution-6m"],
-        ["16:9", "high", "icon-m-camera-resolution-7m"]
-    ]
-
-    function imageIcon(ratio, res, device) {
-        var x = 0
-        var len = __imageData.length
-        for (x = 0; x < len; x++) {
-            if (__imageData[x][0] == ratio && __imageData[x][1] == res) {
-                return __imageData[x][2]
-            }
-        }
-
-        return ""
-    }
-
     function whiteBalanceIcon(val) {
         switch (val) {
             case WhiteBalance.Auto: