mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-28 01:09:19 +00:00
feat(ui/views/App/Calls/IncallFullscreenWindow): supports preview and it can be moved
This commit is contained in:
parent
b5fd3d983e
commit
341a8f4874
4 changed files with 64 additions and 19 deletions
|
|
@ -149,9 +149,6 @@ void CameraRenderer::updateWindowId () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) {
|
||||
setAcceptHoverEvents(true);
|
||||
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
|
||||
|
||||
// The fbo content must be y-mirrored because the ms rendering is y-inverted.
|
||||
setMirrorVertically(true);
|
||||
|
||||
|
|
@ -171,10 +168,6 @@ QQuickFramebufferObject::Renderer *Camera::createRenderer () const {
|
|||
return new CameraRenderer();
|
||||
}
|
||||
|
||||
void Camera::mousePressEvent (QMouseEvent *) {
|
||||
setFocus(true);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
CallModel *Camera::getCall () const {
|
||||
|
|
|
|||
|
|
@ -82,9 +82,6 @@ signals:
|
|||
void callChanged (CallModel *call);
|
||||
void isPreviewChanged (bool isPreview);
|
||||
|
||||
protected:
|
||||
void mousePressEvent (QMouseEvent *event) override;
|
||||
|
||||
private:
|
||||
CallModel *getCall () const;
|
||||
void setCall (CallModel *call);
|
||||
|
|
|
|||
|
|
@ -51,18 +51,18 @@ Window {
|
|||
|
||||
Keys.onEscapePressed: incall.close()
|
||||
|
||||
Component {
|
||||
id: camera
|
||||
|
||||
Camera {
|
||||
call: incall.call
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: !incall.callsWindow.cameraActivated
|
||||
sourceComponent: camera
|
||||
|
||||
Component {
|
||||
id: camera
|
||||
|
||||
Camera {
|
||||
call: incall.call
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
|
@ -155,6 +155,8 @@ Window {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
visible: !incall.hideButtons
|
||||
|
||||
// Not a customizable style.
|
||||
color: 'white'
|
||||
style: Text.Raised
|
||||
|
|
@ -314,4 +316,57 @@ Window {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Preview.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Loader {
|
||||
active: !incall.callsWindow.cameraActivated
|
||||
sourceComponent: cameraPreview
|
||||
|
||||
Component {
|
||||
id: cameraPreview
|
||||
|
||||
MouseArea {
|
||||
property bool held: false
|
||||
|
||||
height: CallStyle.actionArea.userVideo.height
|
||||
width: CallStyle.actionArea.userVideo.width
|
||||
|
||||
x: incall.width / 2 - width / 2
|
||||
y: incall.height - height
|
||||
|
||||
drag {
|
||||
axis: Drag.XandYAxis
|
||||
target: camera
|
||||
}
|
||||
|
||||
onPressed: held = true
|
||||
onReleased: {
|
||||
held = false
|
||||
y += camera.y
|
||||
x += camera.x
|
||||
|
||||
camera.x = 0
|
||||
camera.y = 0
|
||||
}
|
||||
|
||||
Camera {
|
||||
id: camera
|
||||
|
||||
Drag.active: parent.held
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ QtObject {
|
|||
property int rightButtonsGroupMargin: 50
|
||||
|
||||
property QtObject userVideo: QtObject {
|
||||
property int height: 90
|
||||
property int height: 200
|
||||
property int width: 130
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue