Commit bf731086 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Calls/IncallFullscreenWindow): better preview move

parent 341a8f48
...@@ -328,8 +328,14 @@ Window { ...@@ -328,8 +328,14 @@ Window {
Component { Component {
id: cameraPreview id: cameraPreview
MouseArea { Camera {
property bool held: false Drag.active: cameraDrag.held
Drag.source: cameraDrag
Drag.hotSpot.x: width / 2
Drag.hotSpot.y: height / 2
call: incall.call
isPreview: true
height: CallStyle.actionArea.userVideo.height height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width width: CallStyle.actionArea.userVideo.width
...@@ -337,34 +343,34 @@ Window { ...@@ -337,34 +343,34 @@ Window {
x: incall.width / 2 - width / 2 x: incall.width / 2 - width / 2
y: incall.height - height y: incall.height - height
MouseArea {
id: cameraDrag
property bool held: false
anchors.fill: parent
drag { drag {
axis: Drag.XandYAxis axis: Drag.XandYAxis
target: camera target: parent
} }
onPressed: held = true onPressed: held = true
onReleased: { onReleased: {
held = false held = false
y += camera.y
x += camera.x
camera.x = 0 if (parent.x < 0) {
camera.y = 0 parent.x = 0
} else if (parent.x + parent.width >= incall.width) {
parent.x = incall.width - parent.width
} }
Camera { if (parent.y < 0) {
id: camera parent.y = 0
} else if (parent.y + parent.height >= incall.height) {
Drag.active: parent.held parent.y = incall.height - parent.height
Drag.source: parent }
Drag.hotSpot.x: width / 2 }
Drag.hotSpot.y: height / 2
call: incall.call
isPreview: true
height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width
} }
} }
} }
......
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