[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml/PlaylistMediaList: Fix the double click on the list

Jean-Baptiste Kempf gitlab at videolan.org
Sat Jun 12 07:33:59 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
b53a4e4d by Benjamin Arnaud at 2021-06-12T06:51:13+00:00
qml/PlaylistMediaList: Fix the double click on the list

- - - - -
88b723a9 by Benjamin Arnaud at 2021-06-12T06:51:13+00:00
qml/VideoAll: Fix the play behavior on the list

- - - - -
2012949a by Benjamin Arnaud at 2021-06-12T06:51:13+00:00
qml/MainDisplay: Add the 'play' function

And update MediaGroupList and VideoAll components.

- - - - -
6741fa8b by Benjamin Arnaud at 2021-06-12T06:51:13+00:00
qml/TableColumns: Fix the MediaCover play behavior

- - - - -


5 changed files:

- modules/gui/qt/maininterface/qml/MainDisplay.qml
- modules/gui/qt/medialibrary/qml/MediaGroupList.qml
- modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
- modules/gui/qt/medialibrary/qml/VideoAll.qml
- modules/gui/qt/widgets/qml/TableColumns.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -161,6 +161,12 @@ Widgets.NavigableFocusScope {
         history.push(["player"])
     }
 
+    function play(backend, ids) {
+        showPlayer();
+
+        backend.addAndPlay(ids);
+    }
+
     Rectangle {
         color: VLCStyle.colors.bg
         anchors.fill: parent


=====================================
modules/gui/qt/medialibrary/qml/MediaGroupList.qml
=====================================
@@ -118,24 +118,18 @@ Widgets.NavigableFocusScope {
 
     function _actionAtIndex() {
         if (modelSelect.selectedIndexes.length > 1) {
-            _play(model.getIdsForIndexes(modelSelect.selectedIndexes));
+            g_mainDisplay.play(medialib, model.getIdsForIndexes(modelSelect.selectedIndexes));
         } else if (modelSelect.selectedIndexes.length === 1) {
             var index = modelSelect.selectedIndexes[0];
             _showList(model.getDataAt(index));
         }
     }
 
-    function _play(ids) {
-        g_mainDisplay.showPlayer();
-
-        medialib.addAndPlay(ids);
-    }
-
     function _showList(model)
     {
         // NOTE: If the count is 1 we consider the group is a media.
         if (model.count == 1)
-            _play(model.id);
+            g_mainDisplay.play(medialib, model.id);
         else
             showList(model);
     }


=====================================
modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
=====================================
@@ -398,6 +398,8 @@ Widgets.NavigableFocusScope {
 
             onActionForSelection: _actionAtIndex()
 
+            onItemDoubleClicked: showList(model)
+
             onContextMenuButtonClicked: contextMenu.popup(modelSelect.selectedIndexes,
                                                           menuParent.mapToGlobal(0,0))
 


=====================================
modules/gui/qt/medialibrary/qml/VideoAll.qml
=====================================
@@ -266,11 +266,7 @@ Widgets.NavigableFocusScope {
 
                 onItemClicked: gridView.leftClickOnItem(modifier, index)
 
-                onItemDoubleClicked: {
-                    g_mainDisplay.showPlayer();
-
-                    medialib.addAndPlay(model.id);
-                }
+                onItemDoubleClicked: g_mainDisplay.play(medialib, model.id)
 
                 onContextMenuButtonClicked: {
                     gridView.rightClickOnItem(index);
@@ -342,7 +338,9 @@ Widgets.NavigableFocusScope {
             //-------------------------------------------------------------------------------------
             // Events
 
-            onActionForSelection: medialib.addAndPlay(model.getIdsForIndexes(selection))
+            onActionForSelection: _actionAtIndex()
+
+            onItemDoubleClicked: g_mainDisplay.play(medialib, model.id)
 
             onContextMenuButtonClicked: contextMenu.popup(modelSelect.selectedIndexes,
                                                           menuParent.mapToGlobal(0,0))


=====================================
modules/gui/qt/widgets/qml/TableColumns.qml
=====================================
@@ -61,7 +61,7 @@ Item {
                 source: (rowModel ? (root.showTitleText ? rowModel.cover : rowModel[model.criteria]) : VLCStyle.noArtCover) || VLCStyle.noArtCover
                 playCoverVisible: currentlyFocused || containsMouse
                 playIconSize: VLCStyle.play_cover_small
-                onPlayIconClicked: medialib.addAndPlay( rowModel.id )
+                onPlayIconClicked: g_mainDisplay.play(medialib, rowModel.id)
                 radius: root.titleCover_radius
 
                 imageOverlay: Item {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b34e29c026c9f93b39cbd549b3e5986377882c07...6741fa8bbf22686b5c9e8162823f53e3d5cb400f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b34e29c026c9f93b39cbd549b3e5986377882c07...6741fa8bbf22686b5c9e8162823f53e3d5cb400f
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list