Skip to content

Commit f78d8ff

Browse files
committed
feat: add Library cappability on QML
1 parent 0c1fd9a commit f78d8ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2747
-189
lines changed

CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2830,6 +2830,9 @@ if(LOCALECOMPARE)
28302830
)
28312831
endif()
28322832
target_compile_definitions(mixxx-lib PUBLIC __SQLITE3__)
2833+
if(QML)
2834+
target_compile_definitions(mixxx-lib PUBLIC __SQLITE3__)
2835+
endif()
28332836
target_link_libraries(mixxx-lib PRIVATE SQLite::SQLite3)
28342837
elseif(SQLite3_IS_STATIC)
28352838
# in the static case we need to link SQLite3 uncoditionally
@@ -3364,6 +3367,15 @@ if(QML)
33643367

33653368
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
33663369
qt_add_library(mixxx-qml-lib STATIC)
3370+
3371+
if(WIN)
3372+
target_compile_definitions(mixxx-qml-lib PUBLIC __WINDOWS__)
3373+
endif()
3374+
3375+
if(ENGINEPRIME)
3376+
target_compile_definitions(mixxx-qml-lib PUBLIC __ENGINEPRIME__)
3377+
endif()
3378+
33673379
foreach(component ${QT_COMPONENTS})
33683380
target_link_libraries(
33693381
mixxx-qml-lib
@@ -3445,10 +3457,18 @@ if(QML)
34453457
src/qml/qmleffectslotproxy.cpp
34463458
src/qml/qmleffectsmanagerproxy.cpp
34473459
src/qml/qmllibraryproxy.cpp
3460+
src/qml/qmllibrarysource.cpp
3461+
src/qml/qmllibrarysourcetree.cpp
34483462
src/qml/qmllibrarytracklistmodel.cpp
3463+
src/qml/qmllibrarytreeviewmodel.cpp
34493464
src/qml/qmlmixxxcontrollerscreen.cpp
34503465
src/qml/qmlplayermanagerproxy.cpp
34513466
src/qml/qmlplayerproxy.cpp
3467+
src/qml/qmlplaylistproxy.cpp
3468+
src/qml/qmlcrateproxy.cpp
3469+
src/qml/qmlsidebarmodelproxy.cpp
3470+
src/qml/qmllibrarytracklistcolumn.cpp
3471+
src/qml/qmltrackproxy.cpp
34523472
src/qml/qmlvisibleeffectsmodel.cpp
34533473
src/qml/qmlwaveformdisplay.cpp
34543474
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)