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 {
property bool showPlaylist
property bool showExpandedFilterView
property alias currentViewIndex: listViews.currentIndex
property Kirigami.ContextDrawer playlistDrawer
function goBack() {
viewManager.goBack()
......@@ -65,8 +66,8 @@ RowLayout {
isSubPage: (browseStackView.depth >= 2),
haveTreeModel: configurationData.isTreeModel,
stackView: configurationData.browseStackView,
opacity: 0,
})
opacity: 1,
}, StackView.Immediate)
}
onOpenListView: {
......@@ -93,10 +94,10 @@ RowLayout {
stackView: browseStackView,
displaySingleAlbum: configurationData.displaySingleAlbum,
showSection: configurationData.showDiscHeaders,
opacity: 0,
opacity: 1,
radioCase: configurationData.radioCase,
haveTreeModel: configurationData.isTreeModel,
})
}, StackView.Immediate)
}
onSwitchFilesBrowserView: {
......@@ -109,8 +110,8 @@ RowLayout {
browseStackView.push(filesBrowserView, {
mainTitle: mainTitle,
image: imageUrl,
opacity: 0,
})
opacity: 1,
}, StackView.Immediate)
}
onSwitchContextView: {
......@@ -123,8 +124,8 @@ RowLayout {
browseStackView.push(albumContext, {
mainTitle: mainTitle,
image: imageUrl,
opacity: 0,
})
opacity: 1,
}, StackView.Immediate)
}
onPopOneView: {
......@@ -270,8 +271,8 @@ RowLayout {
states: [
State {
name: "browsingViewsNoPlaylist"
when: contentViewContainer.showPlaylist === false || mainWindow.width < elisaTheme.viewSelectorSmallSizeThreshold
name: "smallScreen"
when: mainWindow.width < elisaTheme.viewSelectorSmallSizeThreshold
PropertyChanges {
target: playList
Layout.minimumWidth: 0
......@@ -282,10 +283,37 @@ RowLayout {
target: playListSeparatorItem
visible: false
}
PropertyChanges {
target: playlistDrawer
modal: true
drawerOpen: true
handleVisible: true
}
},
State {
name: 'browsingViews'
when: contentViewContainer.showPlaylist === true || mainWindow.width >= elisaTheme.viewSelectorSmallSizeThreshold
name: "wideScreenNoPlaylist"
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 {
target: playList
Layout.minimumWidth: contentViewContainer.width * 0.28
......@@ -296,6 +324,14 @@ RowLayout {
target: playListSeparatorItem
visible: true
}
PropertyChanges {
target: playlistDrawer
collapsed: true
visible: false
drawerOpen: false
handleVisible: false
}
}
]
transitions: Transition {
......
......@@ -14,11 +14,25 @@ import org.kde.elisa.host 1.0
import Qt.labs.settings 1.0
import Qt.labs.platform 1.1
ApplicationWindow {
Kirigami.ApplicationWindow {
id: mainWindow
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
property int minHeight: 320
......@@ -259,6 +273,7 @@ ApplicationWindow {
Layout.fillWidth: true
showPlaylist: persistentSettings.showPlaylist
showExpandedFilterView: persistentSettings.expandedFilterView
playlistDrawer: playlistDrawer
}
}
}
......@@ -295,6 +310,13 @@ ApplicationWindow {
target: headerBar
Layout.minimumHeight: 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