~danielholm/+junk/torchapp

« back to all changes in this revision

Viewing changes to torch.qml

  • Committer: Daniel Holm
  • Date: 2013-09-21 12:38:34 UTC
  • Revision ID: admin@danielholm.se-20130921123834-o369yzv6q1kqc2v6
Removed old image and instead use a simple icon.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import QtMultimedia 5.0
4
4
import QtGraphicalEffects 1.0
5
5
 
6
 
/*!
7
 
    \brief MainView with a Label and Button elements.
8
 
*/
9
6
 
10
7
MainView {
11
8
    id:mainView
23
20
    */
24
21
    //automaticOrientation: true
25
22
    
26
 
    width: units.gu(100)
 
23
    width: units.gu(50)
27
24
    height: units.gu(75)
 
25
 
28
26
    Rectangle {
29
27
        color: "black"
30
28
        anchors.fill: parent
34
32
        id:bulbandhand
35
33
        anchors.horizontalCenter: parent.horizontalCenter
36
34
        anchors.verticalCenter: parent.verticalCenter
37
 
        height:parent.height
38
 
        width:height*0.61
39
 
        source: "./lightbulb.jpg"
 
35
        height: units.gu(20)
 
36
        width: units.gu(20)
 
37
        source: "images/torch-off.svg"
40
38
 
41
39
    }
42
40
    Image {
43
41
        id:bulb
44
42
        anchors.fill:bulbandhand
45
 
        source: "./bulb.png"
 
43
        source: "images/torch-on.svg"
46
44
 
47
45
        MouseArea {
48
46
           anchors.fill: parent
49
47
           onClicked: mainView.turnon=!mainView.turnon
50
48
       }
51
49
    }
52
 
    Glow {
53
 
        source:bulb
54
 
        radius:50
55
 
        color: "white"
56
 
        samples:16
57
 
        spread:0.3
58
 
        anchors.fill:bulb
59
 
        opacity:mainView.turnon?1:0
60
 
    }
61
 
    ColorOverlay {
62
 
            anchors.fill: bulb
63
 
            source: bulb
64
 
            color: "black"
65
 
            opacity:mainView.turnon?0:0.1
66
 
        }
67
 
 
68
 
    ColorOverlay {
69
 
            anchors.fill: bulbandhand
70
 
            source: bulbandhand
71
 
            color: "black"
72
 
            opacity:mainView.turnon?0:0.3
73
 
        }
74
 
 
75
50
 
76
51
    Camera {
77
52
            id: camera
78
53
            flash.mode:!mainView.turnon?Camera.FlashOff:Camera.FlashVideoLight
79
 
        }
 
54
    }
80
55
 
81
56
 
82
57
}