summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/recorder/StyleSlider.qml
blob: a3e719cf078540bedfdbbf077e0d27bb29c5b8c3 (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
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import QtQuick.Controls

Row {
    id: root
    spacing: Style.intraSpacing

    property alias label: label.text
    property alias from: slider.from
    property alias to: slider.to
    property alias value: slider.value
    property bool enabled: true

    signal moved(real currentValue)

    Text {
        id: label
        width: Style.valueWidth
        height: Style.height
        horizontalAlignment: Text.AlignRight
        verticalAlignment: Text.AlignVCenter
        color: root.enabled ? "black" : "gray"
    }

    Slider {
        id: slider
        anchors.verticalCenter: label.verticalCenter
        width: Style.widthMedium
        enabled: root.enabled
        onMoved: root.moved(value)
    }
}