[vlc-devel] [PATCH 16/28] qml: fix maindisplay keyboard navigation integration of the new playlist

Fatih Uzunoglu fuzun54 at outlook.com
Tue Jul 21 19:28:46 CEST 2020


---
 .../gui/qt/medialibrary/qml/MainDisplay.qml   | 146 +++++++++---------
 1 file changed, 75 insertions(+), 71 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MainDisplay.qml b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
index 7ba25412c0..3bb9f405e1 100644
--- a/modules/gui/qt/medialibrary/qml/MainDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
@@ -206,7 +206,7 @@ Widgets.NavigableFocusScope {
                         }
                     }
 
-                    ColumnLayout {
+                    Widgets.NavigableFocusScope {
                         id: playlistColumn
                         anchors {
                             top: parent.top
@@ -214,7 +214,6 @@ Widgets.NavigableFocusScope {
                             bottom: parent.bottom
                         }
                         width: root.width / 4
-                        spacing: 0
                         visible: false
 
                         property bool expanded: mainInterface.playlistDocked && mainInterface.playlistVisible
@@ -253,96 +252,101 @@ Widgets.NavigableFocusScope {
                             }
                         }
 
-                        Rectangle
-                        {
-                            id: topGlow
-                            Layout.fillWidth: true
-                            height: VLCStyle.margin_xxsmall
-                            visible: playlist.visible
-                            z: 1
-                            color: VLCStyle.colors.banner
-
-                            RectangularGlow {
-                                anchors.fill: parent
-                                glowRadius: VLCStyle.dp(8)
-                                color: VLCStyle.colors.glowColor
-                            }
+                        navigationParent: medialibId
+                        navigationLeftItem: stackView
+                        navigationUpItem: sourcesBanner
+                        navigationDownItem: miniPlayer.expanded ? miniPlayer : undefined
+                        navigationCancel: function() {
+                            mainInterface.playlistVisible = false
+                            stackView.forceActiveFocus()
                         }
 
-                        PL.PlaylistListView {
-                            id: playlist
-                            Layout.fillWidth: true
-                            Layout.fillHeight: true
-                            z: 0
-                            focus: true
-
-                            rightPadding: VLCStyle.applicationHorizontalMargin
-
-                            navigationParent: medialibId
-                            navigationLeftItem: stackView
-                            navigationUpItem: sourcesBanner
-                            navigationDownItem: miniPlayer.expanded ? miniPlayer : undefined
-                            navigationCancel: function() {
-                                mainInterface.playlistVisible = false
-                                stackView.forceActiveFocus()
-                            }
+                        ColumnLayout {
+                            anchors.fill: parent
+                            spacing: 0
 
-                            Item
+                            Rectangle
                             {
-                                anchors {
-                                    top: parent.top
-                                    left: parent.left
-                                    bottom: parent.bottom
-                                }
-                                width: VLCStyle.margin_xxsmall
+                                id: topGlow
+                                Layout.fillWidth: true
+                                height: VLCStyle.margin_xxsmall
+                                visible: playlist.visible
+                                z: 1
+                                color: VLCStyle.colors.banner
 
                                 RectangularGlow {
                                     anchors.fill: parent
-
                                     glowRadius: VLCStyle.dp(8)
                                     color: VLCStyle.colors.glowColor
                                 }
+                            }
+
+                            PL.PlaylistListView {
+                                id: playlist
+                                Layout.fillWidth: true
+                                Layout.fillHeight: true
+                                z: 0
+                                focus: true
+
+                                rightPadding: VLCStyle.applicationHorizontalMargin
 
-                                MouseArea {
-                                    id: dragArea
+                                Item
+                                {
                                     anchors {
                                         top: parent.top
+                                        left: parent.left
                                         bottom: parent.bottom
-                                        horizontalCenter: parent.horizontalCenter
                                     }
-                                    width: VLCStyle.dp(8)
-                                    property var _initialPos : playlistColumn.x
-                                    drag { target: parent; axis: Drag.XAxis }
-                                    onPositionChanged: {
-                                        if(drag.active){
-                                            var delta = mouseX - _initialPos
-                                            var newWidth = playlistColumn.width - delta
-
-                                            if (newWidth < root.width / 2 && newWidth > root.width / 8)
-                                                playlistColumn.width -= delta
-                                        }
+                                    width: VLCStyle.margin_xxsmall
+
+                                    RectangularGlow {
+                                        anchors.fill: parent
+
+                                        glowRadius: VLCStyle.dp(8)
+                                        color: VLCStyle.colors.glowColor
                                     }
-                                    onPressed: {
-                                        dragArea._initialPos = mouseX
+
+                                    MouseArea {
+                                        id: dragArea
+                                        anchors {
+                                            top: parent.top
+                                            bottom: parent.bottom
+                                            horizontalCenter: parent.horizontalCenter
+                                        }
+                                        width: VLCStyle.dp(8)
+                                        property var _initialPos : playlistColumn.x
+                                        drag { target: parent; axis: Drag.XAxis }
+                                        onPositionChanged: {
+                                            if(drag.active){
+                                                var delta = mouseX - _initialPos
+                                                var newWidth = playlistColumn.width - delta
+
+                                                if (newWidth < root.width / 2 && newWidth > root.width / 8)
+                                                    playlistColumn.width -= delta
+                                            }
+                                        }
+                                        onPressed: {
+                                            dragArea._initialPos = mouseX
+                                        }
+                                        cursorShape: Qt.SizeHorCursor
                                     }
-                                    cursorShape: Qt.SizeHorCursor
                                 }
                             }
-                        }
 
-                        Rectangle
-                        {
-                            id: bottomGlow
-                            Layout.fillWidth: true
-                            height: VLCStyle.margin_xxsmall
-                            visible: playlist.visible
-                            z: 1
-                            color: VLCStyle.colors.banner
+                            Rectangle
+                            {
+                                id: bottomGlow
+                                Layout.fillWidth: true
+                                height: VLCStyle.margin_xxsmall
+                                visible: playlist.visible
+                                z: 1
+                                color: VLCStyle.colors.banner
 
-                            RectangularGlow {
-                                anchors.fill: parent
-                                glowRadius: VLCStyle.dp(8)
-                                color: VLCStyle.colors.glowColor
+                                RectangularGlow {
+                                    anchors.fill: parent
+                                    glowRadius: VLCStyle.dp(8)
+                                    color: VLCStyle.colors.glowColor
+                                }
                             }
                         }
                     }
-- 
2.25.1



More information about the vlc-devel mailing list