[vlc-devel] [PATCH 09/16] qml: use MCVideoListDisplay

Abel Tesfaye abeltesfaye45 at gmail.com
Fri Aug 9 17:23:46 CEST 2019


From: Abel Tesfaye <Abeltesfaye45 at gmail.com>

---
 .../gui/qt/qml/mediacenter/MCVideoDisplay.qml | 32 +++++++------------
 .../qt/qml/mediacenter/MCVideoListDisplay.qml |  2 +-
 2 files changed, 13 insertions(+), 21 deletions(-)

diff --git a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
index 59dfaf8456..62cb23b218 100644
--- a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
@@ -62,7 +62,7 @@ Utils.NavigableFocusScope {
                onTriggered: medialib.addToPlaylist( contextMenu.model.id )
            }
            Utils.MenuItemExt {
-               enabled:root.currentGridView.switchExpandItem !== undefined
+               enabled: root.currentGridView && root.currentGridView.switchExpandItem !== undefined
                text: "Information"
                onTriggered: {
                    root.currentGridView.switchExpandItem(contextMenu.model.index,root.currentGridView.currentItem)
@@ -384,25 +384,17 @@ Utils.NavigableFocusScope {
 
     Component {
         id: listComponent
-        /* ListView */
-        Utils.KeyNavigableListView {
-            id: listView_id
-
-            model: videosDelegate.parts.list
-            modelCount: videosDelegate.items.count
-
-            focus: true
-            spacing: VLCStyle.margin_xxxsmall
-
-            onSelectAll: videosDelegate.selectAll()
-            onSelectionUpdated: videosDelegate.updateSelection( keyModifiers, oldIndex, newIndex )
-            onActionAtIndex: videosDelegate.actionAtIndex(index)
-
-            onActionLeft: root.actionLeft(index)
-            onActionRight: root.actionRight(index)
-            onActionDown: root.actionDown(index)
-            onActionUp: root.actionUp(index)
-            onActionCancel: root.actionCancel(index)
+        MCVideoListDisplay {
+            height: view.height
+            width: view.width
+            onContextMenuButtonClicked:{
+                contextMenu.model = menuModel
+                contextMenu.popup(menuParent)
+            }
+            onRightClick:{
+                contextMenu.model = menuModel
+                contextMenu.popup(menuParent)
+            }
         }
     }
 
diff --git a/modules/gui/qt/qml/mediacenter/MCVideoListDisplay.qml b/modules/gui/qt/qml/mediacenter/MCVideoListDisplay.qml
index 887b088f25..28c81f1b1f 100644
--- a/modules/gui/qt/qml/mediacenter/MCVideoListDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCVideoListDisplay.qml
@@ -37,7 +37,7 @@ Utils.KeyNavigableTableView {
     }
     section.property: "title_first_symbol"
 
-    rowHeight: VLCStyle.video_small_height
+    rowHeight: VLCStyle.video_small_height + VLCStyle.margin_normal
 
     headerColor: VLCStyle.colors.bg
     spacing: VLCStyle.margin_small
-- 
2.21.0



More information about the vlc-devel mailing list