Skip to content
Snippets Groups Projects
Commit bf8e6301 authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Jean-Baptiste Kempf
Browse files

qml: make miniplayer invisible when out of view

parent d2e59e71
No related branches found
No related tags found
1 merge request!920qml: make miniplayer invisible when out of view
Pipeline #166272 passed with stage
in 35 minutes and 16 seconds
......@@ -62,7 +62,7 @@ FocusScope {
stackView.currentItem.Navigation.upItem = sourcesBanner
stackView.currentItem.Navigation.rightItem = playlistColumn
stackView.currentItem.Navigation.downItem = Qt.binding(function() {
return miniPlayer.expanded ? miniPlayer : medialibId
return miniPlayer.visible ? miniPlayer : medialibId
})
sourcesBanner.localMenuDelegate = Qt.binding(function () { return !!stackView.currentItem.localMenuDelegate ? stackView.currentItem.localMenuDelegate : null })
......@@ -331,7 +331,7 @@ FocusScope {
Navigation.parentItem: medialibId
Navigation.upItem: sourcesBanner
Navigation.downItem: miniPlayer.expanded ? miniPlayer : null
Navigation.downItem: miniPlayer.visible ? miniPlayer : null
Navigation.leftAction: function() {
stackView.currentItem.setCurrentItemFocus(Qt.TabFocusReason);
......@@ -435,7 +435,10 @@ FocusScope {
Player.MiniPlayer {
id: miniPlayer
visible: !root._inhibitMiniPlayer
Binding on state {
when: root._inhibitMiniPlayer && !miniPlayer.visible
value: ""
}
anchors.left: parent.left
anchors.right: parent.right
......@@ -445,12 +448,12 @@ FocusScope {
Navigation.parentItem: medialibId
Navigation.upItem: stackView
Navigation.cancelItem:sourcesBanner
onExpandedChanged: {
if (!expanded && miniPlayer.activeFocus)
onVisibleChanged: {
if (!visible && miniPlayer.activeFocus)
stackView.forceActiveFocus()
}
mainContent: mainColumn
effectSource: mainColumn
}
Connections {
......
......@@ -14,17 +14,21 @@ FocusScope {
implicitHeight: controlBar.implicitHeight
height: 0
readonly property bool expanded: (height !== 0)
visible: false
property var mainContent: undefined
property alias effectSource: effect.source
state: (player.playingState === PlayerController.PLAYING_STATE_STOPPED) ? ""
: "expanded"
states: State {
id: stateExpanded
name: "expanded"
PropertyChanges {
target: root
visible: true
}
PropertyChanges {
target: root
height: implicitHeight
......@@ -34,7 +38,12 @@ FocusScope {
transitions: Transition {
from: ""; to: "expanded"
reversible: true
NumberAnimation { property: "height"; easing.type: Easing.InOutSine; duration: VLCStyle.duration_normal; }
SequentialAnimation {
// visible should change first, in order for inner layouts to calculate implicitHeight correctly
PropertyAction { property: "visible" }
NumberAnimation { property: "height"; easing.type: Easing.InOutSine; duration: VLCStyle.duration_normal; }
}
}
// this MouseArea prevents mouse events to be sent below miniplayer
......@@ -45,6 +54,7 @@ FocusScope {
}
Widgets.FrostedGlassEffect {
id: effect
anchors.fill: controlBar
source: mainContent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment