Skip to content
Snippets Groups Projects
Commit c2d91aab authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Hugo Beauzée-Luyssen
Browse files

qml: limit Player image source size

parent dd732081
No related branches found
No related tags found
1 merge request!1869qml: content image adjustments
Pipeline #220453 passed with stage
in 20 minutes and 6 seconds
......@@ -423,27 +423,37 @@ FocusScope {
visible: !rootPlayer.hasEmbededVideo
Item {
Layout.preferredHeight: rootPlayer.height / 2.7182
Layout.preferredWidth: height * cover.sar
Layout.preferredHeight: rootPlayer.height / heightConstant
Layout.preferredWidth: cover.paintedWidth
Layout.maximumHeight: centerContent.height
Layout.alignment: Qt.AlignHCenter
readonly property real heightConstant: 2.7182
Image {
id: cover
//source aspect ratio
readonly property real sar: cover.sourceSize.width / cover.sourceSize.height
readonly property real sar: paintedWidth / paintedHeight
anchors.fill: parent
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
source: rootPlayer.coverSource
fillMode: Image.PreserveAspectFit
mipmap: height < sourceSize.height * .3
mipmap: true
cache: false
asynchronous: true
sourceSize: Qt.size(maximumWidth, maximumHeight)
readonly property real maximumWidth: MainCtx.screen ? (MainCtx.screen.availableVirtualSize.width * MainCtx.screen.devicePixelRatio)
: 1024
readonly property real maximumHeight: MainCtx.screen ? (MainCtx.screen.availableVirtualSize.height * MainCtx.screen.devicePixelRatio / parent.heightConstant)
: 1024
}
Widgets.CoverShadow {
anchors.fill: cover
anchors.fill: parent
source: cover
primaryVerticalOffset: VLCStyle.dp(24)
primaryRadius: VLCStyle.dp(54)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment