Commit 383feeee authored by Alexander Stippich's avatar Alexander Stippich
Browse files

make the navigation bar filter view state a persistent setting

Summary: the view state of the navigation action bar is now stored persisently

Reviewers: #elisa, mgallien

Reviewed By: #elisa, mgallien

Subscribers: mgallien

Tags: #elisa

Differential Revision: https://phabricator.kde.org/D10488
parent 6079a22d
......@@ -91,7 +91,10 @@ ApplicationWindow {
property double playControlItemVolume : 100.0
property bool playControlItemMuted : false
}
property string filterState
}
Connections {
target: Qt.application
......@@ -460,6 +463,14 @@ ApplicationWindow {
})
}
onGoBack: localAlbums.stackView.pop()
Binding {
target: allAlbumsView
property: 'filterState'
value: persistentSettings.filterState
}
onFilterViewChanged: persistentSettings.filterState = filterState
}
visible: opacity > 0
......@@ -500,6 +511,14 @@ ApplicationWindow {
}
onGoBack: localArtists.stackView.pop()
Binding {
target: allArtistsView
property: 'filterState'
value: persistentSettings.filterState
}
onFilterViewChanged: persistentSettings.filterState = filterState
}
visible: opacity > 0
......@@ -518,10 +537,19 @@ ApplicationWindow {
}
firstPage: MediaAllTracksView {
id: allTracksView
focus: true
stackView: localTracks.stackView
contentModel: elisa.allTracksProxyModel
Binding {
target: allTracksView
property: 'filterState'
value: persistentSettings.filterState
}
onFilterViewChanged: persistentSettings.filterState = filterState
}
visible: opacity > 0
......@@ -832,6 +860,7 @@ ApplicationWindow {
id: innerAlbumView
GridBrowserView {
id: innerAlbumGridView
property var stackView
contentModel: elisa.singleArtistProxyModel
......@@ -848,6 +877,14 @@ ApplicationWindow {
})
}
onGoBack: stackView.pop()
Binding {
target: innerAlbumGridView
property: 'filterState'
value: persistentSettings.filterState
}
onFilterViewChanged: persistentSettings.filterState = filterState
}
}
......@@ -855,6 +892,7 @@ ApplicationWindow {
id: albumView
MediaAlbumView {
id: albumGridView
property var stackView
contentModel: elisa.singleAlbumProxyModel
......@@ -875,6 +913,14 @@ ApplicationWindow {
allArtistsView.open(name, name, elisaTheme.defaultArtistImage, '')
}
onGoBack: stackView.pop()
Binding {
target: albumGridView
property: 'filterState'
value: persistentSettings.filterState
}
onFilterViewChanged: persistentSettings.filterState = filterState
}
}
......
......@@ -37,9 +37,11 @@ FocusScope {
property alias contentModel: contentDirectoryView.model
property bool showRating: true
property bool delegateDisplaySecondaryText: true
property alias filterState: navigationBar.state
signal open(var innerMainTitle, var innerSecondaryTitle, var innerImage, var databaseId)
signal goBack()
signal filterViewChanged(string filterState)
SystemPalette {
id: myPalette
......@@ -85,6 +87,8 @@ FocusScope {
onReplaceAndPlay:contentModel.replaceAndPlayOfPlayList()
onGoBack: gridView.goBack()
onFilterViewChanged: gridView.filterViewChanged(filterState)
}
Rectangle {
......
......@@ -32,11 +32,13 @@ FocusScope {
property var artistName
property var albumArtUrl
property bool isSingleDiscAlbum
property alias filterState: navigationBar.state
property var albumId
property alias contentModel: contentDirectoryView.model
signal showArtist(var name)
signal goBack();
signal filterViewChanged(string filterState)
function loadAlbumData(id)
{
......@@ -85,6 +87,8 @@ FocusScope {
onGoBack: topListing.goBack()
onFilterViewChanged: topListing.filterViewChanged(filterState)
onShowArtist: topListing.showArtist(topListing.contentModel.sourceModel.author)
onEnqueue: contentModel.enqueueToPlayList()
......
......@@ -32,6 +32,9 @@ FocusScope {
property var stackView
property alias contentModel: contentDirectoryView.model
property alias filterState: navigationBar.state
signal filterViewChanged(string filterState)
SystemPalette {
id: myPalette
......@@ -74,6 +77,8 @@ FocusScope {
onEnqueue: contentModel.enqueueToPlayList()
onFilterViewChanged: rootElement.filterViewChanged(filterState)
onReplaceAndPlay: contentModel.replaceAndPlayOfPlayList()
}
......
......@@ -36,12 +36,12 @@ FocusScope {
property alias filterText: filterTextInput.text
property alias filterRating: ratingFilter.starRating
property bool enableGoBack: true
property bool collapsed: true
signal enqueue();
signal replaceAndPlay();
signal goBack();
signal showArtist();
signal filterViewChanged(string filterState);
Action {
id: goPreviousAction
......@@ -52,9 +52,12 @@ FocusScope {
Action {
id: showFilterAction
text: collapsed ? i18nc("Show filters in the navigation bar", "Show Search Options") : i18nc("Hide filters in the navigation bar", "Hide Search Options")
iconName: collapsed ? "go-down-search" : "go-up-search"
onTriggered: collapsed ? collapsed = false : collapsed = true
text: navigationBar.state === "" ? i18nc("Show filters in the navigation bar", "Show Search Options") : i18nc("Hide filters in the navigation bar", "Hide Search Options")
iconName: navigationBar.state === "" ? "go-down-search" : "go-up-search"
onTriggered: {
navigationBar.state === "" ? navigationBar.state = 'expanded' : navigationBar.state = ""
filterViewChanged(navigationBar.state)
}
}
ColumnLayout {
......@@ -313,8 +316,7 @@ FocusScope {
states: [
State {
name: 'collapsed'
when: collapsed
name: ""
PropertyChanges {
target: navigationBar
height: elisaTheme.navigationBarHeight
......@@ -326,7 +328,6 @@ FocusScope {
},
State {
name: 'expanded'
when: !collapsed
PropertyChanges {
target: navigationBar
height: elisaTheme.navigationBarHeight + elisaTheme.navigationBarFilterHeight
......
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