Skip to content
Snippets Groups Projects
Commit d057fa1b authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

call: show context menu when right clicking the call page

Gitlab: #80
Change-Id: Ic2c2563e05a11f33230518ee93ef4a1d9dd80d50
parent 7ea5a5de
No related merge requests found
......@@ -231,5 +231,15 @@ Rectangle {
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
audioCallOverlay.openCallViewContextMenuInPos(mouse.x, mouse.y)
}
}
color: "black"
}
......@@ -114,6 +114,14 @@ Rectangle {
}
}
// x, y position does not need to be translated
// since they all fill the call page
function openCallViewContextMenuInPos(x, y) {
callViewContextMenu.x = x
callViewContextMenu.y = y
callViewContextMenu.openMenu()
}
anchors.fill: parent
SipInputPanel {
......@@ -344,7 +352,6 @@ Rectangle {
}
}
// MouseAreas to make sure that overlay states are correctly set.
MouseArea {
id: callOverlayButtonGroupLeftSideMouseArea
......
......@@ -228,9 +228,10 @@ Rectangle {
onClicked: {
var rectPos = mapToItem(callStackViewWindow, optionsButton.x, optionsButton.y)
callViewContextMenu.openMenu()
callViewContextMenu.x = rectPos.x + optionsButton.width/2 - callViewContextMenu.width/2
callViewContextMenu.x = rectPos.x + optionsButton.width / 2
- callViewContextMenu.width / 2
callViewContextMenu.y = rectPos.y - 12 - callViewContextMenu.height
callViewContextMenu.openMenu()
}
}
......
......@@ -87,8 +87,6 @@ Rectangle {
}
function previewMagneticSnap() {
// Calculate the position where the previewRenderer should attach to.
var previewRendererCenter = Qt.point(
previewRenderer.x + previewRenderer.width / 2,
......@@ -99,8 +97,6 @@ Rectangle {
if (previewRendererCenter.x >= distantRendererCenter.x) {
if (previewRendererCenter.y >= distantRendererCenter.y) {
// Bottom right.
previewToX = Qt.binding(function () {
return videoCallPageMainRect.width - previewRenderer.width - previewMargin
......@@ -109,8 +105,6 @@ Rectangle {
return videoCallPageMainRect.height - previewRenderer.height - previewMarginY
})
} else {
// Top right.
previewToX = Qt.binding(function () {
return videoCallPageMainRect.width - previewRenderer.width - previewMargin
......@@ -119,16 +113,12 @@ Rectangle {
}
} else {
if (previewRendererCenter.y >= distantRendererCenter.y) {
// Bottom left.
previewToX = previewMargin
previewToY = Qt.binding(function () {
return videoCallPageMainRect.height - previewRenderer.height - previewMarginY
})
} else {
// Top left.
previewToX = previewMargin
previewToY = previewMarginY
......@@ -152,7 +142,6 @@ Rectangle {
color: SplitHandle.pressed ? JamiTheme.pressColor : (SplitHandle.hovered ? JamiTheme.hoverColor : JamiTheme.tabbarBorderColor)
}
Rectangle {
id: videoCallPageMainRect
SplitView.preferredHeight: (videoCallPageRect.height / 3) * 2
......@@ -236,7 +225,6 @@ Rectangle {
VideoCallPreviewRenderer {
id: previewRenderer
// Property is used in the {} expression for height (extra dependency),
// it will not affect the true height expression, since expression
// at last will be taken only, but it will force the height to update
......@@ -298,8 +286,6 @@ Rectangle {
}
onPositionChanged: {
// Calculate mouse position relative change.
var delta = Qt.point(mouse.x - clickPos.x,
mouse.y - clickPos.y)
......@@ -327,7 +313,6 @@ Rectangle {
color: "transparent"
}
StackView {
id: inVideoCallMessageWebViewStack
......@@ -340,6 +325,16 @@ Rectangle {
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
videoCallOverlay.openCallViewContextMenuInPos(mouse.x, mouse.y)
}
}
onBestNameChanged: {
ContactAdapter.setCalleeDisplayName(bestName)
}
......
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