Request theme icons instead of hardcoding paths
[harmattan/cameraplus] / qml / ImageSceneButton.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4 import QtCamera 1.0
5
6 Selector {
7         id: button
8
9         property alias value: scene.value
10
11         iconSource: sceneIcon(scene.value);
12
13         title: qsTr("Scene mode");
14
15         Scene {
16                 id: scene
17                 camera: cam
18                 // TODO: hardcoding
19                 value: Scene.Auto
20         }
21
22         function sceneIcon(val) {
23                 var x = row.children.length;
24                 var i = 0;
25                 for (i = 0; i < x; i++) {
26                         if (row.children[i].value == val) {
27                                 return row.children[i].normalIcon;
28                         }
29                 }
30         }
31
32         widget: Row {
33                 id: row
34                 height: button.checked ? 64 : 0
35                 width: button.checked ? (children.length * height) +  (children.length - 1) * spacing : 0
36                 spacing: 10
37
38                 Behavior on width {
39                         // TODO: seems animation is not working
40                         PropertyAnimation { duration: 250; }
41                 }
42
43                 CheckButton {
44                         normalIcon: "image://theme/icon-m-camera-scene-auto"
45                         checkedIcon: "image://theme/icon-m-camera-scene-auto-selected"
46                         controller: scene
47                         value: Scene.Auto
48                 }
49
50                 CheckButton {
51                         normalIcon: "image://theme/icon-m-camera-scene-macro"
52                         checkedIcon: "image://theme/icon-m-camera-scene-macro-selected"
53                         controller: scene
54                         value: Scene.Closeup
55                 }
56
57                 CheckButton {
58                         normalIcon: "image://theme/icon-m-camera-scene-landscape"
59                         checkedIcon: "image://theme/icon-m-camera-scene-landscape-selected"
60                         controller: scene
61                         value: Scene.Landscape
62                 }
63
64                 CheckButton {
65                         normalIcon: "image://theme/icon-m-camera-scene-portrait"
66                         checkedIcon: "image://theme/icon-m-camera-scene-portrait-selected"
67                         controller: scene
68                         value: Scene.Portrait
69                 }
70
71                 CheckButton {
72                         normalIcon: "image://theme/icon-m-camera-night"
73                         checkedIcon: "image://theme/icon-m-camera-night-selected"
74                         controller: scene
75                         value: Scene.Night
76                 }
77
78                 CheckButton {
79                         normalIcon: "image://theme/icon-m-camera-scene-sports"
80                         checkedIcon: "image://theme/icon-m-camera-scene-sports-selected"
81                         controller: scene
82                         value: Scene.Sport
83                 }
84         }
85 }