[vlc-devel] [PATCH 4/6] qml: introduce MainGridView and MainTableView in MainInterface

Prince Gupta guptaprince8832 at gmail.com
Fri Nov 20 18:38:54 CET 2020


for now they provide bottom margin for main views when miniplayer is visible
---
 modules/gui/qt/Makefile.am                    |  2 ++
 .../gui/qt/maininterface/qml/MainGridView.qml | 28 ++++++++++++++++++
 .../qt/maininterface/qml/MainTableView.qml    | 29 +++++++++++++++++++
 modules/gui/qt/vlc.qrc                        |  2 ++
 4 files changed, 61 insertions(+)
 create mode 100644 modules/gui/qt/maininterface/qml/MainGridView.qml
 create mode 100644 modules/gui/qt/maininterface/qml/MainTableView.qml

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 10d111567c..ebf58a2171 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -615,6 +615,8 @@ libqt_plugin_la_QML = \
 	gui/qt/maininterface/qml/BannerSources.qml \
 	gui/qt/maininterface/qml/MainInterface.qml \
 	gui/qt/maininterface/qml/MainDisplay.qml \
+	gui/qt/maininterface/qml/MainGridView.qml \
+	gui/qt/maininterface/qml/MainTableView.qml \
 	gui/qt/maininterface/qml/MiniPlayerBottomMargin.qml \
 	gui/qt/maininterface/qml/NoMedialibHome.qml \
 	gui/qt/medialibrary/qml/ArtistTopBanner.qml \
diff --git a/modules/gui/qt/maininterface/qml/MainGridView.qml b/modules/gui/qt/maininterface/qml/MainGridView.qml
new file mode 100644
index 0000000000..e8bb76c32f
--- /dev/null
+++ b/modules/gui/qt/maininterface/qml/MainGridView.qml
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (C) 2020 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 QtQuick 2.11
+
+import "qrc:///widgets/" as Widgets
+
+Widgets.ExpandGridView {
+    id: root
+
+    footerDelegate: MiniPlayerBottomMargin {
+        width: root.width
+    }
+}
diff --git a/modules/gui/qt/maininterface/qml/MainTableView.qml b/modules/gui/qt/maininterface/qml/MainTableView.qml
new file mode 100644
index 0000000000..0828a16e1f
--- /dev/null
+++ b/modules/gui/qt/maininterface/qml/MainTableView.qml
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (C) 2020 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 QtQuick 2.11
+
+import "qrc:///widgets/" as Widgets
+
+Widgets.KeyNavigableTableView {
+    id: root
+
+    footer: MiniPlayerBottomMargin {
+        width: root.width
+    }
+}
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 170ee549bd..4f57d9fc34 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -180,6 +180,8 @@
         <file alias="MainInterface.qml">maininterface/qml/MainInterface.qml</file>
         <file alias="MainDisplay.qml">maininterface/qml/MainDisplay.qml</file>
         <file alias="NoMedialibHome.qml">maininterface/qml/NoMedialibHome.qml</file>
+        <file alias="MainTableView.qml">maininterface/qml/MainTableView.qml</file>
+        <file alias="MainGridView.qml">maininterface/qml/MainGridView.qml</file>
         <file alias="MiniPlayerBottomMargin.qml">maininterface/qml/MiniPlayerBottomMargin.qml</file>
     </qresource>
     <qresource prefix="/widgets">
-- 
2.25.1



More information about the vlc-devel mailing list