1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-03 22:35:45 +02:00

callbuttons: hide self

GitLab: #729

Change-Id: I59ec525d181ec1d6655a0e9889728bd6b9128721
This commit is contained in:
Aline Gondim Santos 2022-08-04 10:49:39 -03:00
parent 824ba581c8
commit f8cfb86f6a
8 changed files with 54 additions and 10 deletions

View file

@ -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>

After

Width:  |  Height:  |  Size: 765 B

View file

@ -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) \

View file

@ -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()

View file

@ -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")

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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