[vlc-commits] qml: add current indicator in BannerTabButton

Prince Gupta git at videolan.org
Thu Jan 14 14:42:09 UTC 2021


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Tue Dec 22 00:03:08 2020 +0530| [1f44ffb0fe174b0760a8c79e383bec569ec77fc8] | committer: Pierre Lamot

qml: add current indicator in BannerTabButton

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f44ffb0fe174b0760a8c79e383bec569ec77fc8
---

 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)



More information about the vlc-commits mailing list