mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-04-21 21:52:03 +02:00
callview: hide mainview window on fullscreen
- hide / show mainview window on fullscreen switch in order to avoid undesirable UI transitions or incorrect layout (when working with multiple screens) - update and show only on top page of callStackView - back button always present on CallOverlay (use close button icon on fullscreen mode) Gitlab: #135 Change-Id: I0d7c6aac26ba9c899ee97ac58f41f2746dda2148
This commit is contained in:
parent
a0c461e2fa
commit
9d41a3bc6e
9 changed files with 91 additions and 70 deletions
|
@ -22,6 +22,8 @@ pragma Singleton
|
|||
import QtQuick 2.14
|
||||
|
||||
Item {
|
||||
property bool callIsFullscreen: false
|
||||
|
||||
TextMetrics {
|
||||
id: globalTextMetrics
|
||||
}
|
||||
|
|
|
@ -201,7 +201,6 @@ Window {
|
|||
callStackView.setLinkedWebview(communicationPageMessageWebView)
|
||||
callStackView.responsibleAccountId = AccountAdapter.currentAccountId
|
||||
callStackView.responsibleConvUid = currentUID
|
||||
callStackView.updateCorrespondingUI()
|
||||
|
||||
if (callState === Call.Status.IN_PROGRESS || callState === Call.Status.PAUSED) {
|
||||
UtilsAdapter.setCurrentCall(AccountAdapter.currentAccountId, currentUID)
|
||||
|
@ -210,12 +209,12 @@ Window {
|
|||
else
|
||||
callStackView.showVideoCallPage()
|
||||
} else if (callState === Call.Status.INCOMING_RINGING) {
|
||||
callStackView.showIncomingCallPage(AccountAdapter.currentAccountId,
|
||||
currentUID)
|
||||
callStackView.showIncomingCallPage()
|
||||
} else {
|
||||
callStackView.showOutgoingCallPage(callState)
|
||||
}
|
||||
pushCallStackView()
|
||||
|
||||
} else if (!inSettingsView) {
|
||||
if (currentConvUID !== currentUID) {
|
||||
callStackView.needToCloseInCallConversationAndPotentialWindow()
|
||||
|
@ -250,6 +249,20 @@ Window {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: JamiQmlUtils
|
||||
|
||||
function onCallIsFullscreenChanged() {
|
||||
if (JamiQmlUtils.callIsFullscreen) {
|
||||
UtilsAdapter.setSystemTrayIconVisible(false)
|
||||
mainViewWindow.hide()
|
||||
} else {
|
||||
UtilsAdapter.setSystemTrayIconVisible(true)
|
||||
mainViewWindow.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: mainViewStackLayout
|
||||
|
||||
|
|
|
@ -33,8 +33,6 @@ Rectangle {
|
|||
|
||||
property var linkedWebview: null
|
||||
|
||||
signal showFullScreenReqested
|
||||
|
||||
function updateUI(accountId, convUid) {
|
||||
contactImage.updateImage(convUid)
|
||||
bestName = UtilsAdapter.getBestName(accountId, convUid)
|
||||
|
|
|
@ -172,8 +172,9 @@ Rectangle {
|
|||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||
|
||||
|
||||
source: callStackView.isFullscreen ? "qrc:/images/icons/round-close-24px.svg" :
|
||||
"qrc:/images/icons/ic_arrow_back_24px.svg"
|
||||
source: JamiQmlUtils.callIsFullscreen ?
|
||||
"qrc:/images/icons/round-close-24px.svg" :
|
||||
"qrc:/images/icons/ic_arrow_back_24px.svg"
|
||||
|
||||
pressedColor: JamiTheme.invertedPressedButtonColor
|
||||
hoveredColor: JamiTheme.invertedHoveredButtonColor
|
||||
|
@ -183,10 +184,10 @@ Rectangle {
|
|||
|
||||
toolTipText: qsTr("Toggle to display side panel")
|
||||
|
||||
visible: mainViewWindow.sidePanelOnly
|
||||
visible: true
|
||||
|
||||
onClicked: {
|
||||
if (callStackView.isFullscreen) {
|
||||
if (JamiQmlUtils.callIsFullscreen) {
|
||||
callStackView.toggleFullScreen()
|
||||
} else {
|
||||
mainViewWindow.showWelcomeView()
|
||||
|
|
|
@ -29,8 +29,6 @@ import "../js/callfullscreenwindowcontainercreation.js" as CallFullScreenWindowC
|
|||
Rectangle {
|
||||
id: callStackViewWindow
|
||||
|
||||
property bool isFullscreen: false
|
||||
|
||||
enum StackNumber {
|
||||
IncomingPageStack,
|
||||
OutgoingPageStack,
|
||||
|
@ -53,33 +51,34 @@ Rectangle {
|
|||
property string responsibleAccountId: ""
|
||||
|
||||
function needToCloseInCallConversationAndPotentialWindow() {
|
||||
audioCallPage.closeInCallConversation()
|
||||
videoCallPage.closeInCallConversation()
|
||||
|
||||
// Close potential window, context menu releated windows.
|
||||
audioCallPage.closeContextMenuAndRelatedWindows()
|
||||
|
||||
CallFullScreenWindowContainerCreation.closeVideoCallFullScreenWindowContainer()
|
||||
videoCallPage.closeContextMenuAndRelatedWindows()
|
||||
if (callStackMainView.currentItem.stackNumber === CallStackView.AudioPageStack) {
|
||||
audioCallPage.closeInCallConversation()
|
||||
CallFullScreenWindowContainerCreation.closeVideoCallFullScreenWindowContainer()
|
||||
audioCallPage.closeContextMenuAndRelatedWindows()
|
||||
} else if (callStackMainView.currentItem.stackNumber === CallStackView.VideoPageStack) {
|
||||
videoCallPage.closeInCallConversation()
|
||||
CallFullScreenWindowContainerCreation.closeVideoCallFullScreenWindowContainer()
|
||||
videoCallPage.closeContextMenuAndRelatedWindows()
|
||||
}
|
||||
}
|
||||
|
||||
function setLinkedWebview(webViewId) {
|
||||
audioCallPage.setLinkedWebview(webViewId)
|
||||
videoCallPage.setLinkedWebview(webViewId)
|
||||
if (callStackMainView.currentItem.stackNumber === CallStackView.AudioPageStack) {
|
||||
audioCallPage.setLinkedWebview(webViewId)
|
||||
} else if (callStackMainView.currentItem.stackNumber === CallStackView.VideoPageStack) {
|
||||
videoCallPage.setLinkedWebview(webViewId)
|
||||
}
|
||||
}
|
||||
|
||||
function updateCorrespondingUI() {
|
||||
audioCallPage.updateUI(responsibleAccountId, responsibleConvUid)
|
||||
outgoingCallPage.updateUI(responsibleAccountId, responsibleConvUid)
|
||||
incomingCallPage.updateUI(responsibleAccountId, responsibleConvUid)
|
||||
videoCallPage.updateUI(responsibleAccountId, responsibleConvUid)
|
||||
function getItemFromStack(itemNumber) {
|
||||
return callStackMainView.find(function (item) {
|
||||
return item.stackNumber === itemNumber
|
||||
})
|
||||
}
|
||||
|
||||
function showAudioCallPage() {
|
||||
var itemToFind = callStackMainView.find(function (item) {
|
||||
return item.stackNumber === CallStackView.AudioPageStack
|
||||
})
|
||||
|
||||
var itemToFind = getItemFromStack(CallStackView.AudioPageStack)
|
||||
if (!itemToFind) {
|
||||
callStackMainView.push(audioCallPage, StackView.Immediate)
|
||||
} else {
|
||||
|
@ -89,37 +88,27 @@ Rectangle {
|
|||
}
|
||||
|
||||
function showOutgoingCallPage() {
|
||||
var itemToFind = callStackMainView.find(function (item) {
|
||||
return item.stackNumber === CallStackView.OutgoingPageStack
|
||||
})
|
||||
|
||||
var itemToFind = getItemFromStack(CallStackView.OutgoingPageStack)
|
||||
if (!itemToFind) {
|
||||
callStackMainView.push(outgoingCallPage, StackView.Immediate)
|
||||
} else {
|
||||
callStackMainView.pop(itemToFind, StackView.Immediate)
|
||||
}
|
||||
outgoingCallPage.updateUI(responsibleAccountId, responsibleConvUid)
|
||||
}
|
||||
|
||||
function showIncomingCallPage(accountId, convUid) {
|
||||
var itemToFind = callStackMainView.find(function (item) {
|
||||
return item.stackNumber === CallStackView.IncomingPageStack
|
||||
})
|
||||
|
||||
var itemToFind = getItemFromStack(CallStackView.IncomingPageStack)
|
||||
if (!itemToFind) {
|
||||
callStackMainView.push(incomingCallPage, StackView.Immediate)
|
||||
} else {
|
||||
callStackMainView.pop(itemToFind, StackView.Immediate)
|
||||
}
|
||||
responsibleAccountId = accountId
|
||||
responsibleConvUid = convUid
|
||||
incomingCallPage.updateUI(accountId, convUid)
|
||||
incomingCallPage.updateUI(responsibleAccountId, responsibleConvUid)
|
||||
}
|
||||
|
||||
function showVideoCallPage() {
|
||||
var itemToFind = callStackMainView.find(function (item) {
|
||||
return item.stackNumber === CallStackView.VideoPageStack
|
||||
})
|
||||
|
||||
var itemToFind = getItemFromStack(CallStackView.VideoPageStack)
|
||||
if (!itemToFind) {
|
||||
callStackMainView.push(videoCallPage, StackView.Immediate)
|
||||
} else {
|
||||
|
@ -132,8 +121,10 @@ Rectangle {
|
|||
}
|
||||
|
||||
function toggleFullScreen() {
|
||||
isFullscreen = !isFullscreen
|
||||
JamiQmlUtils.callIsFullscreen = !JamiQmlUtils.callIsFullscreen
|
||||
var callPage = callStackMainView.currentItem
|
||||
if (!callPage)
|
||||
return
|
||||
CallFullScreenWindowContainerCreation.createvideoCallFullScreenWindowContainerObject()
|
||||
|
||||
if (!CallFullScreenWindowContainerCreation.checkIfVisible()) {
|
||||
|
@ -144,9 +135,7 @@ Rectangle {
|
|||
CallFullScreenWindowContainerCreation.closeVideoCallFullScreenWindowContainer()
|
||||
}
|
||||
|
||||
if (callStackMainView.find(function (item) {
|
||||
return item.stackNumber === CallStackView.VideoPageStack
|
||||
})) {
|
||||
if (callPage.stackNumber === CallStackView.VideoPageStack) {
|
||||
videoCallPage.handleParticipantsInfo(CallAdapter.getConferencesInfos())
|
||||
}
|
||||
}
|
||||
|
@ -155,15 +144,18 @@ Rectangle {
|
|||
target: CallAdapter
|
||||
|
||||
function onCallStatusChanged(status, accountId, convUid) {
|
||||
if (responsibleConvUid === convUid && responsibleAccountId === accountId) {
|
||||
if (callStackMainView.currentItem.stackNumber === CallStackView.OutgoingPageStack
|
||||
&& responsibleConvUid === convUid && responsibleAccountId === accountId) {
|
||||
outgoingCallPage.callStatus = status
|
||||
}
|
||||
}
|
||||
|
||||
function onUpdateParticipantsInfos(infos, accountId, callId) {
|
||||
var responsibleCallId = UtilsAdapter.getCallId(responsibleAccountId, responsibleConvUid)
|
||||
if (responsibleCallId === callId) {
|
||||
videoCallPage.handleParticipantsInfo(infos)
|
||||
if (callStackMainView.currentItem.stackNumber === CallStackView.VideoPageStack) {
|
||||
var responsibleCallId = UtilsAdapter.getCallId(responsibleAccountId, responsibleConvUid)
|
||||
if (responsibleCallId === callId) {
|
||||
videoCallPage.handleParticipantsInfo(infos)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -172,6 +164,8 @@ Rectangle {
|
|||
id: audioCallPage
|
||||
|
||||
property int stackNumber: CallStackView.AudioPageStack
|
||||
|
||||
visible: callStackMainView.currentItem.stackNumber === stackNumber
|
||||
}
|
||||
|
||||
OutgoingCallPage {
|
||||
|
@ -179,6 +173,8 @@ Rectangle {
|
|||
|
||||
property int stackNumber: CallStackView.OutgoingPageStack
|
||||
|
||||
visible: callStackMainView.currentItem.stackNumber === stackNumber
|
||||
|
||||
onCallCancelButtonIsClicked: {
|
||||
CallAdapter.hangUpACall(responsibleAccountId, responsibleConvUid)
|
||||
}
|
||||
|
@ -189,6 +185,7 @@ Rectangle {
|
|||
|
||||
property int stackNumber: CallStackView.VideoPageStack
|
||||
|
||||
visible: callStackMainView.currentItem.stackNumber === stackNumber
|
||||
}
|
||||
|
||||
IncomingCallPage {
|
||||
|
@ -205,6 +202,8 @@ Rectangle {
|
|||
onCallCancelButtonIsClicked: {
|
||||
CallAdapter.hangUpACall(responsibleAccountId, responsibleConvUid)
|
||||
}
|
||||
|
||||
visible: callStackMainView.currentItem.stackNumber === stackNumber
|
||||
}
|
||||
|
||||
StackView {
|
||||
|
|
|
@ -73,24 +73,26 @@ Item {
|
|||
})
|
||||
|
||||
if (isAudioOnly && !isPaused)
|
||||
ContextMenuGenerator.addMenuItem(callStackView.isFullscreen ? JamiStrings.exitFullScreen :
|
||||
JamiStrings.fullScreen,
|
||||
callStackView.isFullscreen ?
|
||||
"qrc:/images/icons/close_fullscreen-24px.svg" :
|
||||
"qrc:/images/icons/open_in_full-24px.svg",
|
||||
function (){
|
||||
callStackView.toggleFullScreen()
|
||||
})
|
||||
ContextMenuGenerator.addMenuItem(
|
||||
JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen :
|
||||
JamiStrings.fullScreen,
|
||||
JamiQmlUtils.callIsFullscreen ?
|
||||
"qrc:/images/icons/close_fullscreen-24px.svg" :
|
||||
"qrc:/images/icons/open_in_full-24px.svg",
|
||||
function (){
|
||||
callStackView.toggleFullScreen()
|
||||
})
|
||||
|
||||
if (!isAudioOnly && !isPaused) {
|
||||
ContextMenuGenerator.addMenuItem(callStackView.isFullscreen ? JamiStrings.exitFullScreen :
|
||||
JamiStrings.fullScreen,
|
||||
callStackView.isFullscreen ?
|
||||
"qrc:/images/icons/close_fullscreen-24px.svg" :
|
||||
"qrc:/images/icons/open_in_full-24px.svg",
|
||||
function (){
|
||||
callStackView.toggleFullScreen()
|
||||
})
|
||||
ContextMenuGenerator.addMenuItem(
|
||||
JamiQmlUtils.callIsFullscreen ? JamiStrings.exitFullScreen :
|
||||
JamiStrings.fullScreen,
|
||||
JamiQmlUtils.callIsFullscreen ?
|
||||
"qrc:/images/icons/close_fullscreen-24px.svg" :
|
||||
"qrc:/images/icons/open_in_full-24px.svg",
|
||||
function (){
|
||||
callStackView.toggleFullScreen()
|
||||
})
|
||||
|
||||
ContextMenuGenerator.addMenuSeparator()
|
||||
|
||||
|
|
|
@ -40,8 +40,6 @@ Rectangle {
|
|||
|
||||
property var linkedWebview: null
|
||||
|
||||
signal showFullScreenReqested
|
||||
|
||||
function updateUI(accountId, convUid) {
|
||||
videoCallOverlay.handleParticipantsInfo(CallAdapter.getConferencesInfos())
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "utilsadapter.h"
|
||||
|
||||
#include "globalsystemtray.h"
|
||||
#include "lrcinstance.h"
|
||||
#include "utils.h"
|
||||
#include "version.h"
|
||||
|
@ -381,3 +382,9 @@ UtilsAdapter::humanFileSize(qint64 fileSize)
|
|||
{
|
||||
return Utils::humanFileSize(fileSize);
|
||||
}
|
||||
|
||||
void
|
||||
UtilsAdapter::setSystemTrayIconVisible(bool visible)
|
||||
{
|
||||
GlobalSystemTray::instance().setVisible(visible);
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
Q_INVOKABLE QString getExt(const QString& path);
|
||||
Q_INVOKABLE bool isImage(const QString& fileExt);
|
||||
Q_INVOKABLE QString humanFileSize(qint64 fileSize);
|
||||
Q_INVOKABLE void setSystemTrayIconVisible(bool visible);
|
||||
|
||||
private:
|
||||
QClipboard* clipboard_;
|
||||
|
|
Loading…
Add table
Reference in a new issue