2018-12-22 14:07:44 +00:00
|
|
|
import QtQuick 2.0
|
2018-12-22 14:13:53 +00:00
|
|
|
import QtQuick.Controls 2.3
|
2018-12-22 14:26:34 +00:00
|
|
|
import QtQuick.Layouts 1.2
|
2018-11-10 19:55:59 +00:00
|
|
|
import player 1.0
|
|
|
|
|
|
|
|
Item {
|
2018-11-28 18:41:54 +00:00
|
|
|
id: controlsBarItem
|
2020-04-23 16:25:40 +01:00
|
|
|
property var combinedHeight: progressBar.height + controlsBackground.height
|
2020-04-23 15:10:48 +01:00
|
|
|
property bool controlsShowing: true
|
2020-04-24 17:06:14 +01:00
|
|
|
anchors {
|
|
|
|
bottom: parent.bottom
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
}
|
2020-04-23 15:10:48 +01:00
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: globalConnections
|
2020-04-23 17:04:37 +01:00
|
|
|
onHideUI: function (force) {
|
|
|
|
controlsBarItem.controlsShowing = false
|
2020-04-23 15:10:48 +01:00
|
|
|
}
|
|
|
|
onShowUI: {
|
2020-04-23 17:04:37 +01:00
|
|
|
controlsBarItem.controlsShowing = true
|
2020-04-23 15:10:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-05 12:05:18 +00:00
|
|
|
Connections {
|
|
|
|
target: appearance
|
|
|
|
onThemeNameChanged: setControlsTheme(appearance.themeName)
|
|
|
|
}
|
|
|
|
|
2018-11-28 18:41:54 +00:00
|
|
|
function setControlsTheme(themeName) {
|
|
|
|
for (var i = 0; i < controlsBar.children.length; ++i) {
|
|
|
|
if (controlsBar.children[i].objectName == "buttonLayout") {
|
|
|
|
controlsBar.children[i].destroy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var component = Qt.createComponent(themeName + "ButtonLayout.qml")
|
2018-12-03 08:17:57 +00:00
|
|
|
if (component.status == Component.Error) {
|
2018-12-09 02:35:08 +00:00
|
|
|
console.error("Error loading component: " + component.errorString())
|
2018-12-03 08:17:57 +00:00
|
|
|
}
|
2020-04-22 13:17:08 +01:00
|
|
|
component.createObject(controlsBar, {})
|
2018-11-28 18:41:54 +00:00
|
|
|
}
|
|
|
|
|
2020-04-24 17:06:14 +01:00
|
|
|
SubtitlesBar {
|
2018-11-10 19:55:59 +00:00
|
|
|
anchors.bottom: controlsBackground.top
|
|
|
|
}
|
|
|
|
|
2020-04-23 17:04:37 +01:00
|
|
|
VideoProgress {
|
|
|
|
id: progressBar
|
2020-04-24 17:06:14 +01:00
|
|
|
visible: controlsBarItem.controlsShowing && appearance.themeName != "RoosterTeeth"
|
2020-04-23 17:04:37 +01:00
|
|
|
bottomPadding: 0
|
2020-04-26 22:45:04 +01:00
|
|
|
rightPadding: 0
|
|
|
|
leftPadding: 0
|
2020-04-23 17:04:37 +01:00
|
|
|
z: 20
|
2020-04-24 17:06:14 +01:00
|
|
|
anchors {
|
|
|
|
bottom: controlsBackground.top
|
|
|
|
left: controlsBackground.left
|
|
|
|
right: controlsBackground.right
|
2020-04-26 22:45:04 +01:00
|
|
|
leftMargin: parent.width / 128
|
|
|
|
rightMargin: parent.width / 128
|
2020-04-24 17:06:14 +01:00
|
|
|
bottomMargin: 0
|
|
|
|
}
|
2020-04-23 17:04:37 +01:00
|
|
|
}
|
2020-04-23 15:10:48 +01:00
|
|
|
|
2018-11-10 19:55:59 +00:00
|
|
|
Rectangle {
|
|
|
|
id: controlsBackground
|
2018-12-05 12:05:18 +00:00
|
|
|
height: controlsBar.visible ? controlsBar.height
|
|
|
|
+ (appearance.themeName
|
|
|
|
== "RoosterTeeth" ? 0 : progressBar.topPadding) : 0
|
2018-11-10 19:55:59 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2018-12-01 12:10:52 +00:00
|
|
|
color: getAppearanceValueForTheme(appearance.themeName,
|
|
|
|
"mainBackground")
|
2020-04-23 15:10:48 +01:00
|
|
|
visible: controlsBarItem.controlsShowing
|
|
|
|
z: 10
|
2020-04-24 17:06:14 +01:00
|
|
|
anchors {
|
|
|
|
bottom: parent.bottom
|
|
|
|
left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
}
|
2018-11-10 19:55:59 +00:00
|
|
|
}
|
|
|
|
|
2018-11-19 12:24:13 +00:00
|
|
|
Item {
|
2018-11-10 19:55:59 +00:00
|
|
|
id: controlsBar
|
2018-12-06 08:13:14 +00:00
|
|
|
height: controlsBar.visible ? mainWindow.virtualHeight / 20 : 0
|
2020-04-23 15:10:48 +01:00
|
|
|
visible: controlsBarItem.controlsShowing
|
|
|
|
z: 30
|
2020-04-24 17:06:14 +01:00
|
|
|
anchors {
|
|
|
|
right: parent.right
|
|
|
|
rightMargin: parent.width / 128
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: parent.width / 128
|
|
|
|
bottom: parent.bottom
|
|
|
|
bottomMargin: 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
setControlsTheme(appearance.themeName)
|
2018-11-10 19:55:59 +00:00
|
|
|
}
|
|
|
|
}
|