1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-30 11:43:36 +02:00

fix: in-call chat view opening and closing

- fixes the in-call chat view requiring reselection to open
- fixes the in-call chat view staying open, on top of the principal
  chat view when a call ends

Gitlab: #415
Gitlab: #416
Change-Id: Idcfaaf263d5d53451dedf955ce441f0a705309a9
This commit is contained in:
Andreas Traczyk 2021-05-18 12:46:54 -04:00
parent 2bca28b7f3
commit c8008c5414
5 changed files with 53 additions and 53 deletions

View file

@ -51,14 +51,22 @@ Rectangle {
closeInCallConversation) closeInCallConversation)
} }
function closeInCallConversation() { function openInCallConversation() {
if (inAudioCallMessageWebViewStack.visible) { if (linkedWebview) {
linkedWebview.resetMessagingHeaderBackButtonSource( linkedWebview.resetMessagingHeaderBackButtonSource(false)
true) linkedWebview.setMessagingHeaderButtonsVisible(false)
linkedWebview.setMessagingHeaderButtonsVisible(true)
inAudioCallMessageWebViewStack.visible = false
inAudioCallMessageWebViewStack.clear()
} }
inAudioCallMessageWebViewStack.visible = true
inAudioCallMessageWebViewStack.push(linkedWebview)
}
function closeInCallConversation() {
if (linkedWebview) {
linkedWebview.resetMessagingHeaderBackButtonSource(true)
linkedWebview.setMessagingHeaderButtonsVisible(true)
}
inAudioCallMessageWebViewStack.visible = false
inAudioCallMessageWebViewStack.clear()
} }
function closeContextMenuAndRelatedWindows() { function closeContextMenuAndRelatedWindows() {
@ -136,22 +144,9 @@ Rectangle {
} }
onOverlayChatButtonClicked: { onOverlayChatButtonClicked: {
if (inAudioCallMessageWebViewStack.visible) { inAudioCallMessageWebViewStack.visible ?
linkedWebview.resetMessagingHeaderBackButtonSource( closeInCallConversation() :
true) openInCallConversation()
linkedWebview.setMessagingHeaderButtonsVisible(
true)
inAudioCallMessageWebViewStack.visible = false
inAudioCallMessageWebViewStack.clear()
} else {
linkedWebview.resetMessagingHeaderBackButtonSource(
false)
linkedWebview.setMessagingHeaderButtonsVisible(
false)
inAudioCallMessageWebViewStack.visible = true
inAudioCallMessageWebViewStack.push(
linkedWebview)
}
} }
} }

View file

@ -44,6 +44,8 @@ Rectangle {
signal overlayChatButtonClicked signal overlayChatButtonClicked
onVisibleChanged: if (!visible) callViewContextMenu.close()
function setRecording(localIsRecording) { function setRecording(localIsRecording) {
callViewContextMenu.localIsRecording = localIsRecording callViewContextMenu.localIsRecording = localIsRecording
recordingRect.visible = localIsRecording recordingRect.visible = localIsRecording

View file

@ -50,25 +50,25 @@ Rectangle {
property string responsibleConvUid: "" property string responsibleConvUid: ""
property string responsibleAccountId: "" property string responsibleAccountId: ""
// TODO: this should all be done by listening to
// parent visibility change or parent `Component.onDestruction`
function needToCloseInCallConversationAndPotentialWindow() { function needToCloseInCallConversationAndPotentialWindow() {
// Close potential window, context menu releated windows. // Close potential window, context menu releated windows.
if (!callStackMainView.currentItem) if (audioCallPage) {
return
if (callStackMainView.currentItem.stackNumber === CallStackView.AudioPageStack) {
audioCallPage.closeInCallConversation() audioCallPage.closeInCallConversation()
audioCallPage.closeContextMenuAndRelatedWindows() audioCallPage.closeContextMenuAndRelatedWindows()
} else if (callStackMainView.currentItem.stackNumber === CallStackView.VideoPageStack) { }
if (videoCallPage) {
videoCallPage.closeInCallConversation() videoCallPage.closeInCallConversation()
videoCallPage.closeContextMenuAndRelatedWindows() videoCallPage.closeContextMenuAndRelatedWindows()
} }
} }
function setLinkedWebview(webViewId) { function setLinkedWebview(webViewId) {
if (callStackMainView.currentItem.stackNumber === CallStackView.AudioPageStack) { if (audioCallPage)
audioCallPage.setLinkedWebview(webViewId) audioCallPage.setLinkedWebview(webViewId)
} else if (callStackMainView.currentItem.stackNumber === CallStackView.VideoPageStack) { if (videoCallPage)
videoCallPage.setLinkedWebview(webViewId) videoCallPage.setLinkedWebview(webViewId)
}
} }
function getItemFromStack(itemNumber) { function getItemFromStack(itemNumber) {

View file

@ -44,6 +44,14 @@ Item {
signal pluginItemClicked signal pluginItemClicked
signal transferCallButtonClicked signal transferCallButtonClicked
function close() {
// leave this debug line is a reminder of a design failure
console.debug("call view context menu close")
const menu = ContextMenuGenerator.getMenu()
if (menu)
menu.close()
}
function openMenu(){ function openMenu(){
ContextMenuGenerator.initMenu() ContextMenuGenerator.initMenu()
if (isSIP){ if (isSIP){

View file

@ -63,14 +63,22 @@ Rectangle {
closeInCallConversation) closeInCallConversation)
} }
function closeInCallConversation() { function openInCallConversation() {
if (inVideoCallMessageWebViewStack.visible) { if (linkedWebview) {
linkedWebview.resetMessagingHeaderBackButtonSource( linkedWebview.resetMessagingHeaderBackButtonSource(false)
true) linkedWebview.setMessagingHeaderButtonsVisible(false)
linkedWebview.setMessagingHeaderButtonsVisible(true)
inVideoCallMessageWebViewStack.visible = false
inVideoCallMessageWebViewStack.clear()
} }
inVideoCallMessageWebViewStack.visible = true
inVideoCallMessageWebViewStack.push(linkedWebview)
}
function closeInCallConversation() {
if (linkedWebview) {
linkedWebview.resetMessagingHeaderBackButtonSource(true)
linkedWebview.setMessagingHeaderButtonsVisible(true)
}
inVideoCallMessageWebViewStack.visible = false
inVideoCallMessageWebViewStack.clear()
} }
function closeContextMenuAndRelatedWindows() { function closeContextMenuAndRelatedWindows() {
@ -200,22 +208,9 @@ Rectangle {
} }
onOverlayChatButtonClicked: { onOverlayChatButtonClicked: {
if (inVideoCallMessageWebViewStack.visible) { inVideoCallMessageWebViewStack.visible ?
linkedWebview.resetMessagingHeaderBackButtonSource( closeInCallConversation() :
true) openInCallConversation()
linkedWebview.setMessagingHeaderButtonsVisible(
true)
inVideoCallMessageWebViewStack.visible = false
inVideoCallMessageWebViewStack.clear()
} else {
linkedWebview.resetMessagingHeaderBackButtonSource(
false)
linkedWebview.setMessagingHeaderButtonsVisible(
false)
inVideoCallMessageWebViewStack.visible = true
inVideoCallMessageWebViewStack.push(
linkedWebview)
}
} }
} }