[vlc-commits] [Git][videolan/vlc][master] qml: reset to last subcategory of the views

Hugo Beauzée-Luyssen gitlab at videolan.org
Fri Jun 4 09:13:02 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
9181dc49 by Prince Gupta at 2021-06-04T08:38:27+00:00
qml: reset to last subcategory of the views

closes #25581

- - - - -


1 changed file:

- modules/gui/qt/maininterface/qml/MainDisplay.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -39,9 +39,10 @@ Widgets.NavigableFocusScope {
     property alias g_mainDisplay: root
     property bool _inhibitMiniPlayer: false
     property bool _showMiniPlayer: false
+    property var _defaultPages: ({}) // saves last page of view
 
     onViewChanged: {
-        viewProperties = ({})
+        viewProperties = _defaultPages[root.view] !== undefined ? ({"defaultPage": _defaultPages[root.view]}) : ({})
         loadView()
     }
     onViewPropertiesChanged: loadView()
@@ -54,6 +55,8 @@ Widgets.NavigableFocusScope {
 
     function loadView() {
         var found = stackView.loadView(root.pageModel, root.view, root.viewProperties)
+        if (stackView.currentItem.view !== undefined)
+            _defaultPages[root.view] = stackView.currentItem.view
 
         stackView.currentItem.navigationParent = medialibId
         stackView.currentItem.navigationUpItem = sourcesBanner



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9181dc49ad7ad9a182a777ef431b5e8c5c936f96

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9181dc49ad7ad9a182a777ef431b5e8c5c936f96
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list