summaryrefslogtreecommitdiffstats
path: root/QtDemo/qml/QtDemo/demos/video/VolumeControl.qml
blob: a71d66e2b6c33561ccac6f0758a8810422ecfb85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

import QtQuick 2.0

Item {
    id: root
    property alias volume: volumeSlider.value

    //Volume Controls
    ImageButton {
        id: volumeDown
        height: parent.height * 0.5
        imageSource: "images/VolumeDown.png"
        anchors.verticalCenter: root.verticalCenter
        anchors.left: root.left
        onClicked: {
            root.volume = 0.0;
        }
    }
    Slider {
        id: volumeSlider
        anchors.left: volumeDown.right
        anchors.right: volumeUp.left
        height: root.height
        maximum: 1.0
        minimum: 0.0
        anchors.verticalCenter: root.verticalCenter
        anchors.verticalCenterOffset: 1
    }

    ImageButton {
        id: volumeUp
        height: parent.height * 0.5
        imageSource: "images/VolumeUp.png"
        anchors.verticalCenter: root.verticalCenter
        anchors.verticalCenterOffset: 1
        anchors.right: root.right
        onClicked: {
            root.volume = 1.0
        }
    }
}