Added dummy indicator for the resolution and cleaned up the rest
[harmattan/cameraplus] / qml / ImagePage.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4 import QtCamera 1.0
5 import CameraPlus 1.0
6 import "data.js" as Data
7
8 CameraPage {
9         id: page
10
11         policyMode: CameraResources.Image
12         controlsVisible: capture.visible && cam.running && !standbyWidget.visible
13
14         Button {
15                 id: capture
16                 anchors.right: parent.right
17                 anchors.rightMargin: 20
18                 anchors.verticalCenter: parent.verticalCenter
19                 iconSource: "image://theme/icon-m-camera-shutter"
20                 width: 75
21                 height: 75
22                 opacity: 0.5
23                 onClicked: {
24                         if (!fileSystem.available) {
25                                 showError(qsTr("Camera cannot capture images in mass storage mode."));
26                                 return;
27                         }
28
29                         metaData.setMetaData();
30
31                         if (!imageMode.capture(fileNaming.imageFileName())) {
32                                 showError(qsTr("Failed to capture image. Please restart the camera."));
33                         }
34                 }
35
36                 visible: imageMode.canCapture && !cameraMode.animationRunning && !previewAnimationRunning && cam.running
37         }
38
39         ImageMode {
40                 id: imageMode
41                 camera: cam
42                 onPreviewAvailable: page.setPreview(preview);
43         }
44
45         FlashButton {
46                 id: flash
47                 visible: controlsVisible
48                 anchors.top: parent.top
49                 anchors.left: parent.left
50                 anchors.topMargin: 20
51                 anchors.leftMargin: 20
52         }
53
54         ImageSceneButton {
55                 id: scene
56                 visible: controlsVisible
57                 anchors.top: flash.bottom
58                 anchors.left: parent.left
59                 anchors.topMargin: 10
60                 anchors.leftMargin: 20
61         }
62
63         EvCompButton {
64                 id: evComp
65                 visible: controlsVisible
66                 anchors.top: scene.bottom
67                 anchors.left: parent.left
68                 anchors.topMargin: 10
69                 anchors.leftMargin: 20
70         }
71
72         Indicators {
73                 visible: controlsVisible
74                 anchors.bottom: parent.bottom
75                 anchors.bottomMargin: 20
76                 anchors.left: parent.left
77                 anchors.leftMargin: 20
78
79                 onClicked: openFile("ImageSettingsPage.qml");
80
81                 Indicator {
82                         id: resolutionIndicator
83                         // TODO:
84                 }
85
86                 Indicator {
87                         id: wbIndicator
88                         anchors.top: resolutionIndicator.bottom
89                         source: "image://theme/" + Data.wbIcon(settings.imageWhiteBalance) + "-screen"
90                         visible: settings.imageWhiteBalance != WhiteBalance.Auto
91                 }
92
93                 Indicator {
94                         id: cfIndicator
95                         anchors.top: wbIndicator.bottom
96                         source: "image://theme/" + Data.cfIcon(settings.imageColorFilter) + "-screen"
97                         visible: settings.imageColorFilter != ColorTone.Normal
98                 }
99
100                 Indicator {
101                         id: isoIndicator
102                         visible: settings.imageIso != 0
103                         source: "image://theme/" + Data.isoIcon(settings.imageIso);
104                         anchors.top: cfIndicator.bottom
105                 }
106
107                 Indicator {
108                         id: gpsIndicator
109                         anchors.top: isoIndicator.bottom
110                         visible: settings.useGps
111                         source: "image://theme/icon-m-camera-location"
112
113                         PropertyAnimation on opacity  {
114                                 easing.type: Easing.OutSine
115                                 loops: Animation.Infinite
116                                 from: 0.2
117                                 to: 1.0
118                                 duration: 1000
119                                 running: settings.useGps && !positionSource.position.longitudeValid
120                                 alwaysRunToEnd: true
121                         }
122                 }
123         }
124
125         Button {
126                 id: cameraRoll
127                 anchors.top: parent.top
128                 anchors.right: parent.right
129                 anchors.topMargin: 20
130                 anchors.rightMargin: 20
131                 width: 56
132                 height: 56
133
134                 opacity: 0.5
135                 iconSource: "image://theme/icon-m-camera-roll"
136                 onClicked: openFile("PostCapturePage.qml");
137                 visible: controlsVisible
138         }
139 }