1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-02 22:05:45 +02:00
jami-client-qt/src/app/mainview/components/ParticipantControlLayout.qml
Aline Gondim Santos afb9211e7a conference: use CurrentCall.isModerator instead of meModerator
GitLab: #1079

Change-Id: I0ad09d2a8f47de17103500ebb7eb212bda96e37d
2023-05-25 15:52:42 -03:00

111 lines
4.1 KiB
QML

/*
* Copyright (C) 2020-2023 Savoir-faire Linux Inc.
* Author: Albert Babí <albert.babi@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick.Layouts
import net.jami.Adapters 1.1
import net.jami.Constants 1.1
import "../../commoncomponents"
RowLayout {
id: root
property int visibleButtons: toggleModerator.visible + toggleMute.visible + maximizeParticipant.visible + minimizeParticipant.visible + hangupParticipant.visible
spacing: 8
ParticipantOverlayButton {
id: toggleModerator
visible: showSetModerator || showUnsetModerator
preferredSize: iconButtonPreferredSize
Layout.preferredHeight: buttonPreferredSize
Layout.preferredWidth: buttonPreferredSize
Layout.alignment: Qt.AlignVCenter
source: JamiResources.moderator_svg
onClicked: CallAdapter.setModerator(uri, showSetModerator)
toolTipText: showSetModerator ? JamiStrings.setModerator : JamiStrings.unsetModerator
}
ParticipantOverlayButton {
id: toggleMute
visible: showModeratorMute || showModeratorUnmute
preferredSize: iconButtonPreferredSize
Layout.preferredHeight: buttonPreferredSize
Layout.preferredWidth: buttonPreferredSize
Layout.alignment: Qt.AlignVCenter
source: showModeratorMute ? JamiResources.micro_black_24dp_svg : JamiResources.micro_off_black_24dp_svg
checkable: CurrentCall.isModerator
onClicked: {
if (participantIsModeratorMuted && isLocalMuted) {
if (isMe)
muteAlertMessage = JamiStrings.mutedLocally;
else
muteAlertMessage = JamiStrings.participantMicIsStillMuted;
muteAlertActive = true;
}
CallAdapter.muteParticipant(uri, deviceId, sinkId, showModeratorMute);
}
toolTipText: {
if (!checkable && participantIsModeratorMuted)
return JamiStrings.mutedByModerator;
if (showModeratorMute)
return JamiStrings.muteParticipant;
else
return JamiStrings.unmuteParticipant;
}
}
ParticipantOverlayButton {
id: maximizeParticipant
visible: showMaximize
preferredSize: iconButtonPreferredSize
Layout.preferredHeight: buttonPreferredSize
Layout.preferredWidth: buttonPreferredSize
Layout.alignment: Qt.AlignVCenter
source: JamiResources.open_in_full_24dp_svg
onClicked: CallAdapter.setActiveStream(uri, deviceId, sinkId)
toolTipText: JamiStrings.maximizeParticipant
}
ParticipantOverlayButton {
id: minimizeParticipant
visible: showMinimize
preferredSize: iconButtonPreferredSize
Layout.preferredHeight: buttonPreferredSize
Layout.preferredWidth: buttonPreferredSize
Layout.alignment: Qt.AlignVCenter
source: JamiResources.close_fullscreen_24dp_svg
onClicked: CallAdapter.minimizeParticipant(uri)
toolTipText: JamiStrings.minimizeParticipant
}
ParticipantOverlayButton {
id: hangupParticipant
visible: showHangup
preferredSize: iconButtonPreferredSize
Layout.preferredHeight: buttonPreferredSize
Layout.preferredWidth: buttonPreferredSize
Layout.alignment: Qt.AlignVCenter
source: JamiResources.ic_hangup_participant_24dp_svg
onClicked: CallAdapter.hangupParticipant(uri, deviceId)
toolTipText: JamiStrings.hangupParticipant
}
}