Add a title to our buttons
[harmattan/cameraplus] / qml / VideoSceneButton.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: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-scene-auto.png"
45                         checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-scene-auto-selected.png"
46                         controller: scene
47                         value: Scene.Auto
48                 }
49
50                 CheckButton {
51                         normalIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-video-night.png"
52                         checkedIcon: "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-video-night-selected.png"
53                         controller: scene
54                         value: Scene.Night
55                 }
56         }
57 }