Show border around media popup

This commit is contained in:
Christian Muehlhaeuser 2020-02-28 12:42:37 +01:00
parent 2e6b539d9e
commit 6d290a0abe
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -17,11 +17,19 @@ Popup {
Item {
id: mediaItem
anchors.centerIn: parent
width: image.visible ?
image.width :
video.width
height: image.visible ?
image.height :
video.height
Image {
id: image
height: Math.min(sourceSize.height, mainWindow.height * 0.8)
width: Math.min(sourceSize.width, mainWindow.width * 0.8)
height: Math.min(sourceSize.height, mainWindow.height * 0.8)
anchors.centerIn: parent
smooth: true
fillMode: Image.PreserveAspectFit
@ -31,8 +39,6 @@ Popup {
Video {
id: video
// height: Math.min(sourceSize.height, mainWindow.height * 0.8)
// width: Math.min(sourceSize.width, mainWindow.width * 0.8)
width: metaData.resolution ? Math.min(metaData.resolution.width, mainWindow.width * 0.8) : 0
height: metaData.resolution ? Math.min(metaData.resolution.height, mainWindow.height * 0.8) : 0
autoLoad: true
@ -44,7 +50,7 @@ Popup {
visible: url.endsWith(".webm") || url.endsWith(".mp4")
onStatusChanged: {
if(status == MediaPlayer.Loaded)
if (status == MediaPlayer.Loaded)
video.play()
}