Skip to content

Commit 927457d

Browse files
Merge pull request #14597 from acolombier/feat/qml-settings-sound-hardware
QML settings sound hardware
2 parents 4d598c5 + 8511563 commit 927457d

21 files changed

+3311
-97
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ repos:
126126
- id: prettier
127127
types: [yaml]
128128
- repo: https://github.com/qarmin/qml_formatter.git
129-
rev: 16f651d727652dffff92678f4b602df9bfb45eb7 # No release tag yet including #7 fix
129+
rev: 706250038bb565f4c630ca3aab09f764faabae67 # No release tag yet including #9 fix
130130
hooks:
131131
- id: qml_formatter
132132
- repo: https://github.com/BlankSpruce/gersemi

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,6 +3565,7 @@ if(QML)
35653565
src/qml/qmlwaveformrenderer.cpp
35663566
src/qml/qmlsettingparameter.cpp
35673567
src/qml/qmltrackproxy.cpp
3568+
src/qml/qmlsoundmanagerproxy.cpp
35683569
src/waveform/renderers/allshader/digitsrenderer.cpp
35693570
src/waveform/renderers/allshader/waveformrenderbeat.cpp
35703571
src/waveform/renderers/allshader/waveformrenderer.cpp
@@ -4231,6 +4232,9 @@ if(RUBBERBAND)
42314232
find_package(rubberband REQUIRED)
42324233
target_link_libraries(mixxx-lib PRIVATE rubberband::rubberband)
42334234
target_compile_definitions(mixxx-lib PUBLIC __RUBBERBAND__)
4235+
if(QML)
4236+
target_compile_definitions(mixxx-qml-lib PUBLIC __RUBBERBAND__)
4237+
endif()
42344238
target_sources(
42354239
mixxx-lib
42364240
PRIVATE

res/qml/ComboBox.qml

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import "." as Skin
22
import QtQuick 2.12
33
import QtQuick.Controls 2.12
4+
import QtQuick.Shapes
5+
import Qt5Compat.GraphicalEffects
46
import "Theme"
57

68
ComboBox {
79
id: root
810

911
property alias popupWidth: popup.width
1012
property bool clip: false
13+
property int popupMaxItem: 3
1114

1215
background: Skin.EmbeddedBackground {
1316
}
@@ -17,28 +20,31 @@ ComboBox {
1720

1821
required property int index
1922

20-
width: parent.width
2123
highlighted: root.highlightedIndex === this.index
2224
text: root.textAt(this.index)
25+
padding: 4
26+
verticalPadding: 8
2327

2428
contentItem: Text {
2529
text: itemDlgt.text
30+
font: root.font
2631
color: Theme.deckTextColor
2732
elide: Text.ElideRight
2833
verticalAlignment: Text.AlignVCenter
2934
}
3035

3136
background: Rectangle {
3237
radius: 5
33-
border.width: itemDlgt.highlighted ? 1 : 0
34-
border.color: Theme.deckLineColor
38+
border.width: 1
39+
border.color: itemDlgt.highlighted ? Theme.deckLineColor : "transparent"
3540
color: "transparent"
3641
}
3742
}
3843

44+
indicator.width: 20
45+
3946
contentItem: Text {
4047
leftPadding: 5
41-
rightPadding: root.indicator.width + root.spacing
4248
text: root.displayText
4349
font: root.font
4450
color: Theme.deckTextColor
@@ -49,21 +55,71 @@ ComboBox {
4955

5056
popup: Popup {
5157
id: popup
52-
y: root.height
53-
width: root.width
54-
implicitHeight: contentItem.implicitHeight
58+
y: root.height/2
59+
width: root.width - root.indicator.width / 2
60+
x: root.indicator.width / 2
61+
height: root.indicator.implicitHeight*Math.min(root.popupMaxItem, root.count) + root.indicator.width
62+
63+
padding: 0
64+
65+
contentItem: Item {
66+
Item {
67+
id: content
68+
anchors.fill: parent
69+
Shape {
70+
id: arrow
71+
anchors.top: parent.top
72+
anchors.right: parent.right
73+
anchors.rightMargin: 3
74+
width: root.indicator.width-4
75+
height: width
76+
antialiasing: true
77+
layer.enabled: true
78+
layer.samples: 4
79+
ShapePath {
80+
fillColor: Theme.embeddedBackgroundColor
81+
strokeColor: Theme.deckBackgroundColor
82+
strokeWidth: 2
83+
startX: arrow.width/2; startY: 0
84+
fillRule: ShapePath.WindingFill
85+
capStyle: ShapePath.RoundCap
86+
PathLine { x: root.indicator.width; y: root.indicator.width }
87+
PathLine { x: 0; y: root.indicator.width }
88+
PathLine { x: (root.indicator.width) / 2; y: 0 }
89+
}
90+
}
91+
Skin.EmbeddedBackground {
92+
anchors.topMargin: root.indicator.width-6
93+
anchors.fill: parent
94+
ListView {
95+
clip: true
96+
97+
anchors.fill: parent
5598

56-
contentItem: ListView {
57-
clip: true
58-
implicitHeight: contentHeight
59-
model: root.popup.visible ? root.delegateModel : null
60-
currentIndex: root.highlightedIndex
99+
bottomMargin: 0
100+
leftMargin: 0
101+
rightMargin: 0
102+
topMargin: 0
61103

62-
ScrollIndicator.vertical: ScrollIndicator {
104+
model: root.popup.visible ? root.delegateModel : null
105+
currentIndex: root.highlightedIndex
106+
107+
ScrollBar.vertical: ScrollBar {
108+
policy: ScrollBar.AlwaysOn
109+
}
110+
}
111+
}
112+
}
113+
DropShadow {
114+
anchors.fill: parent
115+
horizontalOffset: 0
116+
verticalOffset: 0
117+
radius: 8.0
118+
color: "#000000"
119+
source: content
63120
}
64121
}
65122

66-
background: Skin.EmbeddedBackground {
67-
}
123+
background: Item {}
68124
}
69125
}

res/qml/ControlSlider.qml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ import "." as Skin
22
import Mixxx 1.0 as Mixxx
33
import QtQuick 2.12
44

5-
Skin.Slider {
6-
property alias group: control.group
7-
property alias key: control.key
5+
Skin.Fader {
6+
id: root
7+
8+
required property string group
9+
required property string key
810

911
value: control.parameter
1012
onMoved: control.parameter = value
1113

1214
Mixxx.ControlProxy {
1315
id: control
16+
group: root.group
17+
key: root.key
1418
}
1519

1620
TapHandler {

res/qml/Fader.qml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import Mixxx.Controls 1.0 as MixxxControls
2+
import Qt5Compat.GraphicalEffects
3+
import QtQuick 2.12
4+
import "Theme"
5+
6+
MixxxControls.Slider {
7+
id: root
8+
9+
property alias fg: handleImage.source
10+
property alias bg: backgroundImage.source
11+
12+
bar: true
13+
barMargin: 10
14+
implicitWidth: backgroundImage.implicitWidth
15+
implicitHeight: backgroundImage.implicitHeight
16+
17+
Image {
18+
id: handleImage
19+
20+
visible: false
21+
source: Theme.imgSliderHandle
22+
fillMode: Image.PreserveAspectFit
23+
}
24+
25+
handle: Item {
26+
id: handleItem
27+
28+
width: handleImage.paintedWidth
29+
height: handleImage.paintedHeight
30+
x: root.horizontal ? (root.visualPosition * (root.width - width)) : ((root.width - width) / 2)
31+
y: root.vertical ? (root.visualPosition * (root.height - height)) : ((root.height - height) / 2)
32+
33+
DropShadow {
34+
source: handleImage
35+
width: parent.width + 5
36+
height: parent.height + 5
37+
radius: 5
38+
verticalOffset: 5
39+
color: "#80000000"
40+
}
41+
}
42+
43+
background: Image {
44+
id: backgroundImage
45+
46+
anchors.fill: parent
47+
anchors.margins: root.barMargin
48+
}
49+
}

0 commit comments

Comments
 (0)