[vlc-devel] [PATCH 06/39] qml: add current indicator in BannerTabButton

Prince Gupta guptaprince8832 at gmail.com
Thu Jan 7 11:50:02 UTC 2021


---
 modules/gui/qt/widgets/qml/BannerTabButton.qml | 8 ++++++++
 modules/gui/qt/widgets/qml/LocalTabBar.qml     | 1 +
 2 files changed, 9 insertions(+)

diff --git a/modules/gui/qt/widgets/qml/BannerTabButton.qml b/modules/gui/qt/widgets/qml/BannerTabButton.qml
index 6688f1a8fd..358aec40b0 100644
--- a/modules/gui/qt/widgets/qml/BannerTabButton.qml
+++ b/modules/gui/qt/widgets/qml/BannerTabButton.qml
@@ -29,6 +29,7 @@ T.TabButton {
 
     property color color: VLCStyle.colors.banner
     property bool showText: true
+    property bool showCurrentIndicator: true
 
     text: model.displayText
     padding: 0
@@ -80,5 +81,12 @@ T.TabButton {
                 text: control.text
             }
         }
+
+        Widgets.CurrentIndicator {
+            width: tabRow.width
+            orientation: Qt.Horizontal
+            margin: VLCStyle.dp(3, VLCStyle.scale)
+            visible: control.showCurrentIndicator && control.selected
+        }
     }
 }
diff --git a/modules/gui/qt/widgets/qml/LocalTabBar.qml b/modules/gui/qt/widgets/qml/LocalTabBar.qml
index ac0eadfec0..38b5710357 100644
--- a/modules/gui/qt/widgets/qml/LocalTabBar.qml
+++ b/modules/gui/qt/widgets/qml/LocalTabBar.qml
@@ -31,6 +31,7 @@ NavigableRow {
     delegate: BannerTabButton {
         text: model.displayText
         selected: model.name === row.currentView
+        showCurrentIndicator: false
         height: VLCStyle.localToolbar_height
         color: VLCStyle.colors.bg
         onClicked: row.clicked(index)
-- 
2.25.1



More information about the vlc-devel mailing list