diff --git a/src/qml/ElisaMainWindow.qml b/src/qml/ElisaMainWindow.qml --- a/src/qml/ElisaMainWindow.qml +++ b/src/qml/ElisaMainWindow.qml @@ -91,7 +91,10 @@ property double playControlItemVolume : 100.0 property bool playControlItemMuted : false - } + + property string filterState + + } Connections { target: Qt.application @@ -460,6 +463,14 @@ }) } onGoBack: localAlbums.stackView.pop() + + Binding { + target: allAlbumsView + property: 'filterState' + value: persistentSettings.filterState + } + + onFilterViewChanged: persistentSettings.filterState = filterState } visible: opacity > 0 @@ -500,6 +511,14 @@ } onGoBack: localArtists.stackView.pop() + + Binding { + target: allArtistsView + property: 'filterState' + value: persistentSettings.filterState + } + + onFilterViewChanged: persistentSettings.filterState = filterState } visible: opacity > 0 @@ -518,10 +537,19 @@ } 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 @@ id: innerAlbumView GridBrowserView { + id: innerAlbumGridView property var stackView contentModel: elisa.singleArtistProxyModel @@ -848,13 +877,22 @@ }) } onGoBack: stackView.pop() + + Binding { + target: innerAlbumGridView + property: 'filterState' + value: persistentSettings.filterState + } + + onFilterViewChanged: persistentSettings.filterState = filterState } } Component { id: albumView MediaAlbumView { + id: albumGridView property var stackView contentModel: elisa.singleAlbumProxyModel @@ -875,6 +913,14 @@ allArtistsView.open(name, name, elisaTheme.defaultArtistImage, '') } onGoBack: stackView.pop() + + Binding { + target: albumGridView + property: 'filterState' + value: persistentSettings.filterState + } + + onFilterViewChanged: persistentSettings.filterState = filterState } } diff --git a/src/qml/GridBrowserView.qml b/src/qml/GridBrowserView.qml --- a/src/qml/GridBrowserView.qml +++ b/src/qml/GridBrowserView.qml @@ -37,9 +37,11 @@ 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 @@ onReplaceAndPlay:contentModel.replaceAndPlayOfPlayList() onGoBack: gridView.goBack() + + onFilterViewChanged: gridView.filterViewChanged(filterState) } Rectangle { diff --git a/src/qml/MediaAlbumView.qml b/src/qml/MediaAlbumView.qml --- a/src/qml/MediaAlbumView.qml +++ b/src/qml/MediaAlbumView.qml @@ -32,11 +32,13 @@ 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 @@ onGoBack: topListing.goBack() + onFilterViewChanged: topListing.filterViewChanged(filterState) + onShowArtist: topListing.showArtist(topListing.contentModel.sourceModel.author) onEnqueue: contentModel.enqueueToPlayList() diff --git a/src/qml/MediaAllTracksView.qml b/src/qml/MediaAllTracksView.qml --- a/src/qml/MediaAllTracksView.qml +++ b/src/qml/MediaAllTracksView.qml @@ -32,6 +32,9 @@ property var stackView property alias contentModel: contentDirectoryView.model + property alias filterState: navigationBar.state + + signal filterViewChanged(string filterState) SystemPalette { id: myPalette @@ -74,6 +77,8 @@ onEnqueue: contentModel.enqueueToPlayList() + onFilterViewChanged: rootElement.filterViewChanged(filterState) + onReplaceAndPlay: contentModel.replaceAndPlayOfPlayList() } diff --git a/src/qml/NavigationActionBar.qml b/src/qml/NavigationActionBar.qml --- a/src/qml/NavigationActionBar.qml +++ b/src/qml/NavigationActionBar.qml @@ -36,12 +36,12 @@ 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 @@ 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 @@ states: [ State { - name: 'collapsed' - when: collapsed + name: "" PropertyChanges { target: navigationBar height: elisaTheme.navigationBarHeight @@ -326,7 +328,6 @@ }, State { name: 'expanded' - when: !collapsed PropertyChanges { target: navigationBar height: elisaTheme.navigationBarHeight + elisaTheme.navigationBarFilterHeight