Skip to content

Commit e3e1d64

Browse files
Merge pull request #16690 from xARSENICx/LateNightQML/mixer-common-controls
Add shared QML mixer control primitives
2 parents 2d5be33 + 0b38628 commit e3e1d64

14 files changed

Lines changed: 120 additions & 109 deletions

res/qml/ControlFader.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Skin.Fader {
1010

1111
value: control.parameter
1212

13-
onMoved: function(value) {
13+
onMoved: function (value) {
1414
control.parameter = value;
1515
}
1616

@@ -25,6 +25,7 @@ Skin.Fader {
2525
}
2626
TapHandler {
2727
acceptedButtons: Qt.RightButton
28+
2829
onTapped: control.reset()
2930
}
3031
}

res/qml/ControlKnob.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ Skin.Knob {
99
property alias key: control.key
1010

1111
value: control.parameter
12+
1213
onTurned: control.parameter = value
1314

1415
Mixxx.ControlProxy {
1516
id: control
1617
}
17-
1818
TapHandler {
1919
onDoubleTapped: control.reset()
2020
}
2121
TapHandler {
2222
acceptedButtons: Qt.RightButton
23+
2324
onTapped: control.reset()
2425
}
2526
}

res/qml/CrossfaderRow.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Item {
5353
anchors.right: parent.right
5454
anchors.rightMargin: 5
5555
anchors.verticalCenter: parent.verticalCenter
56-
barColor: Theme.crossfaderBarColor
57-
barStart: 0.5
56+
bar.color: Theme.crossfaderBarColor
57+
bar.start: 0.5
5858
bg: Theme.imgCrossfaderBackground
5959
fg: Theme.imgCrossfaderHandle
6060
group: "[Master]"

res/qml/Deck/HotcueAndStem.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ Item {
423423
id: volumeSlider
424424

425425
anchors.fill: parent
426-
barColor: Theme.volumeSliderBarColor
426+
bar.color: Theme.volumeSliderBarColor
427427
bg: Theme.imgVolumeSliderBackground
428428
group: stem.group
429429
implicitWidth: 10

res/qml/Deck/TempoColumn.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ ColumnLayout {
177177

178178
Layout.fillHeight: true
179179
Layout.fillWidth: true
180-
barColor: Theme.bpmSliderBarColor
181-
barMargin: 0
182-
barStart: 0.5
180+
bar.color: Theme.bpmSliderBarColor
181+
bar.margin: 0
182+
bar.start: 0.5
183183
bg: Theme.imgBpmSliderBackground
184184
group: root.group
185185
key: "rate"

res/qml/Fader.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ MixxxControls.Fader {
1111
property alias handleImage: handleImage
1212
property bool showDefaultHandle: true
1313

14-
bar: true
15-
barMargin: 10
14+
bar.enabled: true
15+
bar.margin: 10
1616
implicitHeight: backgroundImage.implicitHeight
1717
implicitWidth: backgroundImage.implicitWidth
1818

1919
background: Image {
2020
id: backgroundImage
2121

2222
anchors.fill: parent
23-
anchors.margins: root.barMargin
23+
anchors.margins: root.bar.margin
2424
}
2525
handle: Item {
2626
id: handleItem

res/qml/Knob.qml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,56 @@ import "Theme"
55
MixxxControls.Knob {
66
id: root
77

8+
property url backgroundSource: Theme.imgKnob
89
required property color color
910
property url shadowSource: Theme.imgKnobShadow
10-
property url backgroundSource: Theme.imgKnob
11+
property bool showDefaultBackground: true
12+
property bool showDefaultForeground: true
1113

12-
implicitWidth: background.width
13-
implicitHeight: implicitWidth
14+
angle: 116
1415
arc: true
15-
arcRadius: width * 0.45
16-
arcOffsetY: width * 0.01
1716
arcColor: root.color
17+
arcOffsetY: width * 0.01
18+
arcRadius: width * 0.45
1819
arcWidth: 2
19-
angle: 116
20-
21-
Image {
22-
id: shadow
23-
24-
anchors.top: parent.top
25-
anchors.left: parent.left
26-
anchors.right: parent.right
27-
height: width * 7 / 6
28-
fillMode: Image.PreserveAspectFit
29-
source: root.shadowSource
30-
}
20+
implicitHeight: implicitWidth
21+
implicitWidth: background.width
3122

3223
background: Image {
3324
id: background
3425

35-
anchors.top: parent.top
3626
anchors.left: parent.left
3727
anchors.right: parent.right
28+
anchors.top: parent.top
3829
height: width
3930
source: root.backgroundSource
31+
visible: root.showDefaultBackground
4032
}
41-
4233
foreground: Item {
43-
anchors.top: parent.top
4434
anchors.left: parent.left
4535
anchors.right: parent.right
36+
anchors.top: parent.top
4637
height: width
38+
visible: root.showDefaultForeground
4739

4840
Rectangle {
4941
anchors.horizontalCenter: parent.horizontalCenter
50-
width: 2
42+
color: root.color
5143
height: root.width / 5
44+
width: 2
5245
y: height
53-
color: root.color
5446
}
5547
}
48+
49+
Image {
50+
id: shadow
51+
52+
anchors.left: parent.left
53+
anchors.right: parent.right
54+
anchors.top: parent.top
55+
fillMode: Image.PreserveAspectFit
56+
height: width * 7 / 6
57+
source: root.shadowSource
58+
visible: root.showDefaultBackground
59+
}
5660
}

res/qml/MicrophoneDuckingPanel.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Column {
1212
}
1313

1414
Skin.ControlFader {
15-
barColor: Theme.crossfaderBarColor
16-
barStart: 1
15+
bar.color: Theme.crossfaderBarColor
16+
bar.start: 1
1717
bg: Theme.imgMicDuckingSlider
1818
fg: Theme.imgMicDuckingSliderHandle
1919
group: "[Master]"

res/qml/Mixer.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ Item {
240240
Skin.ControlFader {
241241
id: crossfaderSlider
242242

243-
barColor: Theme.crossfaderBarColor
244-
barStart: 0.5
243+
bar.color: Theme.crossfaderBarColor
244+
bar.start: 0.5
245245
bg: Theme.imgCrossfaderBackground
246246
fg: Theme.imgCrossfaderHandle
247247
group: "[Master]"

res/qml/MixerColumn.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Item {
5656
id: volumeSlider
5757

5858
anchors.fill: parent
59-
barColor: Theme.volumeSliderBarColor
59+
bar.color: Theme.volumeSliderBarColor
6060
bg: Theme.imgVolumeSliderBackground
6161
group: root.group
6262
key: "volume"

0 commit comments

Comments
 (0)