[vlc-devel] [PATCH 09/15] qml: Editor - switch to tab layout

Rohan Rajpal rohan17089 at iiitd.ac.in
Mon Aug 12 15:24:23 CEST 2019


Switch to tab layout to support more configs
in future
---
 modules/gui/qt/qml/dialogs/ToolbarEditor.qml | 38 ++++++++++----------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
index 75e110953f..b065a184e1 100644
--- a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
+++ b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
@@ -32,29 +32,31 @@ Rectangle{
     ColumnLayout{
         anchors.fill: parent
         spacing: 0
-
-        ColumnLayout{
+        TabBar {
+            id: bar
+            Layout.preferredHeight: VLCStyle.heightBar_normal
+            Layout.preferredWidth: VLCStyle.button_width_large * bar.count
+
+            EditorTabButton {
+                id: mainPlayerTab
+                index: 0
+                text: qsTr("Mainplayer")
+            }
+        }
+        Rectangle{
             Layout.preferredHeight: VLCStyle.heightBar_large
             Layout.fillWidth: true
-            spacing: 0
-
-            Text {
-                id: dndHint
-                Layout.topMargin: VLCStyle.margin_xxsmall
-                Layout.leftMargin: VLCStyle.margin_xxsmall
-                text: qsTr("Drag and drop the items below: ")
-                font.pointSize: VLCStyle.fontHeight_xsmall
-                color: VLCStyle.colors.buttonText
-            }
-            Rectangle{
-                Layout.preferredHeight: VLCStyle.heightBar_large
-                Layout.fillWidth: true
-                Layout.margins: VLCStyle.margin_xxsmall
-                color: VLCStyle.colors.bgAlt
+            radius: 2
+            color: VLCStyle.colors.bgAlt
+
+            StackLayout{
+                anchors.fill: parent
+                currentIndex: bar.currentIndex
 
                 EditorDNDView {
                     id : playerBtnDND
-                    anchors.fill: parent
+                    Layout.preferredHeight: VLCStyle.heightBar_large
+                    Layout.fillWidth: true
                     model: playerControlBarModel
                 }
             }
-- 
2.17.1



More information about the vlc-devel mailing list