summaryrefslogtreecommitdiffstats
path: root/examples/shadereffectitem/test-boxblur-4point.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/shadereffectitem/test-boxblur-4point.qml')
-rw-r--r--examples/shadereffectitem/test-boxblur-4point.qml43
1 files changed, 40 insertions, 3 deletions
diff --git a/examples/shadereffectitem/test-boxblur-4point.qml b/examples/shadereffectitem/test-boxblur-4point.qml
index c1b727b..59d9e51 100644
--- a/examples/shadereffectitem/test-boxblur-4point.qml
+++ b/examples/shadereffectitem/test-boxblur-4point.qml
@@ -48,14 +48,51 @@ Item {
height: 540
Box4PointBlur {
- source: box
+ source: ShaderEffectSource {
+ sourceItem: box
+ filtering: ShaderEffectSource.Linear
+ }
anchors.fill: box
- xOffset: 0.5 / width;
- yOffset: 0.5 / height;
+ xOffset: knob.progress / width;
+ yOffset: knob.progress / height;
+ smooth: true
}
MovingBox {
id: box
}
+ Rectangle {
+ id: slider
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: 32
+ color: "black"
+ opacity: 0.5
+ }
+
+ Item {
+ id: knob
+ x: 0.5 * (slider.width - knob.width)
+ anchors.top: slider.top
+ anchors.bottom: slider.bottom
+ width: height * 1.5
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: 2
+ radius: height / 2
+ color: "white"
+ border.width: 2
+ border.color: "black"
+ }
+ property real progress: x / (slider.width - knob.width)
+ MouseArea {
+ anchors.fill: parent
+ drag.target: parent
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: slider.width - knob.width
+ }
+ }
}