diff --git a/resources/icons/hidemyself_black_24dp.svg b/resources/icons/hidemyself_black_24dp.svg new file mode 100644 index 0000000000000000000000000000000000000000..afec2d5858ddb45733d810b2496a82a2fdee6980 --- /dev/null +++ b/resources/icons/hidemyself_black_24dp.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 24.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve"> +<path d="M18.3,2H5.8C3.7,2,2,3.7,2,5.8v12.4C2,20.3,3.7,22,5.8,22h12.4c2.1,0,3.8-1.7,3.8-3.7V5.8C22,3.7,20.3,2,18.3,2z M3.5,5.7 + c0-1.2,1-2.2,2.3-2.2h5.5V11H3.5V5.7z M11.3,12.5L11.3,12.5L11.3,12.5L11.3,12.5z M3.5,12.5h6.7l-6.6,6.6c-0.1-0.3-0.2-0.6-0.2-0.9 + V12.5z M5.8,20.5c-0.4,0-0.8-0.1-1.1-0.3l6.6-6.6v6.9H5.8z M20.6,18.2c0,1.3-1,2.3-2.3,2.3h-5.5v-8h7.8V18.2z M20.6,11h-7.8V3.5h5.5 + c1.3,0,2.3,1,2.3,2.3V11z"/> +</svg> diff --git a/src/app/appsettingsmanager.h b/src/app/appsettingsmanager.h index 0f13b2a338ef84d2441617e7409699f026f0d2d7..93298523601db6d4e8edfc00dfcb61dc4e06e024 100644 --- a/src/app/appsettingsmanager.h +++ b/src/app/appsettingsmanager.h @@ -47,6 +47,7 @@ extern const QString defaultDownloadPath; X(EnableDarkTheme, false) \ X(BaseZoom, 1.0) \ X(ParticipantsSide, false) \ + X(HideSelf, false) \ X(AutoUpdate, true) \ X(StartMinimized, false) \ X(ShowChatviewHorizontally, true) \ diff --git a/src/app/callparticipantsmodel.h b/src/app/callparticipantsmodel.h index b02d4cbc8a4b447e2c636db58c741c4fcd7aaacd..e1cc7cc0ce7adc97fe37443c6ffdb753c51afb0c 100644 --- a/src/app/callparticipantsmodel.h +++ b/src/app/callparticipantsmodel.h @@ -75,6 +75,7 @@ struct Item class GenericParticipantsFilterModel final : public QSortFilterProxyModel { Q_OBJECT + QML_PROPERTY(bool, hideSelf) public: explicit GenericParticipantsFilterModel(LRCInstance* lrcInstance, @@ -90,7 +91,15 @@ public: { // Accept all participants in participants list filtered with active status. auto index = sourceModel()->index(sourceRow, 0, sourceParent); - return !sourceModel()->data(index, CallParticipant::Role::Active).toBool(); + + bool acceptState = !sourceModel()->data(index, CallParticipant::Role::Active).toBool(); + if (acceptState && + hideSelf_ && + sourceModel()->rowCount() > 1 && + sourceModel()->data(index, CallParticipant::Role::IsLocal).toBool()) + acceptState = false; + + return acceptState; } Q_INVOKABLE void reset() diff --git a/src/app/constant/JamiStrings.qml b/src/app/constant/JamiStrings.qml index 8724cabbf85497ac3a4efb3decf4d90b604cee10..cfffa2478f9075025948f3cc6be08e295161e8e0 100644 --- a/src/app/constant/JamiStrings.qml +++ b/src/app/constant/JamiStrings.qml @@ -252,6 +252,7 @@ Item { property string notMuted: qsTr("Not muted") property string participantsSide: qsTr("On the side") property string participantsTop: qsTr("On the top") + property string hideSelf: qsTr("Hide self") // LineEditContextMenu property string copy: qsTr("Copy") diff --git a/src/app/mainview/components/CallActionBar.qml b/src/app/mainview/components/CallActionBar.qml index e58221ad5a1e77cbdf187bc4cd6e68279214c678..f7d46453be33b649d943a7221b55be1e94539ec5 100644 --- a/src/app/mainview/components/CallActionBar.qml +++ b/src/app/mainview/components/CallActionBar.qml @@ -173,25 +173,35 @@ Control { var onTheSide = UtilsAdapter.getAppValue(Settings.ParticipantsSide) UtilsAdapter.setAppValue(Settings.ParticipantsSide, !onTheSide) participantsSide = !onTheSide + case JamiStrings.hideSelf: + UtilsAdapter.setAppValue(Settings.HideSelf, !layoutModel.get(index).ActiveSetting) + GenericParticipantsFilterModel.hideSelf = UtilsAdapter.getAppValue(Settings.HideSelf) + GenericParticipantsFilterModel.reset() break } } onTriggered: { layoutModel.clear() - layoutModel.append({"Name": JamiStrings.viewFullScreen, - "IconSource": JamiResources.open_in_full_24dp_svg, - "ActiveSetting": layoutManager.isCallFullscreen}) - if (isConference) { + if (!isGrid && isConference) { + layoutModel.append({"Name": JamiStrings.mosaic, + "IconSource": JamiResources.mosaic_black_24dp_svg, + "ActiveSetting": isGrid}) layoutModel.append({}) + } + if (isConference) { var onTheSide = UtilsAdapter.getAppValue(Settings.ParticipantsSide) layoutModel.append({"Name": onTheSide ? JamiStrings.participantsSide : JamiStrings.participantsTop, "IconSource": onTheSide ? JamiResources.ontheside_black_24dp_svg : JamiResources.onthetop_black_24dp_svg, "ActiveSetting": true}) layoutModel.append({}) - layoutModel.append({"Name": JamiStrings.mosaic, - "IconSource": JamiResources.mosaic_black_24dp_svg, - "ActiveSetting": isGrid}) + layoutModel.append({"Name": JamiStrings.hideSelf, + "IconSource": JamiResources.hidemyself_black_24dp_svg, + "ActiveSetting": UtilsAdapter.getAppValue(Settings.HideSelf)}) + layoutModel.append({}) } + layoutModel.append({"Name": JamiStrings.viewFullScreen, + "IconSource": JamiResources.open_in_full_24dp_svg, + "ActiveSetting": layoutManager.isCallFullscreen}) } }, Action { diff --git a/src/app/mainview/components/ParticipantsLayer.qml b/src/app/mainview/components/ParticipantsLayer.qml index ceac7cfc2e2adb63155122b8b190a9aa69f92323..87d22ae5839316221a7fb07fa676966b8ff52d61 100644 --- a/src/app/mainview/components/ParticipantsLayer.qml +++ b/src/app/mainview/components/ParticipantsLayer.qml @@ -35,6 +35,18 @@ Item { property bool inLine: CallParticipantsModel.conferenceLayout === CallParticipantsModel.ONE_WITH_SMALL property bool participantsSide + onVisibleChanged: { + GenericParticipantsFilterModel.hideSelf = UtilsAdapter.getAppValue(Settings.HideSelf) + } + + Connections { + target: GenericParticipantsFilterModel + + function onHideSelfChanged() { + GenericParticipantsFilterModel.reset() + } + } + Component { id: callVideoMedia diff --git a/src/app/mainview/components/ParticipantsLayoutHorizontal.qml b/src/app/mainview/components/ParticipantsLayoutHorizontal.qml index e0fc08a0ddfc643a3904ad0735f07ca8d7db73d0..10bc6874903a81dfbe3274a35b7f6ac2cb00cbc2 100644 --- a/src/app/mainview/components/ParticipantsLayoutHorizontal.qml +++ b/src/app/mainview/components/ParticipantsLayoutHorizontal.qml @@ -133,7 +133,8 @@ SplitView { SplitView.minimumWidth: parent.width / 6 SplitView.maximumWidth: inLine? parent.width / 2 : parent.width - visible: inLine || CallParticipantsModel.conferenceLayout === CallParticipantsModel.GRID + visible: commonParticipants.count > 0 && + (inLine || CallParticipantsModel.conferenceLayout === CallParticipantsModel.GRID) color: "transparent" property int lowLimit: 0 diff --git a/src/app/mainview/components/ParticipantsLayoutVertical.qml b/src/app/mainview/components/ParticipantsLayoutVertical.qml index 6989a879b71fe52f681923c3dc8c7110b0d5281f..307a167c7d7b51ed953d87be40a494bb7281c74d 100644 --- a/src/app/mainview/components/ParticipantsLayoutVertical.qml +++ b/src/app/mainview/components/ParticipantsLayoutVertical.qml @@ -82,7 +82,8 @@ SplitView { SplitView.minimumHeight: parent.height / 6 SplitView.maximumHeight: inLine? parent.height / 2 : parent.height - visible: inLine || CallParticipantsModel.conferenceLayout === CallParticipantsModel.GRID + visible: commonParticipants.count > 0 && + (inLine || CallParticipantsModel.conferenceLayout === CallParticipantsModel.GRID) color: "transparent" property int lowLimit: 0