[vlc-commits] QML: improve the mini player navigation
Adrien Maglo
git at videolan.org
Tue Jul 16 16:01:17 CEST 2019
vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Jun 14 19:12:50 2019 +0200| [850fc9f1921b5b85d04f86bde8adf0af9eee3a40] | committer: Jean-Baptiste Kempf
QML: improve the mini player navigation
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=850fc9f1921b5b85d04f86bde8adf0af9eee3a40
---
modules/gui/qt/qml/MainInterface.qml | 15 +++++++++++++--
modules/gui/qt/qml/mediacenter/MiniPlayer.qml | 5 ++++-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt/qml/MainInterface.qml b/modules/gui/qt/qml/MainInterface.qml
index e3541272ee..abe9de7c64 100644
--- a/modules/gui/qt/qml/MainInterface.qml
+++ b/modules/gui/qt/qml/MainInterface.qml
@@ -77,6 +77,7 @@ Rectangle {
{ name: "about", component: aboutComp },
{ name: "mc", url: "qrc:///mediacenter/MCMainDisplay.qml" },
{ name: "playlist", url: "qrc:///playlist/PlaylistMainView.qml" },
+ { name: "player", component: audioplayerComp },
]
function loadCurrentHistoryView() {
@@ -125,12 +126,22 @@ Rectangle {
Connections {
target: player
onPlayingStateChanged: {
+ console.log("onPlayingStateChanged", state)
if (state === PlayerController.PLAYING_STATE_STOPPED)
loadCurrentHistoryView()
+ else {
+ console.log(player.hasVideoOutput, history.current.view !== "player")
+ if (player.hasVideoOutput && history.current.view !== "player")
+ history.push(["player"], History.Go)
+ }
}
+
onHasVideoOutputChanged: {
- if (player.hasVideoOutput)
- stackView.replace(audioplayerComp)
+ console.log("before push player", player.hasVideoOutput)
+ if (player.hasVideoOutput) {
+ console.log("push player")
+ history.push(["player"], History.Go)
+ }
}
}
}
diff --git a/modules/gui/qt/qml/mediacenter/MiniPlayer.qml b/modules/gui/qt/qml/mediacenter/MiniPlayer.qml
index b7690590c7..aeb8e40c17 100644
--- a/modules/gui/qt/qml/mediacenter/MiniPlayer.qml
+++ b/modules/gui/qt/qml/mediacenter/MiniPlayer.qml
@@ -13,11 +13,14 @@ Utils.NavigableFocusScope {
Layout.fillWidth: true
+ height: player.playingState === PlayerController.PLAYING_STATE_STOPPED ? 0 : root.childrenRect.height
+
+
Connections {
target: player
onPlayingStateChanged: {
root.height = VLCStyle.miniPlayerHeight
- if (state === PlayerController.PLAYING_STATE_STOPPED)
+ if (player.playingState === PlayerController.PLAYING_STATE_STOPPED)
animateRetract.start()
else {
animateExpand.start()
More information about the vlc-commits
mailing list