Skip to content
Snippets Groups Projects
Commit 474bc5f6 authored by François-Simon Fauteux-Chapleau's avatar François-Simon Fauteux-Chapleau
Browse files

incalllocalvideo: allow resizing/changing opacity of local video

This feature was accidentally removed in a recent refactoring of the
local video preview:
https://review.jami.net/c/jami-client-qt/+/27740

Change-Id: I8b621d4f692124311f0807d1bc0be0e96717a499
parent f5b64e95
No related branches found
No related tags found
No related merge requests found
......@@ -43,8 +43,14 @@ LocalVideo {
visibilityCondition: (CurrentCall.isSharing || !CurrentCall.isVideoMuted) &&
!CurrentCall.isConference
// Keep the area of the preview a proportion of the screen size plus a
// modifier to allow the user to scale it.
readonly property real containerArea: container.width * container.height
property real scalingFactor: 1
width: Math.sqrt(containerArea / 16) * scalingFactor
height: width * invAspectRatio
width: Math.max(container.width / 5, JamiTheme.minimumPreviewWidth)
flip: CurrentCall.flipSelf && !CurrentCall.isSharing
blurRadius: hidden ? 25 : 0
......@@ -62,6 +68,20 @@ LocalVideo {
// Animate the hiddenSize with a Behavior.
Behavior on sideMargin { NumberAnimation { duration: 250; easing.type: Easing.OutExpo }}
readonly property bool onLeft: state.indexOf("left") !== -1
MouseArea {
anchors.fill: parent
enabled: !localPreview.hidden
onWheel: function(event) {
const delta = event.angleDelta.y / 120 * 0.1;
if (event.modifiers & Qt.ControlModifier) {
parent.opacity = JamiQmlUtils.clamp(parent.opacity + delta, 0.25, 1);
} else {
localPreview.scalingFactor = JamiQmlUtils.clamp(localPreview.scalingFactor + delta, 0.5, 4);
}
}
}
PushButton {
id: hidePreviewButton
objectName: "hidePreviewButton"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment