post capture image now follows device orientation
[harmattan/cameraplus] / qml / ImageWhiteBalanceButton.qml
index 8c3fc91..8c98279 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-import QtQuick 1.1
-import com.nokia.meego 1.1
+import QtQuick 2.0
 import QtCamera 1.0
 import "data.js" as Data
 
-ToolIcon {
-        id: button
+CameraToolIcon {
+    id: button
 
-        iconSource: "image://theme/" + Data.wbIcon(settings.imageWhiteBalance);
+    iconId: Data.wbIcon(settings.imageWhiteBalance)
 
-        property list<Item> items: [
-                Label {
-                        height: parent ? parent.height : 0
-                        text: qsTr("WB");
-                        verticalAlignment: Text.AlignVCenter
-                },
-                CheckButton {
-                        normalIcon: "image://theme/" + Data.wbIcon(value);
-                        checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
-                        onClicked: settings.imageWhiteBalance = value;
-                        value: WhiteBalance.Auto
-                        savedValue: settings.imageWhiteBalance
-                },
-                CheckButton {
-                        normalIcon: "image://theme/" + Data.wbIcon(value);
-                        checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
-                        onClicked: settings.imageWhiteBalance = value;
-                        value: WhiteBalance.Sunset
-                        savedValue: settings.imageWhiteBalance
-                },
-                CheckButton {
-                        normalIcon: "image://theme/" + Data.wbIcon(value);
-                        checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
-                        onClicked: settings.imageWhiteBalance = value;
-                        value: WhiteBalance.Cloudy
-                        savedValue: settings.imageWhiteBalance
-                },
-                CheckButton {
-                        normalIcon: "image://theme/" + Data.wbIcon(value);
-                        checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
-                        onClicked: settings.imageWhiteBalance = value;
-                        value: WhiteBalance.Flourescent
-                        savedValue: settings.imageWhiteBalance
-                },
-                CheckButton {
-                        normalIcon: "image://theme/" + Data.wbIcon(value);
-                        checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
-                        onClicked: settings.imageWhiteBalance = value;
-                        value: WhiteBalance.Tungsten
-                        savedValue: settings.imageWhiteBalance
-                }]
+    property CameraToolBarTools tools: CameraToolBarTools {
+        CameraLabel {
+            height: parent ? parent.height : 0
+            text: qsTr("WB")
+            verticalAlignment: Text.AlignVCenter
+        }
+
+        CheckButton {
+            iconId: Data.wbIcon(WhiteBalance.Auto)
+            onClicked: settings.imageWhiteBalance = WhiteBalance.Auto
+            checked: settings.imageWhiteBalance == WhiteBalance.Auto
+        }
+
+        CheckButton {
+            iconId: Data.wbIcon(WhiteBalance.Sunset)
+            onClicked: settings.imageWhiteBalance = WhiteBalance.Sunset
+            checked: settings.imageWhiteBalance == WhiteBalance.Sunset
+        }
+
+        CheckButton {
+            iconId: Data.wbIcon(WhiteBalance.Cloudy)
+            onClicked: settings.imageWhiteBalance = WhiteBalance.Cloudy
+            checked: settings.imageWhiteBalance == WhiteBalance.Cloudy
+        }
+
+        CheckButton {
+            iconId: Data.wbIcon(WhiteBalance.Flourescent)
+            onClicked: settings.imageWhiteBalance = WhiteBalance.Flourescent
+            checked: settings.imageWhiteBalance == WhiteBalance.Flourescent
+        }
+
+        CheckButton {
+            iconId: Data.wbIcon(WhiteBalance.Tungsten)
+            onClicked: settings.imageWhiteBalance = WhiteBalance.Tungsten
+            checked: settings.imageWhiteBalance == WhiteBalance.Tungsten
+        }
+    }
 }