mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-14 11:45:40 +02:00
ongoingcallpage: resize + change opacity of local preview
This is an experimental feature and is unadvertised for now. Change-Id: I40aa84f54c135c2060552231d4ed7c2de4976ca3
This commit is contained in:
parent
1ef9a85148
commit
a13c6ae0e7
1 changed files with 39 additions and 4 deletions
|
@ -176,7 +176,12 @@ Rectangle {
|
||||||
visibilityCondition: (CurrentCall.isSharing || !CurrentCall.isVideoMuted) &&
|
visibilityCondition: (CurrentCall.isSharing || !CurrentCall.isVideoMuted) &&
|
||||||
!CurrentCall.isConference
|
!CurrentCall.isConference
|
||||||
height: width * invAspectRatio
|
height: width * invAspectRatio
|
||||||
width: Math.max(container.width / 5, JamiTheme.minimumPreviewWidth)
|
|
||||||
|
// 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
|
||||||
flip: CurrentCall.flipSelf && !CurrentCall.isSharing
|
flip: CurrentCall.flipSelf && !CurrentCall.isSharing
|
||||||
blurRadius: hidden ? 25 : 0
|
blurRadius: hidden ? 25 : 0
|
||||||
onCallPreviewIdChanged: startWithId(callPreviewId)
|
onCallPreviewIdChanged: startWithId(callPreviewId)
|
||||||
|
@ -206,10 +211,23 @@ Rectangle {
|
||||||
objectName: "hidePreviewButton"
|
objectName: "hidePreviewButton"
|
||||||
|
|
||||||
width: localPreview.hiddenHandleSize
|
width: localPreview.hiddenHandleSize
|
||||||
state: localPreview.onLeft ?
|
state: {
|
||||||
(localPreview.hidden ? "right" : "left") :
|
if (!localPreview.anchored) {
|
||||||
(localPreview.hidden ? "left" : "right")
|
return "none";
|
||||||
|
}
|
||||||
|
return localPreview.onLeft ?
|
||||||
|
(localPreview.hidden ? "right" : "left") :
|
||||||
|
(localPreview.hidden ? "left" : "right")
|
||||||
|
}
|
||||||
states: [
|
states: [
|
||||||
|
State {
|
||||||
|
name: "none"
|
||||||
|
// Override visible to false when the localPreview isn't anchored.
|
||||||
|
PropertyChanges {
|
||||||
|
target: hidePreviewButton
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
State {
|
State {
|
||||||
name: "left"
|
name: "left"
|
||||||
AnchorChanges {
|
AnchorChanges {
|
||||||
|
@ -304,6 +322,23 @@ Rectangle {
|
||||||
id: hoverHandler
|
id: hoverHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WheelHandler {
|
||||||
|
onWheel: function(event) {
|
||||||
|
const delta = event.angleDelta.y / 120 * 0.1;
|
||||||
|
parent.opacity = JamiQmlUtils.clamp(parent.opacity + delta, 0.25, 1);
|
||||||
|
}
|
||||||
|
acceptedModifiers: Qt.CTRL
|
||||||
|
}
|
||||||
|
|
||||||
|
WheelHandler {
|
||||||
|
onWheel: function(event) {
|
||||||
|
const delta = event.angleDelta.y / 120 * 0.1;
|
||||||
|
localPreview.scalingFactor = JamiQmlUtils.clamp(localPreview.scalingFactor + delta, 0.5, 4);
|
||||||
|
}
|
||||||
|
acceptedModifiers: Qt.NoModifier
|
||||||
|
enabled: !localPreview.hidden
|
||||||
|
}
|
||||||
|
|
||||||
DragHandler {
|
DragHandler {
|
||||||
id: dragHandler
|
id: dragHandler
|
||||||
readonly property var container: localPreview.container
|
readonly property var container: localPreview.container
|
||||||
|
|
Loading…
Add table
Reference in a new issue