From ba2d41365e16e3575d97a555c5dcd2cdf1509202 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 17 Nov 2022 12:18:06 +0100 Subject: [PATCH] Hide participant view in ICS when there is none. --- .../src/components/conferenceInfo/ConferenceInfoModel.hpp | 1 + .../ui/modules/Linphone/Chat/ChatCalendarMessage.qml | 2 ++ .../Linphone/Chat/ChatConferenceInvitationMessage.qml | 7 ++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp index 2db672dbf..da7f01fc4 100644 --- a/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp +++ b/linphone-app/src/components/conferenceInfo/ConferenceInfoModel.hpp @@ -49,6 +49,7 @@ public: Q_PROPERTY(QString uri READ getUri NOTIFY uriChanged) Q_PROPERTY(bool isScheduled READ isScheduled WRITE setIsScheduled NOTIFY isScheduledChanged) Q_PROPERTY(int inviteMode READ getInviteMode WRITE setInviteMode NOTIFY inviteModeChanged) + Q_PROPERTY(int participantCount READ getParticipantCount NOTIFY participantsChanged) Q_PROPERTY(LinphoneEnums::ConferenceInfoState state READ getConferenceInfoState NOTIFY conferenceInfoStateChanged) Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState conferenceSchedulerState READ getConferenceSchedulerState NOTIFY conferenceSchedulerStateChanged) diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml b/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml index febc5c715..e7022c1f3 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatCalendarMessage.qml @@ -179,6 +179,8 @@ Loader{ Layout.preferredHeight: parent.participantLineHeight Layout.preferredWidth: ChatCalendarMessageStyle.participants.iconSize Layout.alignment: Qt.AlignTop + + visible: mainItem.conferenceInfoModel.participantCount > 0 clip: false Icon{ anchors.top: parent.top diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatConferenceInvitationMessage.qml b/linphone-app/ui/modules/Linphone/Chat/ChatConferenceInvitationMessage.qml index d0b487a3d..b17b651d1 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatConferenceInvitationMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatConferenceInvitationMessage.qml @@ -109,12 +109,14 @@ Loader{ } RowLayout { id: participantsRow + property int participantCount: mainItem.conferenceInfoModel.participantCount Layout.fillWidth: true Layout.preferredHeight: ChatCalendarMessageStyle.participants.iconSize Layout.leftMargin: 5 Layout.rightMargin: 15 - spacing: ChatCalendarMessageStyle.participants.spacing + spacing: ChatCalendarMessageStyle.participants.spacing + visible: participantsRow.participantCount > 0 Icon{ icon: ChatCalendarMessageStyle.participants.icon @@ -124,13 +126,12 @@ Loader{ Text { id: participantsList - property int participantCount: mainItem.conferenceInfoModel.getParticipantCount() Layout.fillWidth: true color: ChatCalendarMessageStyle.participants.color elide: Text.ElideRight font.pointSize: ChatCalendarMessageStyle.participants.pointSize //: '%1 participant' : number(=%1) of participant. - text: qsTr('icsParticipants', '', participantCount).arg(participantCount) + text: qsTr('icsParticipants', '', participantsRow.participantCount).arg(participantsRow.participantCount) } } ColumnLayout{