aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qmldesigner/effectComposerQmlSources/ValueInt.qml
blob: d67929168a9f8cc4ab4ef8671fd090921117a890 (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
42
43
44
45
46
47
48
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick
import HelperWidgets as HelperWidgets
import StudioControls as StudioControls
import StudioTheme as StudioTheme
import EffectComposerBackend

Row {
    width: parent.width
    spacing: 5

    HelperWidgets.DoubleSpinBox {
        id: spinBox

        // value: uniformValue binding can get overwritten by normal operation of the control
        property double resetValue: uniformValue
        onResetValueChanged: value = resetValue

        width: 60
        spinBoxIndicatorVisible: false
        inputHAlignment: Qt.AlignHCenter
        minimumValue: uniformMinValue
        maximumValue: uniformMaxValue
        value: uniformValue
        stepSize: 1
        decimals: 0
        onValueModified: uniformValue = Math.round(value)
    }

    StudioControls.Slider {
        id: slider

        width: parent.width - 100
        visible: width > 20
        labels: false
        actionIndicatorVisible: false
        handleLabelVisible: false
        from: uniformMinValue
        to: uniformMaxValue
        value: uniformValue
        onMoved: {
            uniformValue = Math.round(value)
            spinBox.value = Math.round(value)
        }
    }
}