1
0
Fork 0

[UI] Optimize UI Rendering.

This commit is contained in:
NamedKitten 2018-11-19 12:24:13 +00:00
parent 4f65900e7e
commit b07f27f040

View file

@ -16,10 +16,9 @@ Item {
property var progress: progressBar property var progress: progressBar
property var controls: controlsBar property var controls: controlsBar
Rectangle { Item {
id: subtitlesBar id: subtitlesBar
visible: !appearance.useMpvSubs visible: !appearance.useMpvSubs
color: "transparent"
height: player.height / 8 height: player.height / 8
anchors.bottom: controlsBackground.top anchors.bottom: controlsBackground.top
anchors.bottomMargin: 5 anchors.bottomMargin: 5
@ -35,14 +34,13 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: 10 anchors.bottomMargin: 10
Rectangle { Item {
id: subsContainer id: subsContainer
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.rightMargin: 0 Layout.rightMargin: 0
Layout.leftMargin: 0 Layout.leftMargin: 0
Layout.maximumWidth: nativeSubtitles.width Layout.maximumWidth: nativeSubtitles.width
color: "transparent"
height: childrenRect.height height: childrenRect.height
Label { Label {
@ -91,7 +89,7 @@ Item {
color: appearance.mainBackground color: appearance.mainBackground
} }
Rectangle { Item {
id: controlsBar id: controlsBar
height: controlsBar.visible ? Screen.height / 24 : 0 height: controlsBar.visible ? Screen.height / 24 : 0
anchors.right: parent.right anchors.right: parent.right
@ -101,7 +99,6 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: 1 anchors.bottomMargin: 1
visible: true visible: true
color: "transparent"
Slider { Slider {
id: progressBar id: progressBar
@ -227,9 +224,7 @@ Item {
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.PreviousPlaylistItem) player.playerCommand(Enums.Commands.PreviousPlaylistItem)
} }
background: Rectangle { background: Item {}
color: "transparent"
}
Component.onCompleted: { Component.onCompleted: {
player.playlistPositionChanged.connect(function(position) { player.playlistPositionChanged.connect(function(position) {
if (position != 0 ) { if (position != 0 ) {
@ -252,9 +247,7 @@ Item {
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.TogglePlayPause) player.playerCommand(Enums.Commands.TogglePlayPause)
} }
background: Rectangle { background: Item {}
color: "transparent"
}
Component.onCompleted: { Component.onCompleted: {
player.playStatusChanged.connect(function(status) { player.playStatusChanged.connect(function(status) {
if (status == Enums.PlayStatus.Playing) { if (status == Enums.PlayStatus.Playing) {
@ -278,9 +271,7 @@ Item {
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.NextPlaylistItem) player.playerCommand(Enums.Commands.NextPlaylistItem)
} }
background: Rectangle { background: Item {}
color: "transparent"
}
} }
Button { Button {
@ -295,9 +286,7 @@ Item {
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.ToggleMute) player.playerCommand(Enums.Commands.ToggleMute)
} }
background: Rectangle { background: Item {}
color: "transparent"
}
Component.onCompleted: { Component.onCompleted: {
player.volumeStatusChanged.connect(function(status) { player.volumeStatusChanged.connect(function(status) {
if (status == Enums.VolumeStatus.Muted) { if (status == Enums.VolumeStatus.Muted) {
@ -396,9 +385,7 @@ Item {
onClicked: { onClicked: {
console.log("Settings Menu Not Yet Implemented.") console.log("Settings Menu Not Yet Implemented.")
} }
background: Rectangle { background: Item {}
color: "transparent"
}
} }
Button { Button {
@ -415,9 +402,7 @@ Item {
toggleFullscreen() toggleFullscreen()
} }
background: Rectangle { background: Item {}
color: "transparent"
}
} }
} }
} }