[vlc-devel] [PATCH 15/15] qml/PlaylistMediaDisplay: Add keyboard delete support
Benjamin Arnaud
benjamin.arnaud at videolabs.io
Thu Mar 11 09:16:59 UTC 2021
---
.../qt/medialibrary/qml/PlaylistMediaDisplay.qml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml b/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
index 4a14da18aa..8dd976cb2b 100644
--- a/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
@@ -108,6 +108,19 @@ Widgets.NavigableFocusScope {
currentItem.positionViewAtIndex(initialIndex, ItemView.Contain);
}
+ //---------------------------------------------------------------------------------------------
+ // Events
+
+ function onDelete()
+ {
+ var indexes = modelSelect.selectedIndexes;
+
+ if (indexes.length === 0)
+ return;
+
+ model.remove(indexes);
+ }
+
//---------------------------------------------------------------------------------------------
// Private
@@ -232,6 +245,8 @@ Widgets.NavigableFocusScope {
menuParent.mapToGlobal(0,0))
onRightClick: contextMenu.popup(modelSelect.selectedIndexes, globalMousePos)
+
+ Keys.onDeletePressed: onDelete()
}
EmptyLabel {
--
2.25.1
More information about the vlc-devel
mailing list