From 2256244b948cbda5531aa8c2e258554218fc8308 Mon Sep 17 00:00:00 2001 From: NamedKitten Date: Sat, 22 Dec 2018 14:07:44 +0000 Subject: [PATCH] [UI] Made backwards compatable with older QtQuick versions. --- src/qml/ControlsBar.qml | 3 +-- src/qml/CustomMenu.qml | 2 +- src/qml/Dialogs/PlaylistDialog.qml | 4 +--- src/qml/Items/AudioDeviceItem.qml | 2 +- src/qml/Items/ChapterMarkerItem.qml | 2 +- src/qml/Items/CustomMenuItem.qml | 3 +-- src/qml/Items/ThumbnailProcess.qml | 2 +- src/qml/Items/TitleProcess.qml | 2 +- src/qml/Items/TrackItem.qml | 2 +- src/qml/MainMenu.qml | 4 +--- src/qml/NiconicoButtonLayout.qml | 2 +- src/qml/RoosterTeethButtonLayout.qml | 2 +- src/qml/UIComponents/BackwardButton.qml | 2 +- src/qml/UIComponents/ForwardButton.qml | 2 +- src/qml/UIComponents/FullscreenButton.qml | 2 +- src/qml/UIComponents/PlayPauseButton.qml | 3 +-- src/qml/UIComponents/PlaylistNextButton.qml | 2 +- src/qml/UIComponents/PlaylistPrevButton.qml | 3 +-- src/qml/UIComponents/SettingsButton.qml | 2 +- src/qml/UIComponents/SpeedText.qml | 5 +---- src/qml/UIComponents/TimeLabel.qml | 4 +--- src/qml/UIComponents/VerticalVolume.qml | 3 +-- src/qml/UIComponents/VideoProgress.qml | 4 +--- src/qml/UIComponents/VolumeButton.qml | 3 +-- src/qml/UIComponents/VolumeSlider.qml | 3 +-- src/qml/Utils/Translator.qml | 2 +- src/qml/YouTubeButtonLayout.qml | 2 +- src/qml/main.qml | 4 +--- 28 files changed, 28 insertions(+), 48 deletions(-) diff --git a/src/qml/ControlsBar.qml b/src/qml/ControlsBar.qml index 780bdbe..0dfe868 100644 --- a/src/qml/ControlsBar.qml +++ b/src/qml/ControlsBar.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -96,7 +96,6 @@ Item { } Connections { target: player - enabled: true onSubtitlesChanged: function (subtitles) { nativeSubs.text = subtitles } diff --git a/src/qml/CustomMenu.qml b/src/qml/CustomMenu.qml index a0b671b..c0b8f84 100644 --- a/src/qml/CustomMenu.qml +++ b/src/qml/CustomMenu.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 Menu { diff --git a/src/qml/Dialogs/PlaylistDialog.qml b/src/qml/Dialogs/PlaylistDialog.qml index ab8ed27..bb9b15c 100644 --- a/src/qml/Dialogs/PlaylistDialog.qml +++ b/src/qml/Dialogs/PlaylistDialog.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Window 2.11 @@ -98,7 +98,6 @@ Dialog { Connections { target: player - enabled: true onPlaylistChanged: function (playlist) { playlistModel.clear() thumbnailJobs = [] @@ -171,7 +170,6 @@ Dialog { contentItem: Text { id: playlistItemText font: parent.font - bottomPadding: 0 color: "white" text: playlistItem.getText(itemTitle, itemURL) height: parent.height diff --git a/src/qml/Items/AudioDeviceItem.qml b/src/qml/Items/AudioDeviceItem.qml index cff6a93..738943e 100644 --- a/src/qml/Items/AudioDeviceItem.qml +++ b/src/qml/Items/AudioDeviceItem.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import Qt.labs.settings 1.0 import player 1.0 diff --git a/src/qml/Items/ChapterMarkerItem.qml b/src/qml/Items/ChapterMarkerItem.qml index ea12551..f4ee92c 100644 --- a/src/qml/Items/ChapterMarkerItem.qml +++ b/src/qml/Items/ChapterMarkerItem.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import Qt.labs.settings 1.0 import player 1.0 diff --git a/src/qml/Items/CustomMenuItem.qml b/src/qml/Items/CustomMenuItem.qml index f114de2..039e827 100644 --- a/src/qml/Items/CustomMenuItem.qml +++ b/src/qml/Items/CustomMenuItem.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import Qt.labs.settings 1.0 @@ -7,7 +7,6 @@ MenuItem { implicitHeight: 20 contentItem: Text { - leftPadding: menuItem.indicator.width text: menuItem.text font.family: appearance.fontName diff --git a/src/qml/Items/ThumbnailProcess.qml b/src/qml/Items/ThumbnailProcess.qml index 6d18f44..2d059fb 100644 --- a/src/qml/Items/ThumbnailProcess.qml +++ b/src/qml/Items/ThumbnailProcess.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Window 2.11 diff --git a/src/qml/Items/TitleProcess.qml b/src/qml/Items/TitleProcess.qml index 80e7a4b..3838172 100644 --- a/src/qml/Items/TitleProcess.qml +++ b/src/qml/Items/TitleProcess.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Window 2.11 diff --git a/src/qml/Items/TrackItem.qml b/src/qml/Items/TrackItem.qml index b26fc62..ab19f4c 100644 --- a/src/qml/Items/TrackItem.qml +++ b/src/qml/Items/TrackItem.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import Qt.labs.settings 1.0 import player 1.0 diff --git a/src/qml/MainMenu.qml b/src/qml/MainMenu.qml index 9444835..7c47e8f 100644 --- a/src/qml/MainMenu.qml +++ b/src/qml/MainMenu.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Window 2.11 @@ -22,7 +22,6 @@ MenuBar { Connections { target: player - enabled: true onTracksChanged: function (tracks) { menuBar.updateTracks(tracks) } @@ -348,7 +347,6 @@ MenuBar { Connections { target: player - enabled: true onAudioDevicesChanged: function (ad) { audioDeviceMenu.updateAudioDevices(ad) } diff --git a/src/qml/NiconicoButtonLayout.qml b/src/qml/NiconicoButtonLayout.qml index 3873fcd..09f5f29 100644 --- a/src/qml/NiconicoButtonLayout.qml +++ b/src/qml/NiconicoButtonLayout.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/RoosterTeethButtonLayout.qml b/src/qml/RoosterTeethButtonLayout.qml index 5393767..d4d55b7 100644 --- a/src/qml/RoosterTeethButtonLayout.qml +++ b/src/qml/RoosterTeethButtonLayout.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/UIComponents/BackwardButton.qml b/src/qml/UIComponents/BackwardButton.qml index 9886112..e252f0b 100644 --- a/src/qml/UIComponents/BackwardButton.qml +++ b/src/qml/UIComponents/BackwardButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/UIComponents/ForwardButton.qml b/src/qml/UIComponents/ForwardButton.qml index 78daf51..9c094ba 100644 --- a/src/qml/UIComponents/ForwardButton.qml +++ b/src/qml/UIComponents/ForwardButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/UIComponents/FullscreenButton.qml b/src/qml/UIComponents/FullscreenButton.qml index 2d838bd..8922ef0 100644 --- a/src/qml/UIComponents/FullscreenButton.qml +++ b/src/qml/UIComponents/FullscreenButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/UIComponents/PlayPauseButton.qml b/src/qml/UIComponents/PlayPauseButton.qml index e0b3652..2f9c599 100644 --- a/src/qml/UIComponents/PlayPauseButton.qml +++ b/src/qml/UIComponents/PlayPauseButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -23,7 +23,6 @@ Button { } Connections { target: player - enabled: true onPlayStatusChanged: function (status) { if (status == Enums.PlayStatus.Playing) { icon.source = "qrc:/icons/" + appearance.themeName + "/pause.svg" diff --git a/src/qml/UIComponents/PlaylistNextButton.qml b/src/qml/UIComponents/PlaylistNextButton.qml index 809218b..57af10b 100644 --- a/src/qml/UIComponents/PlaylistNextButton.qml +++ b/src/qml/UIComponents/PlaylistNextButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/UIComponents/PlaylistPrevButton.qml b/src/qml/UIComponents/PlaylistPrevButton.qml index 3d5e4e5..f6a034b 100644 --- a/src/qml/UIComponents/PlaylistPrevButton.qml +++ b/src/qml/UIComponents/PlaylistPrevButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -25,7 +25,6 @@ Button { } Connections { target: player - enabled: true onPlaylistPositionChanged: function (position) { if (appearance.themeName == "YouTube") { if (position != 0) { diff --git a/src/qml/UIComponents/SettingsButton.qml b/src/qml/UIComponents/SettingsButton.qml index 9f89fd4..1f15fae 100644 --- a/src/qml/UIComponents/SettingsButton.qml +++ b/src/qml/UIComponents/SettingsButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/UIComponents/SpeedText.qml b/src/qml/UIComponents/SpeedText.qml index b1e4bcd..782fa8e 100644 --- a/src/qml/UIComponents/SpeedText.qml +++ b/src/qml/UIComponents/SpeedText.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -9,8 +9,6 @@ import player 1.0 Text { id: speedText - leftPadding: 0 - rightPadding: 0 text: "1x" font.family: appearance.fontName font.pixelSize: layout.height / 2.5 @@ -22,7 +20,6 @@ Text { verticalAlignment: Text.AlignVCenter Connections { target: player - enabled: true onSpeedChanged: function (speed) { speedText.text = String(speed) + "x" } diff --git a/src/qml/UIComponents/TimeLabel.qml b/src/qml/UIComponents/TimeLabel.qml index 4aad007..8dd4ebc 100644 --- a/src/qml/UIComponents/TimeLabel.qml +++ b/src/qml/UIComponents/TimeLabel.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -12,14 +12,12 @@ Text { objectName: "timeLabel" text: "0:00 / 0:00" color: "white" - padding: 2 font.family: appearance.fontName font.pixelSize: layout.height / 2.5 verticalAlignment: Text.AlignVCenter renderType: Text.NativeRendering Connections { target: player - enabled: true onDurationStringChanged: function (durationString) { timeLabel.text = durationString } diff --git a/src/qml/UIComponents/VerticalVolume.qml b/src/qml/UIComponents/VerticalVolume.qml index aaeb98f..8e53f54 100644 --- a/src/qml/UIComponents/VerticalVolume.qml +++ b/src/qml/UIComponents/VerticalVolume.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -31,7 +31,6 @@ Rectangle { Connections { target: player - enabled: true onVolumeChanged: function (volume) { volumeSlider.value = volume } diff --git a/src/qml/UIComponents/VideoProgress.qml b/src/qml/UIComponents/VideoProgress.qml index 833e8ea..81c30e8 100644 --- a/src/qml/UIComponents/VideoProgress.qml +++ b/src/qml/UIComponents/VideoProgress.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -15,7 +15,6 @@ Slider { value: 0.0 Connections { target: player - enabled: true onPositionChanged: function (position) { if (!pressed) { progressBar.value = position @@ -107,7 +106,6 @@ Slider { id: chapterMarkers Connections { target: player - enabled: true onChaptersChanged: function (chapters) { for (var i = 0, len = chapters.length; i < len; i++) { var component = Qt.createComponent("ChapterMarker.qml") diff --git a/src/qml/UIComponents/VolumeButton.qml b/src/qml/UIComponents/VolumeButton.qml index 5c68e1d..dfeff68 100644 --- a/src/qml/UIComponents/VolumeButton.qml +++ b/src/qml/UIComponents/VolumeButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -35,7 +35,6 @@ Button { Connections { target: player - enabled: true onVolumeStatusChanged: updateStatus } } diff --git a/src/qml/UIComponents/VolumeSlider.qml b/src/qml/UIComponents/VolumeSlider.qml index 9a86db9..4c086de 100644 --- a/src/qml/UIComponents/VolumeSlider.qml +++ b/src/qml/UIComponents/VolumeSlider.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -25,7 +25,6 @@ Slider { } Connections { target: player - enabled: true onVolumeChanged: function (volume) { volumeBar.value = volume } diff --git a/src/qml/Utils/Translator.qml b/src/qml/Utils/Translator.qml index b1dffb9..88c06c6 100644 --- a/src/qml/Utils/Translator.qml +++ b/src/qml/Utils/Translator.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import Qt.labs.settings 1.0 import "translations.js" as Translations diff --git a/src/qml/YouTubeButtonLayout.qml b/src/qml/YouTubeButtonLayout.qml index 5f71681..f1c69ed 100644 --- a/src/qml/YouTubeButtonLayout.qml +++ b/src/qml/YouTubeButtonLayout.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 diff --git a/src/qml/main.qml b/src/qml/main.qml index 56e79f3..ca24d55 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -1,4 +1,4 @@ -import QtQuick 2.11 +import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.11 @@ -415,7 +415,6 @@ Window { || (mainWindow.visibility == Window.FullScreen)) Connections { target: player - enabled: true onTitleChanged: function (title) { titleLabel.text = title } @@ -453,7 +452,6 @@ Window { id: hoverProgressLabel text: "0:00" color: "white" - padding: 2 z: 90 font.family: appearance.fontName font.pixelSize: mainWindow.virtualHeight / 50