Reorder QML files to follow coding conventions
https://doc.qt.io/qt-5/qml-codingconventions.html#qml-object-declarations
This commit is contained in:
@@ -5,16 +5,16 @@ import QtAV 1.7
|
||||
|
||||
OSD {
|
||||
id: osd
|
||||
|
||||
property alias source: audioPlayer.source
|
||||
|
||||
|
||||
audioOnly: true
|
||||
media: audioPlayer
|
||||
|
||||
implicitWidth: osd.width
|
||||
implicitHeight: osd.height
|
||||
|
||||
|
||||
property alias source: audioPlayer.source
|
||||
|
||||
|
||||
MediaPlayer {
|
||||
id: audioPlayer
|
||||
autoLoad: window.settings.media.autoLoad
|
||||
|
@@ -7,20 +7,6 @@ import "../../Base"
|
||||
|
||||
HColumnLayout {
|
||||
id: osd
|
||||
visible: osdScaleTransform.yScale > 0
|
||||
|
||||
transform: Scale {
|
||||
id: osdScaleTransform
|
||||
yScale: audioOnly ||
|
||||
osdHover.hovered ||
|
||||
media.playbackState !== MediaPlayer.PlayingState ||
|
||||
osd.showup ?
|
||||
1 : 0
|
||||
origin.y: osd.height
|
||||
|
||||
Behavior on yScale { HNumberAnimation {} }
|
||||
}
|
||||
|
||||
|
||||
property QtObject media: parent // QtAV.Video or QtAV.MediaPlayer
|
||||
property bool audioOnly: false
|
||||
@@ -35,12 +21,6 @@ HColumnLayout {
|
||||
savedDuration ?
|
||||
Math.min(media.position, savedDuration) : media.position
|
||||
|
||||
|
||||
onShowupChanged: if (showup) osdHideTimer.restart()
|
||||
onDurationChanged: if (duration) savedDuration = duration
|
||||
onAspectRatioChanged: if (aspectRatio) savedAspectRatio = aspectRatio
|
||||
|
||||
|
||||
function togglePlay() {
|
||||
media.playbackState === MediaPlayer.PlayingState ?
|
||||
media.pause() : media.play()
|
||||
@@ -52,6 +32,24 @@ HColumnLayout {
|
||||
}
|
||||
|
||||
|
||||
visible: osdScaleTransform.yScale > 0
|
||||
|
||||
transform: Scale {
|
||||
id: osdScaleTransform
|
||||
yScale: audioOnly ||
|
||||
osdHover.hovered ||
|
||||
media.playbackState !== MediaPlayer.PlayingState ||
|
||||
osd.showup ?
|
||||
1 : 0
|
||||
origin.y: osd.height
|
||||
|
||||
Behavior on yScale { HNumberAnimation {} }
|
||||
}
|
||||
|
||||
onShowupChanged: if (showup) osdHideTimer.restart()
|
||||
onDurationChanged: if (duration) savedDuration = duration
|
||||
onAspectRatioChanged: if (aspectRatio) savedAspectRatio = aspectRatio
|
||||
|
||||
HoverHandler { id: osdHover }
|
||||
|
||||
Timer {
|
||||
@@ -77,6 +75,13 @@ HColumnLayout {
|
||||
|
||||
HToolTip {
|
||||
id: previewToolTip
|
||||
|
||||
readonly property int wantTimestamp:
|
||||
visible ?
|
||||
savedDuration *
|
||||
(timeSlider.mouseArea.mouseX / timeSlider.mouseArea.width) :
|
||||
-1
|
||||
|
||||
x: timeSlider.mouseArea.mouseX - width / 2
|
||||
visible: ! audioOnly &&
|
||||
|
||||
@@ -88,20 +93,6 @@ HColumnLayout {
|
||||
|
||||
! timeSlider.pressed && timeSlider.mouseArea.containsMouse
|
||||
|
||||
readonly property int wantTimestamp:
|
||||
visible ?
|
||||
savedDuration *
|
||||
(timeSlider.mouseArea.mouseX / timeSlider.mouseArea.width) :
|
||||
-1
|
||||
|
||||
Timer {
|
||||
interval: 300
|
||||
running: previewToolTip.visible
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: preview.timestamp = previewToolTip.wantTimestamp
|
||||
}
|
||||
|
||||
contentItem: VideoPreview {
|
||||
id: preview
|
||||
implicitHeight: Math.min(
|
||||
@@ -129,11 +120,19 @@ HColumnLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binding on value {
|
||||
value: boundPosition
|
||||
when: ! timeSlider.pressed
|
||||
Binding on value {
|
||||
value: boundPosition
|
||||
when: ! timeSlider.pressed
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 300
|
||||
running: previewToolTip.visible
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: preview.timestamp = previewToolTip.wantTimestamp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,6 @@
|
||||
import QtQuick 2.12
|
||||
import "../../Base"
|
||||
|
||||
|
||||
HButton {
|
||||
backgroundColor: "transparent"
|
||||
iconItem.dimension: theme.mediaPlayer.controls.iconSize
|
||||
|
@@ -4,7 +4,6 @@ import QtQuick 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import "../../Base"
|
||||
|
||||
|
||||
HLabel {
|
||||
Layout.leftMargin: theme.spacing / 2
|
||||
Layout.rightMargin: Layout.leftMargin
|
||||
|
Reference in New Issue
Block a user