[vlc-commits] qml: Add miniplayer toolbar to Editor

Rohan Rajpal git at videolan.org
Wed Aug 21 16:27:09 CEST 2019


vlc | branch: master | Rohan Rajpal <rohan17089 at iiitd.ac.in> | Sun Aug 11 00:19:18 2019 +0530| [1f73ab05f9c5462ef425bd1bcc8951c5ffc3211f] | committer: Jean-Baptiste Kempf

qml: Add miniplayer toolbar to Editor

Add the miniplayer tab and toolbar to the editor

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/qml/dialogs/ToolbarEditor.qml       | 32 ++++++++++++++++++++--
 .../gui/qt/qml/dialogs/ToolbarEditorButtonList.qml |  1 +
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
index faadccf25f..a05586a687 100644
--- a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
+++ b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
@@ -42,6 +42,12 @@ Rectangle{
                 index: 0
                 text: qsTr("Mainplayer")
             }
+
+            EditorTabButton {
+                id: miniPlayerTab
+                index: 1
+                text: qsTr("Miniplayer")
+            }
         }
         Rectangle{
             Layout.preferredHeight: VLCStyle.heightBar_large
@@ -59,6 +65,14 @@ Rectangle{
                     Layout.fillWidth: true
                     model: playerControlBarModel
                 }
+
+                EditorDNDView {
+                    id : miniPlayerBtnDND
+                    Layout.preferredHeight: VLCStyle.heightBar_large
+                    Layout.fillWidth: true
+                    model: miniPlayerModel
+                }
+
             }
         }
 
@@ -111,8 +125,8 @@ Rectangle{
 
     }
 
-    function getConfig(){
-        return playerControlBarModel.getConfig()
+    function getProfileConfig(){
+        return playerControlBarModel.getConfig() + "|" + miniPlayerModel.getConfig()
     }
 
     Connections{
@@ -120,8 +134,13 @@ Rectangle{
         onUpdatePlayerModel: {
             if (toolbarName == "MainPlayerToolbar")
                 playerControlBarModel.reloadConfig(config)
+            else
+                miniPlayerModel.reloadConfig(config)
+        }
+        onSaveConfig: {
+            miniPlayerModel.saveConfig()
+            playerControlBarModel.saveConfig()
         }
-        onSaveConfig: playerControlBarModel.saveConfig()
     }
 
     PlayerControlBarModel {
@@ -132,6 +151,13 @@ Rectangle{
         Component.onCompleted: reloadModel()
     }
 
+    PlayerControlBarModel {
+        id: miniPlayerModel
+        mainCtx: mainctx
+        configName: "MiniPlayerToolbar"
+        Component.onCompleted: reloadModel()
+    }
+
     Player.ControlButtons{
         id: controlButtons
     }
diff --git a/modules/gui/qt/qml/dialogs/ToolbarEditorButtonList.qml b/modules/gui/qt/qml/dialogs/ToolbarEditorButtonList.qml
index 28594a5698..382dbc618a 100644
--- a/modules/gui/qt/qml/dialogs/ToolbarEditorButtonList.qml
+++ b/modules/gui/qt/qml/dialogs/ToolbarEditorButtonList.qml
@@ -54,6 +54,7 @@ GridView{
             var pos = this.mapToGlobal( mouseX, mouseY)
             buttonDragItem.updatePos(pos.x, pos.y)
             playerBtnDND.addBtn = true
+            miniPlayerBtnDND.addBtn = true
         }
 
         onReleased: {



More information about the vlc-commits mailing list