Initial implementaton for the image settings page
authorMohammed Sameer <msameer@foolab.org>
Sun, 2 Sep 2012 12:22:53 +0000 (15:22 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sun, 2 Sep 2012 12:22:53 +0000 (15:22 +0300)
qml/ColorToneButton.qml [new file with mode: 0644]
qml/ImagePage.qml
qml/ImageSettingsPage.qml [new file with mode: 0644]
qml/WhiteBalanceButton.qml [new file with mode: 0644]

diff --git a/qml/ColorToneButton.qml b/qml/ColorToneButton.qml
new file mode 100644 (file)
index 0000000..dbcdcbe
--- /dev/null
@@ -0,0 +1,84 @@
+// -*- qml -*-
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import QtCamera 1.0
+
+
+Selector {
+        id: button
+
+        property alias value: ct.value
+
+        iconSource: ctIcon(ct.value);
+
+        ColorTone {
+                id: ct
+                camera: cam
+                // TODO: hardcoding
+                value: ColorTone.Normal
+        }
+
+        function ctIcon(val) {
+                var x = row.children.length;
+                var i = 0;
+                for (i = 0; i < x; i++) {
+                        if (row.children[i].value == val) {
+                                return row.children[i].normalIcon;
+                        }
+                }
+        }
+
+        widget: Row {
+                id: row
+                height: button.checked ? 64 : 0
+                width: button.checked ? (children.length * height) +  (children.length - 1) * spacing : 0
+                spacing: 10
+
+                Behavior on width {
+                        // TODO: seems animation is not working
+                        PropertyAnimation { duration: 250; }
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-no-filter.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-no-filter-selected.png"
+                        controller: ct
+                        value: ColorTone.Normal
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-black-white.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-black-white-selected.png"
+                        controller: ct
+                        value: ColorTone.GrayScale
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-sepia.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-sepia-selected.png"
+                        controller: ct
+                        value: ColorTone.Sepia
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-vivid.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-vivid-selected.png"
+                        controller: ct
+                        value: ColorTone.Vivid
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes//blanco/meegotouch/icons/icon-m-camera-filter-negative.png"
+                        checkedIcon: "/usr/share/themes//blanco/meegotouch/icons/icon-m-camera-filter-negative-selected.png"
+                        controller: ct
+                        value: ColorTone.Negative
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-solarize.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-filter-solarize-selected.png"
+                        controller: ct
+                        value: ColorTone.Solarize
+                }
+        }
+}
index 71b21a6..ce19e1f 100644 (file)
@@ -55,6 +55,18 @@ CameraPage {
                 anchors.leftMargin: 20
         }
 
+        Indicators {
+                anchors.bottom: parent.bottom
+                anchors.bottomMargin: 20
+                anchors.left: parent.left
+                anchors.leftMargin: 20
+
+                onClicked: openFile("ImageSettingsPage.qml");
+//                Image {
+///                        
+//                }
+        }
+
         // TODO: filenaming.
         // TODO: metadata
 }
diff --git a/qml/ImageSettingsPage.qml b/qml/ImageSettingsPage.qml
new file mode 100644 (file)
index 0000000..0392a81
--- /dev/null
@@ -0,0 +1,49 @@
+// -*- qml -*-
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import QtCamera 1.0
+
+Page {
+        id: page
+
+        // TODO:
+
+        Flickable {
+                id: flick
+                anchors.top: parent.top
+                anchors.left: parent.left
+                anchors.right: parent.right
+                anchors.bottom: toolBar.top
+
+                WhiteBalanceButton {
+                        id: wb
+                        anchors.top: parent.top
+                        anchors.left: parent.left
+                        anchors.topMargin: 20
+                        anchors.leftMargin: 20
+                }
+
+                ColorToneButton {
+                        id: ct
+                        anchors.top: wb.bottom
+                        anchors.left: parent.left
+                        anchors.topMargin: 20
+                        anchors.leftMargin: 20
+                }
+        }
+
+        ToolBar {
+                id: toolBar
+                anchors.bottom: parent.bottom
+                // TODO: transparent ?
+//                height: layout.height
+//                platformStyle: ToolBarStyle {
+//                        background: ""
+//                }
+
+                tools: ToolBarLayout {
+                        id: layout
+                        ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
+                }
+        }
+}
diff --git a/qml/WhiteBalanceButton.qml b/qml/WhiteBalanceButton.qml
new file mode 100644 (file)
index 0000000..c02462e
--- /dev/null
@@ -0,0 +1,77 @@
+// -*- qml -*-
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import QtCamera 1.0
+
+Selector {
+        id: button
+
+        property alias value: wb.value
+
+        iconSource: wbIcon(wb.value);
+
+        WhiteBalance {
+                id: wb
+                camera: cam
+                // TODO: hardcoding
+                value: WhiteBalance.Auto
+        }
+
+        function wbIcon(val) {
+                var x = row.children.length;
+                var i = 0;
+                for (i = 0; i < x; i++) {
+                        if (row.children[i].value == val) {
+                                return row.children[i].normalIcon;
+                        }
+                }
+        }
+
+        widget: Row {
+                id: row
+                height: button.checked ? 64 : 0
+                width: button.checked ? (children.length * height) +  (children.length - 1) * spacing : 0
+                spacing: 10
+
+                Behavior on width {
+                        // TODO: seems animation is not working
+                        PropertyAnimation { duration: 250; }
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-auto.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-auto-selected.png"
+                        controller: wb
+                        value: WhiteBalance.Auto
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-cloudy.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-cloudy-selected.png"
+                        controller: wb
+                        value: WhiteBalance.Cloudy
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-sunny.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-sunny-selected.png"
+                        controller: wb
+                        value: WhiteBalance.Sunset
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-tungsten.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-tungsten-selected.png"
+                        controller: wb
+                        value: WhiteBalance.Tungsten
+                }
+
+                CheckButton {
+                        normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-fluorescent.png"
+                        checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-whitebalance-fluorescent-selected.png"
+                        controller: wb
+                        value: WhiteBalance.Flourescent
+                }
+
+        }
+}