<div dir="ltr">Both patches are resends.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 3 Jul 2019 at 09:47, Abel Tesfaye <<a href="mailto:abeltesfaye45@gmail.com">abeltesfaye45@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Abel Tesfaye <<a href="mailto:Abeltesfaye45@gmail.com" target="_blank">Abeltesfaye45@gmail.com</a>><br>
<br>
fixes #22173<br>
---<br>
 modules/gui/qt/main_interface.cpp             | 14 +++++++<br>
 modules/gui/qt/main_interface.hpp             |  9 +++++<br>
 modules/gui/qt/qml/BannerSources.qml          | 16 +++++---<br>
 modules/gui/qt/qml/MainInterface.qml          | 15 ++++++++<br>
 .../gui/qt/qml/mediacenter/MCMainDisplay.qml  | 38 ++++++++-----------<br>
 modules/gui/qt/qml/menus/ViewMenu.qml         | 11 ++++++<br>
 modules/gui/qt/qml/player/ControlBar.qml      |  2 +<br>
 modules/gui/qt/qml/player/ModalControlBar.qml |  3 --<br>
 modules/gui/qt/qml/player/Player.qml          | 30 +++++++--------<br>
 9 files changed, 91 insertions(+), 47 deletions(-)<br>
<br>
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp<br>
index 029a9f9d0b..b6c9219d53 100644<br>
--- a/modules/gui/qt/main_interface.cpp<br>
+++ b/modules/gui/qt/main_interface.cpp<br>
@@ -537,6 +537,20 @@ void MainInterface::setVideoOnTop( bool on_top )<br>
     }<br>
 }<br>
<br>
+void MainInterface::setPlaylistDocked( bool docked )<br>
+{<br>
+    b_playlistDocked = docked;<br>
+<br>
+    emit playlistDockedChanged(docked);<br>
+}<br>
+<br>
+void MainInterface::setPlaylistVisible( bool visible )<br>
+{<br>
+    playlistVisible = visible;<br>
+<br>
+    emit playlistVisibleChanged(visible);<br>
+}<br>
+<br>
 void MainInterface::setInterfaceAlwaysOnTop( bool on_top )<br>
 {<br>
     b_interfaceOnTop = on_top;<br>
diff --git a/modules/gui/qt/main_interface.hpp b/modules/gui/qt/main_interface.hpp<br>
index 3ceb91b40f..61a11ec4bf 100644<br>
--- a/modules/gui/qt/main_interface.hpp<br>
+++ b/modules/gui/qt/main_interface.hpp<br>
@@ -63,6 +63,8 @@ class MainInterface : public QVLCMW<br>
 {<br>
     Q_OBJECT<br>
<br>
+    Q_PROPERTY(bool playlistDocked READ isPlaylistDocked WRITE setPlaylistDocked NOTIFY playlistDockedChanged)<br>
+    Q_PROPERTY(bool playlistVisible READ isPlaylistVisible WRITE setPlaylistVisible NOTIFY playlistVisibleChanged)<br>
     Q_PROPERTY(bool interfaceAlwaysOnTop READ isInterfaceAlwaysOnTop WRITE setInterfaceAlwaysOnTop NOTIFY interfaceAlwaysOnTopChanged)<br>
     Q_PROPERTY(bool interfaceFullScreen READ isInterfaceFullScreen WRITE setInterfaceFullScreen NOTIFY interfaceFullScreenChanged)<br>
     Q_PROPERTY(bool hasEmbededVideo READ hasEmbededVideo NOTIFY hasEmbededVideoChanged)<br>
@@ -111,6 +113,8 @@ public:<br>
         RAISE_AUDIOVIDEO,<br>
     };<br>
     bool isInterfaceFullScreen() { return b_interfaceFullScreen; }<br>
+    bool isPlaylistDocked() { return b_playlistDocked; }<br>
+    bool isPlaylistVisible() { return playlistVisible; }<br>
     bool isInterfaceAlwaysOnTop() { return b_interfaceOnTop; }<br>
     bool hasEmbededVideo() { return m_hasEmbededVideo; }<br>
     QList<QQmlError> qmlErrors() const;<br>
@@ -171,6 +175,7 @@ protected:<br>
     bool                 b_videoFullScreen;     ///< --fullscreen<br>
     bool                 b_hideAfterCreation;<br>
     bool                 b_minimalView;         ///< Minimal video<br>
+    bool                 b_playlistDocked;<br>
     bool                 b_interfaceFullScreen;<br>
     bool                 b_interfaceOnTop;      ///keep UI on top<br>
     bool                 b_pauseOnMinimize;<br>
@@ -196,6 +201,8 @@ public slots:<br>
     void showUpdateSystrayMenu();<br>
     void hideUpdateSystrayMenu();<br>
     void toggleInterfaceFullScreen();<br>
+    void setPlaylistDocked( bool );<br>
+    void setPlaylistVisible( bool );<br>
     void setInterfaceAlwaysOnTop( bool );<br>
<br>
     void emitBoss();<br>
@@ -242,6 +249,8 @@ signals:<br>
     void askPopupMenu( bool show );<br>
     void kc_pressed(); /* easter eggs */<br>
<br>
+    void playlistDockedChanged(bool);<br>
+    void playlistVisibleChanged(bool);<br>
     void interfaceAlwaysOnTopChanged(bool);<br>
     void interfaceFullScreenChanged(bool);<br>
     void hasEmbededVideoChanged(bool);<br>
diff --git a/modules/gui/qt/qml/BannerSources.qml b/modules/gui/qt/qml/BannerSources.qml<br>
index 67d99dae57..e6acb42c93 100644<br>
--- a/modules/gui/qt/qml/BannerSources.qml<br>
+++ b/modules/gui/qt/qml/BannerSources.qml<br>
@@ -352,7 +352,7 @@ Utils.NavigableFocusScope {<br>
                             size: VLCStyle.icon_normal<br>
                             text: VLCIcons.playlist<br>
<br>
-                            onClicked: root.toogleMenu()<br>
+                            onClicked: rootWindow.playlistVisible = !rootWindow.playlistVisible<br>
<br>
                             KeyNavigation.right: menu_selector<br>
                             KeyNavigation.up: buttonView<br>
@@ -364,14 +364,17 @@ Utils.NavigableFocusScope {<br>
                             size: VLCStyle.icon_normal<br>
                             text: VLCIcons.menu<br>
<br>
+                            KeyNavigation.left: playlist_btn<br>
+                            KeyNavigation.right: playlist<br>
+<br>
                             onClicked: mainMenu.openBelow(this)<br>
<br>
-                            Menus.MainDropdownMenu {<br>
-                                id: mainMenu<br>
-                                onClosed: menu_selector.forceActiveFocus()<br>
+                        Menus.MainDropdownMenu {<br>
+                            id: mainMenu<br>
+                            onClosed: {<br>
+                                if (mainMenu.activeFocus)<br>
+                                    menu_selector.forceActiveFocus()<br>
                             }<br>
-<br>
-                            KeyNavigation.up: buttonView<br>
                         }<br>
                     }<br>
                 }<br>
@@ -413,3 +416,4 @@ Utils.NavigableFocusScope {<br>
             defaultKeyAction(event, 0)<br>
     }<br>
 }<br>
+}<br>
diff --git a/modules/gui/qt/qml/MainInterface.qml b/modules/gui/qt/qml/MainInterface.qml<br>
index 0d23bc068b..e898d9a5d3 100644<br>
--- a/modules/gui/qt/qml/MainInterface.qml<br>
+++ b/modules/gui/qt/qml/MainInterface.qml<br>
@@ -27,11 +27,26 @@ import "qrc:///style/"<br>
 import "qrc:///player/" as Player<br>
 import "qrc:///about/" as AB<br>
 import "qrc:///dialogs/" as DG<br>
+import "qrc:///playlist/" as PL<br>
+import QtQuick.Window 2.11<br>
<br>
 Rectangle {<br>
     id: root<br>
     color: "transparent"<br>
<br>
+    Window {<br>
+        id: playlistWindow<br>
+        visible: !rootWindow.playlistDocked && rootWindow.playlistVisible<br>
+        title: qsTr("Playlist")<br>
+        color: <a href="http://VLCStyle.colors.bg" rel="noreferrer" target="_blank">VLCStyle.colors.bg</a><br>
+        onClosing: rootWindow.playlistVisible = false<br>
+        PL.PlaylistListView {<br>
+            id: playlistView<br>
+            focus: true<br>
+            anchors.fill: parent<br>
+        }<br>
+    }<br>
+<br>
     PlaylistControllerModel {<br>
         id: mainPlaylistController<br>
         playlistPtr: mainctx.playlist<br>
diff --git a/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml b/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml<br>
index a7cfaa2252..25b78d4cde 100644<br>
--- a/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml<br>
+++ b/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml<br>
@@ -88,7 +88,7 @@ Utils.NavigableFocusScope {<br>
             focus: true<br>
             id: medialibId<br>
             anchors.fill: parent<br>
-            onActionRight: playlist.show()<br>
+            onActionRight: rootWindow.playlistVisible = true<br>
<br>
             ColumnLayout {<br>
                 id: column<br>
@@ -135,8 +135,6 @@ Utils.NavigableFocusScope {<br>
                     onActionRight: root.actionRight(index)<br>
                     onActionUp: root.actionUp(index)<br>
                     onActionCancel: root.actionCancel(index)<br>
-<br>
-                    onToogleMenu: playlist.toggleState()<br>
                 }<br>
<br>
                 Utils.StackViewExt {<br>
@@ -169,7 +167,11 @@ Utils.NavigableFocusScope {<br>
                         focus: false<br>
                         expandHorizontally: true<br>
<br>
-                        state: "hidden"<br>
+                        state: (rootWindow.playlistDocked && rootWindow.playlistVisible) ? "visible" : "hidden"<br>
+                        onVisibleChanged: {<br>
+                            if (playlist.visible)<br>
+                                playlist.forceActiveFocus()<br>
+                        }<br>
                         component: Rectangle {<br>
                             color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.banner, 0.9)<br>
                             width: root.width/3<br>
@@ -186,28 +188,18 @@ Utils.NavigableFocusScope {<br>
                                     id: playlistView<br>
                                     focus: true<br>
                                     anchors.fill: parent<br>
-                                    onActionLeft: playlist.quit()<br>
-                                    onActionCancel: playlist.quit()<br>
-                                    onActionUp: {<br>
-                                        playlist.state = "hidden"<br>
-                                        sourcesBanner.forceActiveFocus()<br>
-                                    }<br>
+                                    onActionLeft: playlist.closeAndFocus(stackView.currentItem)<br>
+                                    onActionCancel: playlist.closeAndFocus(stackView.currentItem)<br>
+                                    onActionUp: playlist.closeAndFocus(sourcesBanner)<br>
                                 }<br>
                             }<br>
                         }<br>
-                        function toggleState() {<br>
-                            if (state === "hidden")<br>
-                                show()<br>
-                            else<br>
-                                quit()<br>
-                        }<br>
-                        function quit() {<br>
-                            state = "hidden"<br>
-                            stackView.currentItem.forceActiveFocus()<br>
-                        }<br>
-                        function show() {<br>
-                            state = "visible"<br>
-                            playlist.forceActiveFocus()<br>
+                        function closeAndFocus(item){<br>
+                            if (!item)<br>
+                                return<br>
+<br>
+                            rootWindow.playlistVisible = false<br>
+                            item.forceActiveFocus()<br>
                         }<br>
                     }<br>
                 }<br>
diff --git a/modules/gui/qt/qml/menus/ViewMenu.qml b/modules/gui/qt/qml/menus/ViewMenu.qml<br>
index 7a58605092..f8fd0abf2b 100644<br>
--- a/modules/gui/qt/qml/menus/ViewMenu.qml<br>
+++ b/modules/gui/qt/qml/menus/ViewMenu.qml<br>
@@ -22,6 +22,17 @@ import "qrc:///style/"<br>
 import "qrc:///utils/" as Utils<br>
<br>
 Utils.MenuExt {<br>
+    id: viewMenu<br>
+    Action {<br>
+        text: qsTr("Play&list")<br>
+        onTriggered: rootWindow.playlistVisible = !rootWindow.playlistVisible<br>
+    }<br>
+    Action {<br>
+        text: qsTr("Docked Playlist")<br>
+        checkable: true<br>
+        checked: rootWindow.playlistDocked<br>
+        onTriggered: rootWindow.playlistDocked = !rootWindow.playlistDocked<br>
+    }<br>
     Action {<br>
         text: qsTr("&Always on Top")<br>
         checkable: true<br>
diff --git a/modules/gui/qt/qml/player/ControlBar.qml b/modules/gui/qt/qml/player/ControlBar.qml<br>
index 76399d488d..6d17375e13 100644<br>
--- a/modules/gui/qt/qml/player/ControlBar.qml<br>
+++ b/modules/gui/qt/qml/player/ControlBar.qml<br>
@@ -26,6 +26,7 @@ import org.videolan.vlc 0.1<br>
 import "qrc:///style/"<br>
 import "qrc:///utils/" as Utils<br>
 import "qrc:///menus/" as Menus<br>
+import "qrc:///playlist/" as PL<br>
<br>
<br>
 Utils.NavigableFocusScope {<br>
@@ -121,6 +122,7 @@ Utils.NavigableFocusScope {<br>
                                 if (buttonindex > 0)<br>
                                     buttonloader.item.KeyNavigation.left = buttonrow.children[buttonindex-1].item<br>
<br>
+<br>
                             }<br>
                         }<br>
                     }<br>
diff --git a/modules/gui/qt/qml/player/ModalControlBar.qml b/modules/gui/qt/qml/player/ModalControlBar.qml<br>
index d534c8cdd0..a8e0d5ebeb 100644<br>
--- a/modules/gui/qt/qml/player/ModalControlBar.qml<br>
+++ b/modules/gui/qt/qml/player/ModalControlBar.qml<br>
@@ -26,8 +26,6 @@ import "qrc:///utils/" as Utils<br>
<br>
 Utils.NavigableFocusScope {<br>
     id: root<br>
-    signal showPlaylist();<br>
-<br>
     property bool showPlaylistButton: false<br>
<br>
     property bool forceNoAutoHide: false<br>
@@ -41,7 +39,6 @@ Utils.NavigableFocusScope {<br>
             showPlaylistButton: root.showPlaylistButton<br>
<br>
             onShowTrackBar: root.state = "tracks"<br>
-            onShowPlaylist: root.showPlaylist()<br>
<br>
             onActionUp: root.actionUp(index)<br>
             onActionDown: root.actionDown(index)<br>
diff --git a/modules/gui/qt/qml/player/Player.qml b/modules/gui/qt/qml/player/Player.qml<br>
index 403b8650ed..7beb818947 100644<br>
--- a/modules/gui/qt/qml/player/Player.qml<br>
+++ b/modules/gui/qt/qml/player/Player.qml<br>
@@ -125,7 +125,11 @@ Utils.NavigableFocusScope {<br>
         }<br>
         focus: false<br>
         expandHorizontally: true<br>
-<br>
+        state: (rootWindow.playlistDocked && rootWindow.playlistVisible) ? "visible" : "hidden"<br>
+        onVisibleChanged: {<br>
+            if (playlistpopup.visible)<br>
+                playlistpopup.forceActiveFocus()<br>
+        }<br>
         component: Rectangle {<br>
             color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.banner, 0.8)<br>
             width: root.width/4<br>
@@ -135,18 +139,22 @@ Utils.NavigableFocusScope {<br>
                 id: playlistView<br>
                 focus: true<br>
                 anchors.fill: parent<br>
-                onActionLeft: playlistpopup.quit()<br>
-                onActionCancel: playlistpopup.quit()<br>
+                onActionLeft: playlistpopup.closeAndFocus(controlBarView)<br>
+                onActionCancel: playlistpopup.closeAndFocus(controlBarView)<br>
             }<br>
         }<br>
-        function quit() {<br>
-            state = "hidden"<br>
-            controlBarView.focus = true<br>
-        }<br>
         onStateChanged: {<br>
             if (state === "hidden")<br>
                 toolbarAutoHide.restart()<br>
         }<br>
+<br>
+        function closeAndFocus(item){<br>
+            if (!item)<br>
+                return<br>
+<br>
+            rootWindow.playlistVisible = false<br>
+            item.forceActiveFocus()<br>
+        }<br>
     }<br>
<br>
<br>
@@ -193,14 +201,6 @@ Utils.NavigableFocusScope {<br>
                     onActionLeft: root.actionLeft(index)<br>
                     onActionRight: root.actionRight(index)<br>
                     onActionCancel: root.actionCancel(index)<br>
-                    onShowPlaylist: {<br>
-                        if (playlistpopup.state === "visible") {<br>
-                            playlistpopup.state = "hidden"<br>
-                        } else {<br>
-                            playlistpopup.state = "visible"<br>
-                            playlistpopup.focus = true<br>
-                        }<br>
-                    }<br>
<br>
                     //unhandled keys are forwarded to the vout window<br>
                     Keys.forwardTo: videoSurface<br>
-- <br>
2.21.0<br>
<br>
</blockquote></div>