diff --git a/discover/qml/ApplicationScreenshots.qml b/discover/qml/ApplicationScreenshots.qml --- a/discover/qml/ApplicationScreenshots.qml +++ b/discover/qml/ApplicationScreenshots.qml @@ -137,26 +137,25 @@ fillMode: Image.PreserveAspectFit smooth: true } - } layer.enabled: true // This item should be used as the 'mask' layer.effect: ShaderEffect { - property var colorSource: root; - property bool atLeft: root.atXBeginning; - property bool atRight: root.atXEnd; + readonly property var colorSource: root; + readonly property real distLeft: Math.max(8, 200/(root.contentX + 1)) + readonly property real distRight: Math.max(8, 200/(Math.max(0, root.contentWidth - (root.contentX + root.width)) + 1)) fragmentShader: " - uniform lowp bool atLeft; - uniform lowp bool atRight; + uniform lowp float distLeft; + uniform lowp float distRight; uniform lowp sampler2D colorSource; uniform lowp float qt_Opacity; varying highp vec2 qt_TexCoord0; void main() { gl_FragColor = texture2D(colorSource, qt_TexCoord0) - * (atRight ? 1. : min(1.0, qt_TexCoord0.x * -20.0 + 20.)) - * (atLeft ? 1. : min(1.0, qt_TexCoord0.x * 20.0)) + * min(1.0, max(0., qt_TexCoord0.x * -distRight + distRight)) + * min(1.0, max(0., qt_TexCoord0.x * distLeft)) * qt_Opacity; } "