[vlc-devel] [PATCH 02/10] qml: introduce LocalTabBar widget

Prince Gupta guptaprince8832 at gmail.com
Fri Nov 20 18:29:35 CET 2020


---
 modules/gui/qt/Makefile.am                 |  1 +
 modules/gui/qt/vlc.qrc                     |  1 +
 modules/gui/qt/widgets/qml/LocalTabBar.qml | 39 ++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 modules/gui/qt/widgets/qml/LocalTabBar.qml

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index f327b81317..4fc86f7f27 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -697,6 +697,7 @@ libqt_plugin_la_QML = \
 	gui/qt/widgets/qml/LabelSeparator.qml \
 	gui/qt/widgets/qml/ListItem.qml \
 	gui/qt/widgets/qml/ListLabel.qml \
+	gui/qt/widgets/qml/LocalTabBar.qml \
 	gui/qt/widgets/qml/MediaCover.qml \
 	gui/qt/widgets/qml/SubtitleLabel.qml \
 	gui/qt/widgets/qml/MenuCaption.qml \
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 0548e1c9ca..34c6c8043e 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -235,6 +235,7 @@
         <file alias="FrostedGlassEffect.qml">widgets/qml/FrostedGlassEffect.qml</file>
         <file alias="CheckedDelegate.qml">widgets/qml/CheckedDelegate.qml</file>
         <file alias="PageLoader.qml">widgets/qml/PageLoader.qml</file>
+        <file alias="LocalTabBar.qml">widgets/qml/LocalTabBar.qml</file>
     </qresource>
     <qresource prefix="/network">
         <file alias="DiscoverDisplay.qml">network/qml/DiscoverDisplay.qml</file>
diff --git a/modules/gui/qt/widgets/qml/LocalTabBar.qml b/modules/gui/qt/widgets/qml/LocalTabBar.qml
new file mode 100644
index 0000000000..dce6b2f591
--- /dev/null
+++ b/modules/gui/qt/widgets/qml/LocalTabBar.qml
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * 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:///style/"
+
+NavigableRow {
+    id: row
+
+    property string currentView
+    signal clicked(int index)
+
+    height: VLCStyle.localToolbar_height
+    focus: true
+
+    delegate: BannerTabButton {
+        text: model.displayText
+        selected: model.name === row.currentView
+        height: VLCStyle.localToolbar_height
+        color: VLCStyle.colors.bg
+        colorSelected: VLCStyle.colors.bg
+        onClicked: row.clicked(index)
+    }
+}
-- 
2.25.1



More information about the vlc-devel mailing list