1
0
Fork 0

[UI] Made backwards compatable with older QtQuick versions.

This commit is contained in:
NamedKitten 2018-12-22 14:07:44 +00:00
parent 1c3046d5e1
commit 2256244b94
28 changed files with 28 additions and 48 deletions

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -96,7 +96,6 @@ Item {
} }
Connections { Connections {
target: player target: player
enabled: true
onSubtitlesChanged: function (subtitles) { onSubtitlesChanged: function (subtitles) {
nativeSubs.text = subtitles nativeSubs.text = subtitles
} }

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
Menu { Menu {

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Window 2.11 import QtQuick.Window 2.11
@ -98,7 +98,6 @@ Dialog {
Connections { Connections {
target: player target: player
enabled: true
onPlaylistChanged: function (playlist) { onPlaylistChanged: function (playlist) {
playlistModel.clear() playlistModel.clear()
thumbnailJobs = [] thumbnailJobs = []
@ -171,7 +170,6 @@ Dialog {
contentItem: Text { contentItem: Text {
id: playlistItemText id: playlistItemText
font: parent.font font: parent.font
bottomPadding: 0
color: "white" color: "white"
text: playlistItem.getText(itemTitle, itemURL) text: playlistItem.getText(itemTitle, itemURL)
height: parent.height height: parent.height

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import player 1.0 import player 1.0

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import player 1.0 import player 1.0

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
@ -7,7 +7,6 @@ MenuItem {
implicitHeight: 20 implicitHeight: 20
contentItem: Text { contentItem: Text {
leftPadding: menuItem.indicator.width
text: menuItem.text text: menuItem.text
font.family: appearance.fontName font.family: appearance.fontName

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Window 2.11 import QtQuick.Window 2.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Window 2.11 import QtQuick.Window 2.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import player 1.0 import player 1.0

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Window 2.11 import QtQuick.Window 2.11
@ -22,7 +22,6 @@ MenuBar {
Connections { Connections {
target: player target: player
enabled: true
onTracksChanged: function (tracks) { onTracksChanged: function (tracks) {
menuBar.updateTracks(tracks) menuBar.updateTracks(tracks)
} }
@ -348,7 +347,6 @@ MenuBar {
Connections { Connections {
target: player target: player
enabled: true
onAudioDevicesChanged: function (ad) { onAudioDevicesChanged: function (ad) {
audioDeviceMenu.updateAudioDevices(ad) audioDeviceMenu.updateAudioDevices(ad)
} }

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -23,7 +23,6 @@ Button {
} }
Connections { Connections {
target: player target: player
enabled: true
onPlayStatusChanged: function (status) { onPlayStatusChanged: function (status) {
if (status == Enums.PlayStatus.Playing) { if (status == Enums.PlayStatus.Playing) {
icon.source = "qrc:/icons/" + appearance.themeName + "/pause.svg" icon.source = "qrc:/icons/" + appearance.themeName + "/pause.svg"

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -25,7 +25,6 @@ Button {
} }
Connections { Connections {
target: player target: player
enabled: true
onPlaylistPositionChanged: function (position) { onPlaylistPositionChanged: function (position) {
if (appearance.themeName == "YouTube") { if (appearance.themeName == "YouTube") {
if (position != 0) { if (position != 0) {

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -9,8 +9,6 @@ import player 1.0
Text { Text {
id: speedText id: speedText
leftPadding: 0
rightPadding: 0
text: "1x" text: "1x"
font.family: appearance.fontName font.family: appearance.fontName
font.pixelSize: layout.height / 2.5 font.pixelSize: layout.height / 2.5
@ -22,7 +20,6 @@ Text {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
Connections { Connections {
target: player target: player
enabled: true
onSpeedChanged: function (speed) { onSpeedChanged: function (speed) {
speedText.text = String(speed) + "x" speedText.text = String(speed) + "x"
} }

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -12,14 +12,12 @@ Text {
objectName: "timeLabel" objectName: "timeLabel"
text: "0:00 / 0:00" text: "0:00 / 0:00"
color: "white" color: "white"
padding: 2
font.family: appearance.fontName font.family: appearance.fontName
font.pixelSize: layout.height / 2.5 font.pixelSize: layout.height / 2.5
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering renderType: Text.NativeRendering
Connections { Connections {
target: player target: player
enabled: true
onDurationStringChanged: function (durationString) { onDurationStringChanged: function (durationString) {
timeLabel.text = durationString timeLabel.text = durationString
} }

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -31,7 +31,6 @@ Rectangle {
Connections { Connections {
target: player target: player
enabled: true
onVolumeChanged: function (volume) { onVolumeChanged: function (volume) {
volumeSlider.value = volume volumeSlider.value = volume
} }

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -15,7 +15,6 @@ Slider {
value: 0.0 value: 0.0
Connections { Connections {
target: player target: player
enabled: true
onPositionChanged: function (position) { onPositionChanged: function (position) {
if (!pressed) { if (!pressed) {
progressBar.value = position progressBar.value = position
@ -107,7 +106,6 @@ Slider {
id: chapterMarkers id: chapterMarkers
Connections { Connections {
target: player target: player
enabled: true
onChaptersChanged: function (chapters) { onChaptersChanged: function (chapters) {
for (var i = 0, len = chapters.length; i < len; i++) { for (var i = 0, len = chapters.length; i < len; i++) {
var component = Qt.createComponent("ChapterMarker.qml") var component = Qt.createComponent("ChapterMarker.qml")

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -35,7 +35,6 @@ Button {
Connections { Connections {
target: player target: player
enabled: true
onVolumeStatusChanged: updateStatus onVolumeStatusChanged: updateStatus
} }
} }

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -25,7 +25,6 @@ Slider {
} }
Connections { Connections {
target: player target: player
enabled: true
onVolumeChanged: function (volume) { onVolumeChanged: function (volume) {
volumeBar.value = volume volumeBar.value = volume
} }

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import "translations.js" as Translations import "translations.js" as Translations

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11

View file

@ -1,4 +1,4 @@
import QtQuick 2.11 import QtQuick 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
@ -415,7 +415,6 @@ Window {
|| (mainWindow.visibility == Window.FullScreen)) || (mainWindow.visibility == Window.FullScreen))
Connections { Connections {
target: player target: player
enabled: true
onTitleChanged: function (title) { onTitleChanged: function (title) {
titleLabel.text = title titleLabel.text = title
} }
@ -453,7 +452,6 @@ Window {
id: hoverProgressLabel id: hoverProgressLabel
text: "0:00" text: "0:00"
color: "white" color: "white"
padding: 2
z: 90 z: 90
font.family: appearance.fontName font.family: appearance.fontName
font.pixelSize: mainWindow.virtualHeight / 50 font.pixelSize: mainWindow.virtualHeight / 50