Skip to content

Commit 67f4125

Browse files
committed
feat: add Library cappability on QML
1 parent 2c1d614 commit 67f4125

37 files changed

+2171
-225
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,6 +3474,15 @@ if(QML)
34743474

34753475
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
34763476
qt_add_library(mixxx-qml-lib STATIC)
3477+
3478+
if(WIN32)
3479+
target_compile_definitions(mixxx-qml-lib PUBLIC __WINDOWS__)
3480+
endif()
3481+
3482+
if(ENGINEPRIME)
3483+
target_compile_definitions(mixxx-qml-lib PUBLIC __ENGINEPRIME__)
3484+
endif()
3485+
34773486
foreach(component ${QT_COMPONENTS})
34783487
target_link_libraries(
34793488
mixxx-qml-lib
@@ -3555,10 +3564,15 @@ if(QML)
35553564
src/qml/qmleffectslotproxy.cpp
35563565
src/qml/qmleffectsmanagerproxy.cpp
35573566
src/qml/qmllibraryproxy.cpp
3567+
src/qml/qmllibrarysource.cpp
3568+
src/qml/qmllibrarysourcetree.cpp
35583569
src/qml/qmllibrarytracklistmodel.cpp
35593570
src/qml/qmlmixxxcontrollerscreen.cpp
35603571
src/qml/qmlplayermanagerproxy.cpp
35613572
src/qml/qmlplayerproxy.cpp
3573+
src/qml/qmlsidebarmodelproxy.cpp
3574+
src/qml/qmllibrarytracklistcolumn.cpp
3575+
src/qml/qmltrackproxy.cpp
35623576
src/qml/qmlvisibleeffectsmodel.cpp
35633577
src/qml/qmlwaveformdisplay.cpp
35643578
src/qml/qmlwaveformoverview.cpp

res/qml/ActionButton.qml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import QtQuick
2+
import QtQuick.Controls 2.12
3+
import Qt5Compat.GraphicalEffects
4+
import "Theme"
5+
6+
AbstractButton {
7+
id: root
8+
enum Category {
9+
None,
10+
Danger,
11+
Action
12+
}
13+
14+
property var category: ActionButton.Category.None
15+
property alias label: labelField
16+
17+
implicitHeight: 24
18+
background: Item {
19+
Rectangle {
20+
id: content
21+
anchors.fill: parent
22+
color: root.category == ActionButton.Category.Action ? '#2D4EA1' : root.category == ActionButton.Category.Danger ? '#7D3B3B' : '#3F3F3F'
23+
radius: 4
24+
}
25+
DropShadow {
26+
anchors.fill: parent
27+
source: content
28+
horizontalOffset: 0
29+
verticalOffset: 0
30+
radius: 8.0
31+
color: "#80000000"
32+
}
33+
}
34+
contentItem: Item {
35+
Label {
36+
id: labelField
37+
anchors.fill: parent
38+
horizontalAlignment: Text.AlignHCenter
39+
verticalAlignment: Text.AlignVCenter
40+
font.family: Theme.fontFamily
41+
font.capitalization: Font.AllUppercase
42+
font.bold: true
43+
font.pixelSize: Theme.buttonFontPixelSize
44+
color: Theme.white
45+
}
46+
}
47+
}

res/qml/ActionPopup.qml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import QtQml
2+
import QtQuick
3+
import QtQml.Models
4+
import QtQuick.Layouts
5+
import QtQuick.Controls 2.15
6+
import QtQuick.Shapes 1.12
7+
import Qt5Compat.GraphicalEffects
8+
import "Theme"
9+
10+
Popup {
11+
id: root
12+
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
13+
width: 200
14+
15+
padding: 0
16+
margins: 0
17+
leftInset: 0
18+
19+
default property alias children: content.children
20+
21+
contentItem: Item {
22+
ColumnLayout {
23+
spacing: 2
24+
anchors.fill: parent
25+
anchors.leftMargin: 20
26+
id: content
27+
}
28+
}
29+
30+
background: Item {
31+
Item {
32+
id: content3
33+
anchors.fill: parent
34+
Shape {
35+
anchors.left: parent.left
36+
anchors.verticalCenter: parent.verticalCenter
37+
implicitHeight: 20
38+
ShapePath {
39+
strokeWidth: 0
40+
strokeColor: 'transparent'
41+
fillColor: Theme.backgroundColor
42+
fillRule: ShapePath.OddEvenFill
43+
44+
startX: 0
45+
startY: 10
46+
PathLine { x: 20; y: 0 }
47+
PathLine { x: 20; y: 20 }
48+
PathLine { x: 0; y: 10 }
49+
}
50+
}
51+
Rectangle {
52+
anchors.fill: parent
53+
anchors.right: parent.right
54+
anchors.leftMargin: 20
55+
border.width: 0
56+
radius: 8
57+
color: Theme.backgroundColor
58+
}
59+
}
60+
DropShadow {
61+
anchors.fill: parent
62+
source: content3
63+
horizontalOffset: 0
64+
verticalOffset: 0
65+
radius: 8.0
66+
color: "#80000000"
67+
}
68+
}
69+
}

res/qml/DeckInfoBar.qml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Rectangle {
1111
required property string group
1212
required property int rightColumnWidth
1313
property var deckPlayer: Mixxx.PlayerManager.getPlayer(group)
14+
property var currentTrack: deckPlayer.currentTrack
1415
property color lineColor: Theme.deckLineColor
1516

1617
border.width: 2
@@ -26,7 +27,7 @@ Rectangle {
2627
anchors.bottom: parent.bottom
2728
anchors.margins: 5
2829
width: height
29-
source: root.deckPlayer.coverArtUrl
30+
source: root.currentTrack.coverArtUrl
3031
visible: false
3132
asynchronous: true
3233
}
@@ -95,7 +96,7 @@ Rectangle {
9596
Skin.EmbeddedText {
9697
id: infoBarTitle
9798

98-
text: root.deckPlayer.title
99+
text: root.currentTrack.title
99100
anchors.top: infoBarHSeparator1.top
100101
anchors.left: infoBarVSeparator.left
101102
anchors.right: infoBarHSeparator1.left
@@ -119,7 +120,7 @@ Rectangle {
119120
Skin.EmbeddedText {
120121
id: infoBarArtist
121122

122-
text: root.deckPlayer.artist
123+
text: root.currentTrack.artist
123124
anchors.top: infoBarVSeparator.bottom
124125
anchors.left: infoBarVSeparator.left
125126
anchors.right: infoBarHSeparator1.left
@@ -144,7 +145,7 @@ Rectangle {
144145
Skin.EmbeddedText {
145146
id: infoBarKey
146147

147-
text: root.deckPlayer.keyText
148+
text: root.currentTrack.keyText
148149
anchors.top: infoBarHSeparator1.top
149150
anchors.bottom: infoBarVSeparator.top
150151
anchors.right: infoBarHSeparator2.left
@@ -206,11 +207,11 @@ Rectangle {
206207
GradientStop {
207208
position: 0
208209
color: {
209-
const trackColor = root.deckPlayer.color;
210+
const trackColor = root.currentTrack.color;
210211
if (!trackColor.valid)
211212
return Theme.deckBackgroundColor;
212213

213-
return Qt.darker(root.deckPlayer.color, 2);
214+
return Qt.darker(root.currentTrack.color, 2);
214215
}
215216
}
216217

res/qml/InputField.qml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import QtQuick
2+
import QtQuick.Controls 2.15
3+
import Qt5Compat.GraphicalEffects
4+
import "Theme"
5+
6+
FocusScope {
7+
id: root
8+
9+
property alias input: inputField
10+
11+
Rectangle {
12+
id: backgroundInput
13+
radius: 4
14+
color: '#232323'
15+
anchors.fill: parent
16+
}
17+
DropShadow {
18+
id: dropSetting
19+
anchors.fill: parent
20+
horizontalOffset: 0
21+
verticalOffset: 0
22+
radius: 4.0
23+
color: "#000000"
24+
source: backgroundInput
25+
}
26+
InnerShadow {
27+
id: effect2
28+
anchors.fill: parent
29+
source: dropSetting
30+
spread: 0.2
31+
radius: 12
32+
samples: 24
33+
horizontalOffset: 0
34+
verticalOffset: 0
35+
color: "#353535"
36+
}
37+
TextInput {
38+
id: inputField
39+
anchors.fill: parent
40+
anchors.verticalCenter: parent.verticalCenter
41+
anchors.horizontalCenter: parent.horizontalCenter
42+
anchors.margins: 7
43+
focus: true
44+
clip: true
45+
color: acceptableInput ? "#FFFFFF" : "#7D3B3B"
46+
horizontalAlignment: TextInput.AlignLeft
47+
}
48+
}

0 commit comments

Comments
 (0)