[vlc-commits] [Git][videolan/vlc][master] 4 commits: qt: add ListViewRev11.qml and ListViewRev15.qml

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Apr 20 08:13:03 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
e4702070 by Fatih Uzunoglu at 2023-04-20T07:52:07+00:00
qt: add ListViewRev11.qml and ListViewRev15.qml

- - - - -
7abb4690 by Fatih Uzunoglu at 2023-04-20T07:52:07+00:00
qt: register qml type ListViewRev15 or ListViewRev11 as ListViewCompat

- - - - -
e2442bab by Fatih Uzunoglu at 2023-04-20T07:52:07+00:00
qml: use ListViewCompat in FadingEdgeListView

- - - - -
bda1dce1 by Fatih Uzunoglu at 2023-04-20T07:52:07+00:00
qml: enable reuseItems in KeyNavigableListView by default

- - - - -


7 changed files:

- modules/gui/qt/Makefile.am
- modules/gui/qt/maininterface/mainui.cpp
- + modules/gui/qt/util/qml/ListViewRev11.qml
- + modules/gui/qt/util/qml/ListViewRev15.qml
- modules/gui/qt/vlc.qrc
- modules/gui/qt/widgets/qml/FadingEdgeListView.qml
- modules/gui/qt/widgets/qml/KeyNavigableListView.qml


Changes:

=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -993,6 +993,8 @@ libqt_plugin_la_QML = \
 	gui/qt/util/qml/VanillaObject.qml \
 	gui/qt/util/qml/NativeMenu.qml \
 	gui/qt/util/qml/MLContextMenu.qml \
+	gui/qt/util/qml/ListViewRev15.qml \
+	gui/qt/util/qml/ListViewRev11.qml \
 	gui/qt/widgets/qml/ActionButtonOverlay.qml \
 	gui/qt/widgets/qml/ActionButtonPrimary.qml \
 	gui/qt/widgets/qml/BannerTabButton.qml \


=====================================
modules/gui/qt/maininterface/mainui.cpp
=====================================
@@ -342,6 +342,15 @@ void MainUI::registerQMLTypes()
         qmlRegisterType(QUrl("qrc:///util/TouchScreenTapHandlerRev11.qml"), uri, versionMajor, versionMinor, "TouchScreenTapHandlerCompat");
 #endif
 
+        qmlRegisterType(QUrl(QStringLiteral(
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+                            "qrc:///util/ListViewRev15.qml"
+#else
+                            "qrc:///util/ListViewRev11.qml"
+#endif
+                            )),
+                        uri, versionMajor, versionMinor, "ListViewCompat");
+
         qmlProtectModule(uri, versionMajor);
     }
 


=====================================
modules/gui/qt/util/qml/ListViewRev11.qml
=====================================
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * Copyright (C) 2023 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
+
+ListView {
+
+}


=====================================
modules/gui/qt/util/qml/ListViewRev15.qml
=====================================
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * Copyright (C) 2023 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.15
+
+ListView {
+
+}


=====================================
modules/gui/qt/vlc.qrc
=====================================
@@ -82,6 +82,8 @@
         <file alias="VanillaObject.qml">util/qml/VanillaObject.qml</file>
         <file alias="NativeMenu.qml">util/qml/NativeMenu.qml</file>
         <file alias="MLContextMenu.qml">util/qml/MLContextMenu.qml</file>
+        <file alias="ListViewRev15.qml">util/qml/ListViewRev15.qml</file>
+        <file alias="ListViewRev11.qml">util/qml/ListViewRev11.qml</file>
     </qresource>
     <qresource prefix="/sd">
         <file alias="capture-card.svg">pixmaps/sd/capture-card.svg</file>


=====================================
modules/gui/qt/widgets/qml/FadingEdgeListView.qml
=====================================
@@ -22,7 +22,7 @@ import org.videolan.compat 0.1
 import "qrc:///style/"
 import "qrc:///util/Helpers.js" as Helpers
 
-ListView {
+ListViewCompat {
     id: root
 
     // backgroundColor is only needed for sub-pixel


=====================================
modules/gui/qt/widgets/qml/KeyNavigableListView.qml
=====================================
@@ -106,6 +106,13 @@ FadingEdgeListView {
 
     // Events
 
+    Component.onCompleted: {
+        if (typeof root.reuseItems === "boolean") {
+            // Qt 5.15 feature, on by default here:
+            root.reuseItems = true
+        }
+    }
+
     // NOTE: We always want a valid 'currentIndex' by default.
     onCountChanged: if (count && currentIndex === -1) currentIndex = 0
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/17a2f8d7602c0c58be57873767b79f42a2140aea...bda1dce1af2ce49a9150d4bba15480d292965e5b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/17a2f8d7602c0c58be57873767b79f42a2140aea...bda1dce1af2ce49a9150d4bba15480d292965e5b
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