[vlc-commits] [Git][videolan/vlc][master] 11 commits: qml: introduce MLTableColumns

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jun 11 08:16:56 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c91b4ee9 by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: introduce MLTableColumns

- - - - -
9e6eab0e by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in MusicAlbums

- - - - -
1ecaa92e by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in MusicAlbumsGridExpandDelegate

- - - - -
1fa4e112 by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in MusicAllArtist

- - - - -
dac983a5 by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in MusicArtist

- - - - -
9f7fd713 by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in MusicGenres

- - - - -
6041c1dd by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in MusicTrackListDisplay

- - - - -
92dc2e4f by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in PlaylistMedia

- - - - -
fc299a9a by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in UrlListDisplay

- - - - -
651c047e by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: use MLTableColumns in VideoListDisplay

- - - - -
70ca0e41 by Prince Gupta at 2024-06-11T07:58:05+00:00
qml: separate play click handling in TableColumns

don't use MediaLib in TableColumns

- - - - -


13 changed files:

- modules/gui/qt/Makefile.am
- modules/gui/qt/medialibrary/qml/MusicAlbums.qml
- modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
- modules/gui/qt/medialibrary/qml/MusicAllArtists.qml
- modules/gui/qt/medialibrary/qml/MusicArtist.qml
- modules/gui/qt/medialibrary/qml/MusicGenres.qml
- modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
- modules/gui/qt/medialibrary/qml/PlaylistMedia.qml
- modules/gui/qt/medialibrary/qml/UrlListDisplay.qml
- modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
- modules/gui/qt/qml.qrc
- + modules/gui/qt/widgets/qml/MLTableColumns.qml
- modules/gui/qt/widgets/qml/TableColumns.qml


Changes:

=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -1091,6 +1091,7 @@ libqt_plugin_la_QML = \
 	widgets/qml/PageLoader.qml \
 	widgets/qml/ButtonExt.qml \
 	widgets/qml/TableColumns.qml \
+	widgets/qml/MLTableColumns.qml \
 	widgets/qml/TextFieldExt.qml \
 	widgets/qml/TextToolButton.qml \
 	widgets/qml/TrackDelayButton.qml \


=====================================
modules/gui/qt/medialibrary/qml/MusicAlbums.qml
=====================================
@@ -251,7 +251,7 @@ MainInterface.MainViewLoader {
             }
             onItemDoubleClicked: (index, model) => MediaLib.addAndPlay( model.id )
 
-            Widgets.TableColumns {
+            Widgets.MLTableColumns {
                 id: tableColumns
 
                 showCriterias: (tableView_id.sortModel === tableView_id._modelSmall)


=====================================
modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
=====================================
@@ -465,7 +465,7 @@ FocusScope {
             Navigation.leftItem: VLCStyle.isScreenSmall ? null : root.enqueueActionBtn
             Navigation.upItem: headerItem
 
-            Widgets.TableColumns {
+            Widgets.MLTableColumns {
                 id: tableColumns
             }
         }


=====================================
modules/gui/qt/medialibrary/qml/MusicAllArtists.qml
=====================================
@@ -211,7 +211,7 @@ MainInterface.MainViewLoader {
                 contextMenu.popup(selectionModel.selectedIndexes, globalMousePos)
             }
 
-            Widgets.TableColumns {
+            Widgets.MLTableColumns {
                 id: tableColumns
 
                 showCriterias: (artistTable.sortModel === artistTable._modelSmall)


=====================================
modules/gui/qt/medialibrary/qml/MusicArtist.qml
=====================================
@@ -520,7 +520,7 @@ FocusScope {
                 defaultCover: VLCStyle.noArtArtistCover
             }
 
-            Widgets.TableColumns {
+            Widgets.MLTableColumns {
                 id: tableColumns
 
                 showCriterias: (tableView_id.sortModel === tableView_id._modelSmall)


=====================================
modules/gui/qt/medialibrary/qml/MusicGenres.qml
=====================================
@@ -290,7 +290,7 @@ MainInterface.MainViewLoader {
                 contextMenu.popup(selectionModel.selectedIndexes, globalMousePos)
             }
 
-            Widgets.TableColumns {
+            Widgets.MLTableColumns {
                 id: tableColumns
 
                 showTitleText: (tableView_id.sortModel === tableView_id._modelSmall)


=====================================
modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
=====================================
@@ -205,7 +205,7 @@ Widgets.KeyNavigableTableView {
         mlModel: model
     }
 
-    Widgets.TableColumns {
+    Widgets.MLTableColumns {
         id: tableColumns
 
         showCriterias: (root.sortModel === root._modelSmall)


=====================================
modules/gui/qt/medialibrary/qml/PlaylistMedia.qml
=====================================
@@ -250,7 +250,7 @@ MainInterface.MainTableView {
     // Childs
     //---------------------------------------------------------------------------------------------
 
-    Widgets.TableColumns {
+    Widgets.MLTableColumns {
         id: table
 
         titleCover_width: isMusic ? VLCStyle.trackListAlbumCover_width


=====================================
modules/gui/qt/medialibrary/qml/UrlListDisplay.qml
=====================================
@@ -107,7 +107,7 @@ Widgets.KeyNavigableTableView {
     }
 
 
-    Widgets.TableColumns {
+    Widgets.MLTableColumns {
         id: tableColumns
     }
 }


=====================================
modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
=====================================
@@ -121,7 +121,7 @@ MainInterface.MainTableView {
     // Childs
     //---------------------------------------------------------------------------------------------
 
-    Widgets.TableColumns {
+    Widgets.MLTableColumns {
         id: tableColumns
 
         showTitleText: (listView_id.sortModel === listView_id._modelSmall)


=====================================
modules/gui/qt/qml.qrc
=====================================
@@ -45,6 +45,7 @@
         <file alias="KeyNavigableTableView.qml">widgets/qml/KeyNavigableTableView.qml</file>
         <file alias="TableViewDelegate.qml">widgets/qml/TableViewDelegate.qml</file>
         <file alias="TableColumns.qml">widgets/qml/TableColumns.qml</file>
+        <file alias="MLTableColumns.qml">widgets/qml/MLTableColumns.qml</file>
         <file alias="TableHeaderDelegate.qml">widgets/qml/TableHeaderDelegate.qml</file>
         <file alias="TableRowDelegate.qml">widgets/qml/TableRowDelegate.qml</file>
         <file alias="ImageToolButton.qml">widgets/qml/ImageToolButton.qml</file>


=====================================
modules/gui/qt/widgets/qml/MLTableColumns.qml
=====================================
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+
+import org.videolan.medialib 0.1
+
+
+TableColumns {
+
+    onPlayClicked: function (model) {
+        MediaLib.addAndPlay(model.id)
+        History.push(["player"])
+    }
+}


=====================================
modules/gui/qt/widgets/qml/TableColumns.qml
=====================================
@@ -20,7 +20,6 @@ import QtQuick.Controls
 import QtQuick.Layouts
 
 import org.videolan.vlc 0.1
-import org.videolan.medialib 0.1
 
 import "qrc:///widgets/" as Widgets
 import "qrc:///util/Helpers.js" as Helpers
@@ -47,6 +46,10 @@ Item {
         return []
     }
 
+    // this is called in reponse to user request to play
+    // model is associated row data of delegate
+    signal playClicked(var model)
+
     function getCriterias(colModel, rowModel) {
         if (colModel === null || rowModel === null)
             return ""
@@ -99,10 +102,6 @@ Item {
 
                 playCoverVisible: (titleDel.currentlyFocused || titleDel.containsMouse)
                 playIconSize: VLCStyle.play_cover_small
-                onPlayIconClicked: {
-                    MediaLib.addAndPlay(titleDel.rowModel.id)
-                    History.push(["player"])
-                }
                 radius: root.titleCover_radius
                 color: titleDel.colorContext.bg.secondary
 
@@ -128,6 +127,8 @@ Item {
 
                     sourceItem: parent
                 }
+
+                onPlayIconClicked: root.playClicked(titleDel.rowModel)
             }
 
             Column {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7cdad4b03b6484a0e52fcc4007297b9953d3c890...70ca0e41310296f86c5378a6f490a9ce626b0b58

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7cdad4b03b6484a0e52fcc4007297b9953d3c890...70ca0e41310296f86c5378a6f490a9ce626b0b58
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list