Commit 87bed79e authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

let initial view be saved on quit and restore on start

parent 2cfe1e4f
...@@ -19,6 +19,7 @@ RowLayout { ...@@ -19,6 +19,7 @@ RowLayout {
property bool showExpandedFilterView property bool showExpandedFilterView
property alias currentViewIndex: listViews.currentIndex property alias currentViewIndex: listViews.currentIndex
property Kirigami.ContextDrawer playlistDrawer property Kirigami.ContextDrawer playlistDrawer
property alias initialIndex: viewManager.initialIndex
function goBack() { function goBack() {
viewManager.goBack() viewManager.goBack()
...@@ -41,7 +42,6 @@ RowLayout { ...@@ -41,7 +42,6 @@ RowLayout {
id: viewManager id: viewManager
viewsData: viewsData viewsData: viewsData
initialIndex: 3
onOpenGridView: { onOpenGridView: {
if (configurationData.expectedDepth === 1) { if (configurationData.expectedDepth === 1) {
......
...@@ -16,7 +16,7 @@ import Qt.labs.platform 1.1 ...@@ -16,7 +16,7 @@ import Qt.labs.platform 1.1
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
id: mainWindow id: mainWindow
visible: true visible: true
contextDrawer: Kirigami.ContextDrawer { contextDrawer: Kirigami.ContextDrawer {
...@@ -49,6 +49,8 @@ Kirigami.ApplicationWindow { ...@@ -49,6 +49,8 @@ Kirigami.ApplicationWindow {
Accessible.role: Accessible.Application Accessible.role: Accessible.Application
Accessible.name: title Accessible.name: title
readonly property int initialViewIndex: 3
property var goBackAction: ElisaApplication.action("go_back") property var goBackAction: ElisaApplication.action("go_back")
property var seekAction: ElisaApplication.action("Seek") property var seekAction: ElisaApplication.action("Seek")
property var scrubAction: ElisaApplication.action("Scrub") property var scrubAction: ElisaApplication.action("Scrub")
...@@ -125,6 +127,8 @@ Kirigami.ApplicationWindow { ...@@ -125,6 +127,8 @@ Kirigami.ApplicationWindow {
property bool showPlaylist: true property bool showPlaylist: true
property bool headerBarIsMaximized: false property bool headerBarIsMaximized: false
property int initialIndex
} }
Connections { Connections {
...@@ -155,6 +159,8 @@ Kirigami.ApplicationWindow { ...@@ -155,6 +159,8 @@ Kirigami.ApplicationWindow {
persistentSettings.showPlaylist = contentView.showPlaylist persistentSettings.showPlaylist = contentView.showPlaylist
persistentSettings.headerBarIsMaximized = headerBar.isMaximized persistentSettings.headerBarIsMaximized = headerBar.isMaximized
persistentSettings.initialIndex = contentView.currentViewIndex
} }
} }
...@@ -286,6 +292,7 @@ Kirigami.ApplicationWindow { ...@@ -286,6 +292,7 @@ Kirigami.ApplicationWindow {
showPlaylist: persistentSettings.showPlaylist showPlaylist: persistentSettings.showPlaylist
showExpandedFilterView: persistentSettings.expandedFilterView showExpandedFilterView: persistentSettings.expandedFilterView
playlistDrawer: playlistDrawer playlistDrawer: playlistDrawer
initialIndex: persistentSettings.value('initialIndex', initialViewIndex)
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment