Commit e901e431 authored by stef lep's avatar stef lep Committed by Matthieu Gallien

when pushing views for content, disactivate transitions

still keep transition on pop but no longer on push

fixes opacity sometime being equal to 0 without a clear explanation
parent fb8401ec
...@@ -18,6 +18,7 @@ RowLayout { ...@@ -18,6 +18,7 @@ RowLayout {
property bool showPlaylist property bool showPlaylist
property bool showExpandedFilterView property bool showExpandedFilterView
property alias currentViewIndex: listViews.currentIndex property alias currentViewIndex: listViews.currentIndex
property Kirigami.ContextDrawer playlistDrawer
function goBack() { function goBack() {
viewManager.goBack() viewManager.goBack()
...@@ -65,8 +66,8 @@ RowLayout { ...@@ -65,8 +66,8 @@ RowLayout {
isSubPage: (browseStackView.depth >= 2), isSubPage: (browseStackView.depth >= 2),
haveTreeModel: configurationData.isTreeModel, haveTreeModel: configurationData.isTreeModel,
stackView: configurationData.browseStackView, stackView: configurationData.browseStackView,
opacity: 0, opacity: 1,
}) }, StackView.Immediate)
} }
onOpenListView: { onOpenListView: {
...@@ -93,10 +94,10 @@ RowLayout { ...@@ -93,10 +94,10 @@ RowLayout {
stackView: browseStackView, stackView: browseStackView,
displaySingleAlbum: configurationData.displaySingleAlbum, displaySingleAlbum: configurationData.displaySingleAlbum,
showSection: configurationData.showDiscHeaders, showSection: configurationData.showDiscHeaders,
opacity: 0, opacity: 1,
radioCase: configurationData.radioCase, radioCase: configurationData.radioCase,
haveTreeModel: configurationData.isTreeModel, haveTreeModel: configurationData.isTreeModel,
}) }, StackView.Immediate)
} }
onSwitchFilesBrowserView: { onSwitchFilesBrowserView: {
...@@ -109,8 +110,8 @@ RowLayout { ...@@ -109,8 +110,8 @@ RowLayout {
browseStackView.push(filesBrowserView, { browseStackView.push(filesBrowserView, {
mainTitle: mainTitle, mainTitle: mainTitle,
image: imageUrl, image: imageUrl,
opacity: 0, opacity: 1,
}) }, StackView.Immediate)
} }
onSwitchContextView: { onSwitchContextView: {
...@@ -123,8 +124,8 @@ RowLayout { ...@@ -123,8 +124,8 @@ RowLayout {
browseStackView.push(albumContext, { browseStackView.push(albumContext, {
mainTitle: mainTitle, mainTitle: mainTitle,
image: imageUrl, image: imageUrl,
opacity: 0, opacity: 1,
}) }, StackView.Immediate)
} }
onPopOneView: { onPopOneView: {
...@@ -270,8 +271,8 @@ RowLayout { ...@@ -270,8 +271,8 @@ RowLayout {
states: [ states: [
State { State {
name: "browsingViewsNoPlaylist" name: "smallScreen"
when: contentViewContainer.showPlaylist === false || mainWindow.width < elisaTheme.viewSelectorSmallSizeThreshold when: mainWindow.width < elisaTheme.viewSelectorSmallSizeThreshold
PropertyChanges { PropertyChanges {
target: playList target: playList
Layout.minimumWidth: 0 Layout.minimumWidth: 0
...@@ -282,10 +283,37 @@ RowLayout { ...@@ -282,10 +283,37 @@ RowLayout {
target: playListSeparatorItem target: playListSeparatorItem
visible: false visible: false
} }
PropertyChanges {
target: playlistDrawer
modal: true
drawerOpen: true
handleVisible: true
}
}, },
State { State {
name: 'browsingViews' name: "wideScreenNoPlaylist"
when: contentViewContainer.showPlaylist === true || mainWindow.width >= elisaTheme.viewSelectorSmallSizeThreshold when: mainWindow.width >= elisaTheme.viewSelectorSmallSizeThreshold && contentViewContainer.showPlaylist === false
PropertyChanges {
target: playList
Layout.minimumWidth: 0
Layout.maximumWidth: 0
Layout.preferredWidth: 0
}
PropertyChanges {
target: playListSeparatorItem
visible: false
}
PropertyChanges {
target: playlistDrawer
collapsed: true
visible: false
drawerOpen: false
handleVisible: false
}
},
State {
name: 'wideScreenPlaylist'
when: mainWindow.width >= elisaTheme.viewSelectorSmallSizeThreshold && contentViewContainer.showPlaylist === true
PropertyChanges { PropertyChanges {
target: playList target: playList
Layout.minimumWidth: contentViewContainer.width * 0.28 Layout.minimumWidth: contentViewContainer.width * 0.28
...@@ -296,6 +324,14 @@ RowLayout { ...@@ -296,6 +324,14 @@ RowLayout {
target: playListSeparatorItem target: playListSeparatorItem
visible: true visible: true
} }
PropertyChanges {
target: playlistDrawer
collapsed: true
visible: false
drawerOpen: false
handleVisible: false
}
} }
] ]
transitions: Transition { transitions: Transition {
......
...@@ -14,10 +14,24 @@ import org.kde.elisa.host 1.0 ...@@ -14,10 +14,24 @@ import org.kde.elisa.host 1.0
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import Qt.labs.platform 1.1 import Qt.labs.platform 1.1
ApplicationWindow { Kirigami.ApplicationWindow {
id: mainWindow id: mainWindow
visible: true visible: true
contextDrawer: Kirigami.ContextDrawer {
id: playlistDrawer
handleClosedIcon.source: "view-media-playlist"
handleOpenIcon.source: "view-right-close"
// without this drawer button is never shown
enabled: true
MediaPlayListView {
id: playList
anchors.fill: parent
onStartPlayback: ElisaApplication.audioControl.ensurePlay()
onPausePlayback: ElisaApplication.audioControl.playPause()
}
}
minimumWidth: 590 minimumWidth: 590
property int minHeight: 320 property int minHeight: 320
...@@ -259,6 +273,7 @@ ApplicationWindow { ...@@ -259,6 +273,7 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
showPlaylist: persistentSettings.showPlaylist showPlaylist: persistentSettings.showPlaylist
showExpandedFilterView: persistentSettings.expandedFilterView showExpandedFilterView: persistentSettings.expandedFilterView
playlistDrawer: playlistDrawer
} }
} }
} }
...@@ -295,6 +310,13 @@ ApplicationWindow { ...@@ -295,6 +310,13 @@ ApplicationWindow {
target: headerBar target: headerBar
Layout.minimumHeight: mainWindow.height Layout.minimumHeight: mainWindow.height
Layout.maximumHeight: mainWindow.height Layout.maximumHeight: mainWindow.height
},
PropertyChanges {
target: playlistDrawer
collapsed: true
visible: false
drawerOpen: false
handleVisible: false
} }
] ]
} }
......
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