Skip to content

Commit 2b9ea64

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

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

res/qml/Library.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ Item {
106106
LibraryComponent.TrackList {
107107
SplitView.fillHeight: true
108108

109+
clip: true
110+
109111
model: root.sidebar.tracklist
110112
}
111113
}

res/qml/Library/Browser.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ Rectangle {
117117
id: lineIcon
118118
anchors.left: parent.left
119119
anchors.verticalCenter: parent.verticalCenter
120-
model: icon != null ? 1 : 0
120+
model: !!icon ? 1 : 0
121121
Image {
122-
visible: depth == 0
123-
source: icon ? `images/library_${icon}.png` : null
122+
visible: depth == 0 && icon
123+
source: icon
124124
height: 25
125125
width: 25
126126
}

res/qml/Library/SourceTree.qml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ Mixxx.LibrarySourceTree {
99
component DefaultDelegate: LibraryComponent.Cell {
1010
id: cell
1111
readonly property var caps: capabilities
12-
Drag.active: dragArea.drag.active
12+
// FIXME: https://bugreports.qt.io/browse/QTBUG-111789
13+
Binding on Drag.active {
14+
value: dragArea.drag.active
15+
// This delays the update until the even queue is cleared
16+
// preventing any potential oscillations causing a loop
17+
delayed: true
18+
}
1319

1420
LibraryComponent.Track {
1521
id: dragArea
@@ -21,7 +27,7 @@ Mixxx.LibrarySourceTree {
2127
tableView.selectionModel.selectRow(row);
2228
parent.dragImage.grabToImage((result) => {
2329
parent.Drag.imageSource = result.url;
24-
});
30+
}, Qt.size(parent.dragImage.width, parent.dragImage.height));
2531
}
2632
}
2733
onDoubleClicked: {
@@ -35,7 +41,7 @@ Mixxx.LibrarySourceTree {
3541
anchors.fill: parent
3642
anchors.leftMargin: 15
3743
font.pixelSize: 14
38-
text: display
44+
text: display ?? ""
3945
verticalAlignment: Text.AlignVCenter
4046
elide: Text.ElideRight
4147
color: Theme.textColor

src/qml/qmllibrarysource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "track/track.h"
2424

2525
AllTrackLibraryFeature::AllTrackLibraryFeature(Library* pLibrary, UserSettingsPointer pConfig)
26-
: LibraryFeature(pLibrary, pConfig, QStringLiteral("tracks")),
26+
: LibraryFeature(pLibrary, pConfig, QStringLiteral("")),
2727
m_pSidebarModel(make_parented<TreeItemModel>(this)),
2828
m_pLibraryTableModel(pLibrary->trackTableModel()) {
2929
m_pSidebarModel->setRootItem(TreeItem::newRoot(this));

src/qml/qmllibrarysourcetree.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class QmlLibrarySourceTree : public QQuickItem {
2020
Q_OBJECT
2121
Q_INTERFACES(QQmlParserStatus)
2222
Q_PROPERTY(QQmlListProperty<QmlLibrarySource> sources READ sources)
23-
Q_PROPERTY(QQmlListProperty<QmlLibraryTrackListColumn> defaultColumns READ defaultColumns FINAL)
23+
Q_PROPERTY(QQmlListProperty<QmlLibraryTrackListColumn> defaultColumns READ
24+
defaultColumns CONSTANT)
2425
Q_CLASSINFO("DefaultProperty", "sources")
2526
QML_NAMED_ELEMENT(LibrarySourceTree)
2627

0 commit comments

Comments
 (0)