Commit fc9fcc19 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Calls/IncallFullscreenWindow): preview supports zoom

parent bf731086
......@@ -329,6 +329,8 @@ Window {
id: cameraPreview
Camera {
property bool scale: false
Drag.active: cameraDrag.held
Drag.source: cameraDrag
Drag.hotSpot.x: width / 2
......@@ -337,11 +339,22 @@ Window {
call: incall.call
isPreview: true
height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width
height: CallStyle.actionArea.userVideo.height * (scale ? 2 : 1)
width: CallStyle.actionArea.userVideo.width * (scale ? 2 : 1)
x: incall.width / 2 - width / 2
y: incall.height - height
Component.onCompleted: {
x = incall.width / 2 - width / 2
y = incall.height - height
}
// Workaround.
// x and y are not binded to functions because if the scale is updated,
// the position of the preview is reset.
Connections {
target: incall
onHeightChanged: y = incall.height - parent.height
onWidthChanged: x = incall.width / 2 - parent.width / 2
}
MouseArea {
id: cameraDrag
......@@ -371,6 +384,8 @@ Window {
parent.y = incall.height - parent.height
}
}
onWheel: parent.scale = wheel.angleDelta.y > 0
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment