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