[vlc-devel] [PATCH 14/29] qml: use contextButton

Abel Tesfaye abeltesfaye45 at gmail.com
Tue Aug 20 12:42:31 CEST 2019


From: Abel Tesfaye <Abeltesfaye45 at gmail.com>

---
 modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml | 6 ++++++
 modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml  | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
index 748dfb2100..9f544701ff 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplay.qml
@@ -44,6 +44,12 @@ Utils.ListItem {
     line2: model.mrl
     imageText: model.type === MLNetworkModel.TYPE_SHARE ? model.protocol : ""
 
+    showContextButton: true
+    onContextMenuButtonClicked: {
+        contextMenu.model = model
+        contextMenu.popup(menuParent,contextMenu.width,0)
+    }
+
     onItemClicked : {
         delegateModel.updateSelection( modifier, view.currentIndex, index )
         view.currentIndex = index
diff --git a/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml b/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml
index 3a0cd71902..410583a2f3 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkFileDisplay.qml
@@ -40,6 +40,12 @@ Utils.ListItem {
     line1: model.name || qsTr("Unknown share")
     line2: model.mrl
 
+    showContextButton: true
+    onContextMenuButtonClicked: {
+        contextMenu.model = model
+        contextMenu.popup(menuParent,contextMenu.width,0)
+    }
+
     onItemClicked : {
         delegateModel.updateSelection( modifier, view.currentIndex, index )
         view.currentIndex = index
-- 
2.21.0



More information about the vlc-devel mailing list