1
0
Fork 0

Remove show preview.

This commit is contained in:
namedkitten 2020-04-16 19:16:57 +01:00
parent f6d960c257
commit b0ba856bb5
2 changed files with 4 additions and 54 deletions

View file

@ -77,20 +77,7 @@ Slider {
var a = (progressBar.to / progressBar.availableWidth) var a = (progressBar.to / progressBar.availableWidth)
* (mouseAreaProgressBar.mapToItem( * (mouseAreaProgressBar.mapToItem(
progressBar, mouseAreaProgressBar.mouseX, 0).x - 2) progressBar, mouseAreaProgressBar.mouseX, 0).x - 2)
var shouldSeek = false hoverProgressLabel.text = utils.createTimestamp(a)
if (!appearance.updatePreviewWhilstPlaying) {
if (!progressBar.playing) {
shouldSeek = true
}
} else {
shouldSeek = true
}
if (shouldSeek) {
progressBarTimePreview.playerCommand(
Enums.Commands.SeekAbsolute, a)
} else {
hoverProgressLabel.text = utils.createTimestamp(a)
}
previewRect.x = mouseAreaProgressBar.mapToItem( previewRect.x = mouseAreaProgressBar.mapToItem(
controlsOverlay, mouseAreaProgressBar.mouseX, controlsOverlay, mouseAreaProgressBar.mouseX,
0).x - previewRect.width / 2 0).x - previewRect.width / 2

View file

@ -46,7 +46,6 @@ Window {
category: "Logging" category: "Logging"
property string logFile: "/tmp/KittehPlayer.log" property string logFile: "/tmp/KittehPlayer.log"
property bool logBackend: true property bool logBackend: true
property bool logPreview: false
} }
Settings { Settings {
@ -60,7 +59,6 @@ Window {
id: appearance id: appearance
category: "Appearance" category: "Appearance"
property bool titleOnlyOnFullscreen: true property bool titleOnlyOnFullscreen: true
property bool updatePreviewWhilstPlaying: true
property bool clickToPause: true property bool clickToPause: true
property bool useMpvSubs: false property bool useMpvSubs: false
property string themeName: "YouTube" property string themeName: "YouTube"
@ -205,18 +203,6 @@ Window {
z: 1 z: 1
logging: loggingSettings.logBackend logging: loggingSettings.logBackend
onPlaylistChanged: function (playlist) {
for (var thing in playlist) {
var item = playlist[thing]
if (playlist[thing]["current"]) {
progressBarTimePreview.playerCommand(
Enums.Commands.LoadFile,
String(playlist[thing]["filename"]))
}
progressBarTimePreview.playerCommand(Enums.Commands.ForcePause)
}
}
Action { Action {
onTriggered: { onTriggered: {
appearance.scaleFactor += 0.1 appearance.scaleFactor += 0.1
@ -470,13 +456,13 @@ Window {
id: controlsBar id: controlsBar
Item { Item {
id: previewRect id: previewRect
height: 144
width: 256
z: 80 z: 80
visible: false visible: false
width: hoverProgressLabel.width
Rectangle { Rectangle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
width: hoverProgressLabel.width width: hoverProgressLabel.width
height: hoverProgressLabel.height height: hoverProgressLabel.height
@ -489,33 +475,10 @@ Window {
color: "white" color: "white"
font.family: appearance.fontName font.family: appearance.fontName
font.pixelSize: mainWindow.virtualHeight / 50 font.pixelSize: mainWindow.virtualHeight / 50
verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
} }
PlayerBackend {
z: 90
id: progressBarTimePreview
height: parent.height
width: parent.width
logging: loggingSettings.logPreview
onDurationStringChanged: function (durationString) {
hoverProgressLabel.text = durationString
}
function startPlayer() {
update()
progressBarTimePreview.playerCommand(
Enums.Commands.SetTrack, ["aid", "no"])
progressBarTimePreview.playerCommand(
Enums.Commands.SetTrack, ["sid", "no"])
progressBarTimePreview.setOption(
"ytdl-format",
"worstvideo[height<=?" + String(
height) + "]/worst")
}
}
} }
} }
} }