[vlc-commits] qml: fix contextMenu to item

Abel Tesfaye git at videolan.org
Tue Jul 30 17:57:17 CEST 2019


vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Wed Jul 17 18:07:25 2019 +0300| [1c93dbb29583d34280b7915fc08d3320fb5e6b73] | committer: Jean-Baptiste Kempf

qml: fix contextMenu to item

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1c93dbb29583d34280b7915fc08d3320fb5e6b73
---

 modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml      | 2 +-
 modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml | 4 ++--
 modules/gui/qt/qml/utils/GridItem.qml                  | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
index 6b1f3e5742..59dfaf8456 100644
--- a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
@@ -326,7 +326,7 @@ Utils.NavigableFocusScope {
                         onGridItemClicked: {
                             if (key == Qt.RightButton){
                                 contextMenu.model = delegateModelItem.model
-                                contextMenu.popup()
+                                contextMenu.popup(menuParent)
                             }
                             videosDelegate.updateSelection( modifier , view.currentItem.currentIndexVideos, delegateModelItem.itemsIndex)
                             view.currentItem.currentIndexVideos = delegateModelItem.itemsIndex
diff --git a/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml b/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml
index c731b368f1..1d7e4f61a4 100644
--- a/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml
+++ b/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml
@@ -26,7 +26,7 @@ import "qrc:///style/"
 
 Utils.ExpandGridView {
     id: expandableGV
-    signal gridItemClicked(int key,int modifier,variant delegateModelItem)
+    signal gridItemClicked(Item menuParent,int key,int modifier,variant delegateModelItem)
     signal gridItemContextButtonClicked(Item menuParent,variant delegateModelItem)
     signal gridItemSelectedChanged(bool selected,Item item)
 
@@ -62,7 +62,7 @@ Utils.ExpandGridView {
         pictureWidth: expandableGV.gridDelegatePictureWidth
         pictureHeight: expandableGV.gridDelegatePictureHeight
 
-        onItemClicked : expandableGV.gridItemClicked(key,modifier, delegateModelItem)
+        onItemClicked : expandableGV.gridItemClicked(menuParent,key,modifier, delegateModelItem)
 
         onPlayClicked: medialib.addAndPlay( delegateModelItem.model.id )
         onAddToPlaylistClicked : medialib.addToPlaylist( delegateModelItem.model.id )
diff --git a/modules/gui/qt/qml/utils/GridItem.qml b/modules/gui/qt/qml/utils/GridItem.qml
index 7c0c41c0b4..e8ac3490eb 100644
--- a/modules/gui/qt/qml/utils/GridItem.qml
+++ b/modules/gui/qt/qml/utils/GridItem.qml
@@ -51,8 +51,8 @@ Rectangle {
 
     signal playClicked
     signal addToPlaylistClicked
-    signal itemClicked(int key, int modifier)
-    signal itemDoubleClicked(int keys, int modifier)
+    signal itemClicked(Item menuParent, int key, int modifier)
+    signal itemDoubleClicked(Item menuParent, int keys, int modifier)
     signal contextMenuButtonClicked(Item menuParent)
 
     
@@ -66,8 +66,8 @@ Rectangle {
         MouseArea {
             id: mouseArea
             hoverEnabled: true
-            onClicked: root.itemClicked(mouse.button, mouse.modifiers)
-            onDoubleClicked: root.itemDoubleClicked(mouse.buttons,
+            onClicked: root.itemClicked(cover_bg,mouse.button, mouse.modifiers)
+            onDoubleClicked: root.itemDoubleClicked(cover_bg,mouse.buttons,
                                                     mouse.modifiers)
             width: childrenRect.width
             height: childrenRect.height



More information about the vlc-commits mailing list