bigscreen-tube/bigscreen_tube/ui/MpvPlayerControls.qml

75 lines
1.9 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Templates 2.12 as QQCT
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.20 as Kirigami
import BigScreenTube 1.0
Item {
anchors.left: parent.left
anchors.right: parent.right
property bool opened: true
Component.onCompleted: {
playButton.forceActiveFocus()
}
Rectangle {
width: parent.width
height: parent.height
y: opened ? 0 : parent.height
gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 1.0; color: Kirigami.Theme.backgroundColor }
}
RowLayout {
id: mainOSDLayout
anchors {
margins: Kirigami.Units.largeSpacing
bottom: parent.bottom
right: parent.right
left: parent.left
}
MediaControlButton {
id: playButton
iconSource: video.paused ? "images/play-button.svg" : "images/pause-button.svg"
KeyNavigation.right: seekBar
onClicked: {
video.togglePause()
}
}
SeekBar {
id: seekBar
Layout.fillWidth: true
Layout.fillHeight: true
KeyNavigation.right: captionButton
KeyNavigation.left: playButton
}
MediaControlButton {
id: captionButton
iconSource: "images/caption-button.svg"
KeyNavigation.left: seekBar
KeyNavigation.right: fullScreenButton
}
MediaControlButton {
id: fullScreenButton
iconSource: "images/full-screen-button.svg"
KeyNavigation.left: captionButton
}
}
}
}