From 35c6f8f2059599caa38e12d892460646265523e9 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 1 Sep 2022 14:46:25 +0200 Subject: [PATCH] Update and clean contact design. Display sender on incoming message. --- .../modules/Linphone/Calls/CallControls.qml | 4 +- .../ui/modules/Linphone/Calls/Calls.qml | 16 ++-- .../ui/modules/Linphone/Contact/Contact.qml | 51 ++++++------ .../Linphone/Contact/ContactDescription.qml | 82 +++++++++---------- .../NotificationReceivedMessage.qml | 7 +- .../Linphone/Styles/Calls/CallsStyle.qml | 12 +-- .../Contact/ContactDescriptionStyle.qml | 8 +- .../Styles/Timeline/TimelineStyle.qml | 12 +-- .../Linphone/Timeline/TimelineItem.qml | 13 +-- .../Linphone/View/ParticipantsListView.qml | 4 +- .../Linphone/View/ParticipantsView.qml | 4 +- .../Linphone/View/SipAddressesView.qml | 4 +- .../views/App/Calls/AbstractStartingCall.qml | 4 +- .../ui/views/App/Calls/Conference.qml | 4 +- .../ui/views/App/Dialog/NewConference.qml | 2 +- .../ui/views/App/Main/Conversation.qml | 18 +++- .../views/App/Main/Dialogs/InfoChatRoom.qml | 4 +- .../ui/views/App/Main/Dialogs/NewChatRoom.qml | 2 +- .../App/Main/Dialogs/ParticipantsDevices.qml | 2 +- .../ui/views/App/Main/HistoryView.qml | 8 +- .../App/Styles/Main/ConversationStyle.qml | 10 +-- .../App/Styles/Main/HistoryViewStyle.qml | 4 +- 22 files changed, 144 insertions(+), 131 deletions(-) diff --git a/linphone-app/ui/modules/Linphone/Calls/CallControls.qml b/linphone-app/ui/modules/Linphone/Calls/CallControls.qml index 895bcaba9..1797322f5 100644 --- a/linphone-app/ui/modules/Linphone/Calls/CallControls.qml +++ b/linphone-app/ui/modules/Linphone/Calls/CallControls.qml @@ -15,8 +15,8 @@ Rectangle { default property alias _content: content.data property alias signIcon: signIcon.icon - property alias sipAddressColor: contact.sipAddressColor - property alias usernameColor: contact.usernameColor + property alias subtitleColor: contact.subtitleColor + property alias titleColor: contact.titleColor property string peerAddress property string localAddress diff --git a/linphone-app/ui/modules/Linphone/Calls/Calls.qml b/linphone-app/ui/modules/Linphone/Calls/Calls.qml index c8348b32c..1cbe6d84b 100644 --- a/linphone-app/ui/modules/Linphone/Calls/Calls.qml +++ b/linphone-app/ui/modules/Linphone/Calls/Calls.qml @@ -124,8 +124,8 @@ ListView { : CallsStyle.entry.color.normal textColor: isSelected - ? CallsStyle.entry.usernameColor.selected - : CallsStyle.entry.usernameColor.normal + ? CallsStyle.entry.titleColor.selected + : CallsStyle.entry.titleColor.normal onClicked: Logic.resetSelectedCall() onVisibleChanged: !visible && Logic.handleCountChanged(calls.count) @@ -149,12 +149,12 @@ ListView { color: useColorStatus() ? CallsStyle.entry.color.selected : CallsStyle.entry.color.normal - sipAddressColor: useColorStatus() - ? CallsStyle.entry.sipAddressColor.selected - : CallsStyle.entry.sipAddressColor.normal - usernameColor: useColorStatus() - ? CallsStyle.entry.usernameColor.selected - : CallsStyle.entry.usernameColor.normal + subtitleColor: useColorStatus() + ? CallsStyle.entry.subtitleColor.selected + : CallsStyle.entry.subtitleColor.normal + titleColor: useColorStatus() + ? CallsStyle.entry.titleColor.selected + : CallsStyle.entry.titleColor.normal signIcon: { var params = loader.params diff --git a/linphone-app/ui/modules/Linphone/Contact/Contact.qml b/linphone-app/ui/modules/Linphone/Contact/Contact.qml index 87d67df38..be018b71d 100644 --- a/linphone-app/ui/modules/Linphone/Contact/Contact.qml +++ b/linphone-app/ui/modules/Linphone/Contact/Contact.qml @@ -18,23 +18,24 @@ Rectangle { property var entry // entry should have these functions : presenceStatus, sipAddress, username, avatar (image) - property alias sipAddressColor: description.sipAddressColor - property alias usernameColor: description.usernameColor + property alias subtitleColor: description.subtitleColor + property alias titleColor: description.titleColor property alias statusText : description.statusText property bool displayUnreadMessageCount: false - property bool showContactAddress : true - property bool showAuxData : false + property bool showSubtitle : true + property string subtitle: '' - property string username: (entry != undefined - ? entry.conferenceInfoModel && entry.conferenceInfoModel.subject + property string subject: (entry != undefined && entry.conferenceInfoModel && entry.conferenceInfoModel.subject ? entry.conferenceInfoModel.subject - : entry.username != undefined + : '') + property string username: (entry != undefined && entry.username != undefined ? entry.username : entry.contactModel != undefined ? entry.contactModel.vcard.username - : UtilsCpp.getDisplayName(entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '') - : '') + : UtilsCpp.getDisplayName(entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '')) + property string organizer: entry.conferenceInfoModel ? UtilsCpp.getDisplayName(entry.conferenceInfoModel.organizer) : '' + signal avatarClicked(var mouse) // --------------------------------------------------------------------------- @@ -65,16 +66,13 @@ Rectangle { ) :-1 - //username: UtilsCpp.getDisplayName(entry.sipAddress || entry.peerAddress ) - - username : entry!=undefined + username: entry!=undefined ? entry.conferenceInfoModel - ? UtilsCpp.getDisplayName(entry.conferenceInfoModel.organizer) + ? item.organizer : entry.isOneToOne!=undefined && !entry.isOneToOne ? '' : item.username : item.username - visible:!groupChat.visible Icon { @@ -126,19 +124,18 @@ Rectangle { Layout.fillWidth: true Layout.leftMargin: ContactStyle.spacing - sipAddress: (entry && item.showContactAddress - && (item.showAuxData - ? item.subject - ? '- ' +item.subject +' -' - : '' - : (entry.isOneToOne == undefined || entry.isOneToOne) && (entry.haveEncryption == undefined || !entry.haveEncryption) - ? entry.conferenceInfoModel - ? entry.conferenceInfoModel.organizer - : entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '' - : '') - ) || '' - participants: entry && item.showContactAddress && sipAddress == '' && entry.isOneToOne && entry.participants ? entry.participants.addressesToString : '' - username: item.username + titleText: item.subject + ? item.subject + : item.username + subtitleText: entry && item.showSubtitle + ? item.subtitle + ? item.subtitle + : (entry.isOneToOne == undefined || entry.isOneToOne) && (entry.haveEncryption == undefined || !entry.haveEncryption) + ? item.organizer + ? item.organizer + : entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '' + : entry.participants.addressesToString + : '' } ContactMessageCounter { diff --git a/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml b/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml index 8917870a6..1b5c71930 100644 --- a/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml +++ b/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml @@ -8,40 +8,40 @@ import Common 1.0 Column { id:mainItem - property alias username: username.fullText + property alias titleText: title.fullText + property alias subtitleText: subtitle.fullText property string sipAddress - property string participants property alias statusText : status.text property var contactDescriptionStyle : ContactDescriptionStyle - property color sipAddressColor: contactDescriptionStyle.sipAddress.color - property color usernameColor: contactDescriptionStyle.username.color + property color subtitleColor: contactDescriptionStyle.subtitle.color + property color titleColor: contactDescriptionStyle.title.color property int horizontalTextAlignment - property int contentWidth : Math.max(usernameImplicitWidthWorkaround.implicitWidth, addressImplicitWidthWorkaround.implicitWidth) + property int contentWidth : Math.max(titleImplicitWidthWorkaround.implicitWidth, subtitleImplicitWidthWorkaround.implicitWidth) +10 +statusWidth - property int contentHeight : Math.max(username.implicitHeight, address.implicitHeight)+10 + property int contentHeight : Math.max(title.implicitHeight, subtitle.implicitHeight)+10 readonly property int statusWidth : (status.visible ? status.width + 5 : 0) - property bool usernameClickable: false + property bool titleClickable: false - signal usernameClicked() + signal titleClicked() // --------------------------------------------------------------------------- TextEdit { - id: username + id: title property string fullText anchors.horizontalCenter: (horizontalTextAlignment == Text.AlignHCenter ? parent.horizontalCenter : undefined) - color: usernameColor - font.weight: contactDescriptionStyle.username.weight - font.pointSize: contactDescriptionStyle.username.pointSize + color: titleColor + font.weight: contactDescriptionStyle.title.weight + font.pointSize: contactDescriptionStyle.title.pointSize horizontalAlignment: horizontalTextAlignment - verticalAlignment: (address.visible?Text.AlignBottom:Text.AlignVCenter) - width: Math.min(parent.width-statusWidth, usernameImplicitWidthWorkaround.implicitWidth) + verticalAlignment: (subtitle.visible?Text.AlignBottom:Text.AlignVCenter) + width: Math.min(parent.width-statusWidth, titleImplicitWidthWorkaround.implicitWidth) height: (parent.height-parent.topPadding-parent.bottomPadding)/parent.visibleChildren.length text: metrics.elidedText @@ -50,18 +50,18 @@ Column { selectByMouse: true Text{// Workaround to get implicitWidth from text without eliding - id: usernameImplicitWidthWorkaround - text: username.fullText - font.weight: username.font.weight - font.pointSize: username.font.pointSize + id: titleImplicitWidthWorkaround + text: title.fullText + font.weight: title.font.weight + font.pointSize: title.font.pointSize visible: false } TextMetrics { id: metrics - font: username.font - text: username.fullText - elideWidth: username.width + font: title.font + text: title.fullText + elideWidth: title.width elide: Qt.ElideRight } Text{ @@ -73,47 +73,47 @@ Column { verticalAlignment: Text.AlignVCenter visible: text != '' text : '' - color: contactDescriptionStyle.username.status.color - font.pointSize: contactDescriptionStyle.username.status.pointSize + color: contactDescriptionStyle.title.status.color + font.pointSize: contactDescriptionStyle.title.status.pointSize font.italic : true } MouseArea{ anchors.fill:parent - visible: usernameClickable - onClicked: usernameClicked() + visible: titleClickable + onClicked: titleClicked() } } TextEdit { - id:address - property string fullText: sipAddress?SipAddressesModel.cleanSipAddress(sipAddress):participants + id:subtitle + property string fullText anchors.horizontalCenter: (horizontalTextAlignment == Text.AlignHCenter ? parent.horizontalCenter : undefined) - color: sipAddressColor - font.weight: contactDescriptionStyle.sipAddress.weight - font.pointSize: contactDescriptionStyle.sipAddress.pointSize + color: subtitleColor + font.weight: contactDescriptionStyle.subtitle.weight + font.pointSize: contactDescriptionStyle.subtitle.pointSize horizontalAlignment: horizontalTextAlignment - verticalAlignment: (username.visible?Text.AlignTop:Text.AlignVCenter) - width: Math.min(parent.width-statusWidth, addressImplicitWidthWorkaround.implicitWidth) + verticalAlignment: (title.visible?Text.AlignTop:Text.AlignVCenter) + width: Math.min(parent.width-statusWidth, subtitleImplicitWidthWorkaround.implicitWidth) height: (parent.height-parent.topPadding-parent.bottomPadding)/parent.visibleChildren.length visible: text != '' - text: addressMetrics.elidedText + text: subtitleMetrics.elidedText onActiveFocusChanged: deselect(); readOnly: true selectByMouse: true Text{// Workaround to get implicitWidth from text without eliding - id: addressImplicitWidthWorkaround - text: address.fullText - font.weight: address.font.weight - font.pointSize: address.font.pointSize + id: subtitleImplicitWidthWorkaround + text: subtitle.fullText + font.weight: subtitle.font.weight + font.pointSize: subtitle.font.pointSize visible: false } TextMetrics { - id: addressMetrics - font: address.font - text: address.fullText - elideWidth: address.width + id: subtitleMetrics + font: subtitle.font + text: subtitle.fullText + elideWidth: subtitle.width elide: Qt.ElideRight } } diff --git a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml index c2dc349ed..cfe2a894b 100644 --- a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml +++ b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import UtilsCpp 1.0 import 'qrc:/ui/scripts/Utils/utils.js' as Utils @@ -40,8 +41,10 @@ Notification { Contact { Layout.fillWidth: true property ChatRoomModel chatRoomModel : notification.timelineModel.getChatRoomModel() - property var sipObserver: SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress) - showAuxData: !chatRoomModel.isOneToOne + property var sipObserver: SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress) + subtitle: chatRoomModel.isOneToOne + ? SipAddressesModel.cleanSipAddress(notification.fullPeerAddress) + : UtilsCpp.getDisplayName(notification.fullPeerAddress) entry: chatRoomModel ? chatRoomModel : sipObserver Component.onDestruction: sipObserver=null// Need to set it to null because of not calling destructor if not. } diff --git a/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml index d2a89a808..3722411a7 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml @@ -56,14 +56,14 @@ QtObject { property int loops: 3 } - property QtObject sipAddressColor: QtObject { - property color normal: ColorsList.add('Calls_entry_sipAddress_n', 'n').color - property color selected: ColorsList.add('Calls_entry_sipAddress_selected', 'q').color + property QtObject subtitleColor: QtObject { + property color normal: ColorsList.add('Calls_entry_subtitle_n', 'n').color + property color selected: ColorsList.add('Calls_entry_subtitle_selected', 'q').color } - property QtObject usernameColor: QtObject { - property color normal: ColorsList.add('Calls_entry_username_n', 'j').color - property color selected: ColorsList.add('Calls_entry_username_selected', 'q').color + property QtObject titleColor: QtObject { + property color normal: ColorsList.add('Calls_entry_title_n', 'j').color + property color selected: ColorsList.add('Calls_entry_title_selected', 'q').color } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml index 2cd2f460e..57ba1fd9d 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml @@ -9,14 +9,14 @@ import ColorsList 1.0 QtObject { property string sectionName: 'ContactDescription' - property QtObject sipAddress: QtObject { - property color color: ColorsList.add(sectionName+'_sipAddress', 'n').color + property QtObject subtitle: QtObject { + property color color: ColorsList.add(sectionName+'_subtitle', 'n').color property int pointSize: Units.dp * 10 property int weight: Font.Normal } - property QtObject username: QtObject { - property color color: ColorsList.add(sectionName+'_username', 'j').color + property QtObject title: QtObject { + property color color: ColorsList.add(sectionName+'_title', 'j').color property int pointSize: Units.dp * 11 property int weight: Font.Bold property QtObject status : QtObject{ diff --git a/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml index b5e63dd63..e21555316 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml @@ -26,17 +26,17 @@ QtObject { property color selected: ColorsList.add(sectionName+'_contact_bg_c', 'i').color } - property QtObject sipAddress: QtObject { + property QtObject subtitle: QtObject { property QtObject color: QtObject { - property color normal: ColorsList.add(sectionName+'_contact_sipAddress_n', 'n').color - property color selected: ColorsList.add(sectionName+'_contact_sipAddress_c', 'q').color + property color normal: ColorsList.add(sectionName+'_contact_subtitle_n', 'n').color + property color selected: ColorsList.add(sectionName+'_contact_subtitle_c', 'q').color } } - property QtObject username: QtObject { + property QtObject title: QtObject { property QtObject color: QtObject { - property color normal: ColorsList.add(sectionName+'_contact_username_n', 'j').color - property color selected: ColorsList.add(sectionName+'_contact_username_c', 'q').color + property color normal: ColorsList.add(sectionName+'_contact_title_n', 'j').color + property color selected: ColorsList.add(sectionName+'_contact_title_c', 'q').color } } } diff --git a/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml b/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml index d158924db..1c9922a64 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml @@ -61,12 +61,13 @@ Item { ) displayUnreadMessageCount: SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled entry: mainItem.timelineModel && mainItem.timelineModel.chatRoomModel - sipAddressColor: isSelected - ? TimelineStyle.contact.sipAddress.color.selected - : TimelineStyle.contact.sipAddress.color.normal - usernameColor: isSelected - ? TimelineStyle.contact.username.color.selected - : TimelineStyle.contact.username.color.normal + subtitleColor: isSelected + ? TimelineStyle.contact.subtitle.color.selected + : TimelineStyle.contact.subtitle.color.normal + titleColor: isSelected + ? TimelineStyle.contact.title.color.selected + : TimelineStyle.contact.title.color.normal + showSubtitle: mainItem.timelineModel.chatRoomModel.isOneToOne || !mainItem.timelineModel.chatRoomModel.isConference TooltipArea { id: contactTooltip text: mainItem.timelineModel && UtilsCpp.toDateTimeString(mainItem.timelineModel.chatRoomModel.lastUpdateTime) diff --git a/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml b/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml index 8f91af51c..e76785ca2 100644 --- a/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml +++ b/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml @@ -102,7 +102,7 @@ ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true - showContactAddress:false + showSubtitle:false showSwitch : mainLayout.isAdmin showSeparator: false showAdminStatus:!mainLayout.isAdmin @@ -134,7 +134,7 @@ ColumnLayout { } onEntryClicked: { - contactItem.showContactAddress = !contactItem.showContactAddress + contactItem.showSubtitle = !contactItem.showSubtitle } } } diff --git a/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml b/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml index 60b436768..fff449043 100644 --- a/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml +++ b/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml @@ -25,7 +25,7 @@ ScrollableListView { property string headerButtonIcon property var headerButtonAction property bool showHeader : true - property bool showContactAddress : true + property bool showSubtitle : true property bool showSwitch : false property bool showSeparator : true property bool showAdminStatus : false @@ -235,7 +235,7 @@ ScrollableListView { id:contactView Layout.fillHeight: true Layout.fillWidth: true - showContactAddress: sipAddressesView.showContactAddress + showSubtitle: sipAddressesView.showSubtitle function getStatus(){ var count = 0; var txt = '' diff --git a/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml b/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml index 593b4b0d6..ea5665d5f 100644 --- a/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml +++ b/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml @@ -31,7 +31,7 @@ ScrollableListView { property color headerButtonOverwriteColor property var headerButtonAction property bool showHeader : true - property bool showContactAddress : true + property bool showSubtitle : true property bool showSwitch : false property bool showSeparator : true property bool isSelectable : true @@ -244,7 +244,7 @@ ScrollableListView { Contact { Layout.fillHeight: true Layout.fillWidth: true - showContactAddress: sipAddressesView.showContactAddress + showSubtitle: sipAddressesView.showSubtitle entry: $modelData diff --git a/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml b/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml index 14066920c..53afc0f04 100644 --- a/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml +++ b/linphone-app/ui/views/App/Calls/AbstractStartingCall.qml @@ -43,8 +43,8 @@ Rectangle { anchors.horizontalCenter: parent.horizontalCenter height: CallStyle.header.contactDescription.height horizontalTextAlignment: Text.AlignHCenter - sipAddress: call.peerAddress - username: _sipAddressObserver ? UtilsCpp.getDisplayName(_sipAddressObserver.peerAddress) : '' + subtitleText: SipAddressesModel.cleanSipAddress(call.peerAddress) + titleText: _sipAddressObserver ? UtilsCpp.getDisplayName(_sipAddressObserver.peerAddress) : '' width: contentWidth } diff --git a/linphone-app/ui/views/App/Calls/Conference.qml b/linphone-app/ui/views/App/Calls/Conference.qml index 5de957605..5ab5d4b29 100644 --- a/linphone-app/ui/views/App/Calls/Conference.qml +++ b/linphone-app/ui/views/App/Calls/Conference.qml @@ -137,8 +137,8 @@ Rectangle { width: parent.width horizontalTextAlignment: Text.AlignHCenter - sipAddress: parent.sipAddress - username: parent._sipAddressObserver ? UtilsCpp.getDisplayName(parent._sipAddressObserver.peerAddress) : '' + subtitleText: SipAddressesModel.cleanSipAddress(parent.sipAddress) + titleText: parent._sipAddressObserver ? UtilsCpp.getDisplayName(parent._sipAddressObserver.peerAddress) : '' } IncallAvatar { diff --git a/linphone-app/ui/views/App/Dialog/NewConference.qml b/linphone-app/ui/views/App/Dialog/NewConference.qml index a8a60b683..95f8d5919 100644 --- a/linphone-app/ui/views/App/Dialog/NewConference.qml +++ b/linphone-app/ui/views/App/Dialog/NewConference.qml @@ -539,7 +539,7 @@ DialogPlus { id: participantView anchors.fill: parent - showContactAddress:false + showSubtitle:false showSwitch : conferenceManager.isNew showSeparator: false isSelectable: false diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index 0ae8617ed..9afb70e1a 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -166,8 +166,19 @@ ColumnLayout { Layout.alignment: Qt.AlignTop | Qt.AlignLeft visible: !usernameEdit.visible contactDescriptionStyle: ConversationStyle.bar.contactDescription - username: avatar.username - usernameClickable: chatRoomModel.isMeAdmin && !chatRoomModel.isOneToOne + titleText: avatar.username + titleClickable: chatRoomModel.isMeAdmin && !chatRoomModel.isOneToOne + subtitleText: if(chatRoomModel) { + if(chatRoomModel.groupEnabled) { + return chatRoomModel.participants.displayNamesToString; + }else if(chatRoomModel.isSecure()) { + return chatRoomModel.participants.addressesToString; + }else + return SipAddressesModel.cleanSipAddress(chatRoomModel.sipAddress) + }else + return '' + + /* participants: if(chatRoomModel) { if(chatRoomModel.groupEnabled) { return chatRoomModel.participants.displayNamesToString; @@ -191,7 +202,8 @@ ColumnLayout { } } - onUsernameClicked: { + */ + onTitleClicked: { if(!conversation.isReadOnly) { usernameEdit.visible = !usernameEdit.visible usernameEdit.forceActiveFocus() diff --git a/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml b/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml index cfe0eb75a..cdbd607d2 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml @@ -141,7 +141,7 @@ DialogPlus { Layout.fillHeight: true Layout.fillWidth: true - showContactAddress:false + showSubtitle:false showSwitch : dialog.adminMode showSeparator: false showAdminStatus:!dialog.adminMode @@ -173,7 +173,7 @@ DialogPlus { } onEntryClicked: { - contactItem.showContactAddress = !contactItem.showContactAddress + contactItem.showSubtitle = !contactItem.showSubtitle } } } diff --git a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml index f4de9f1b2..af8e5c3d1 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml @@ -360,7 +360,7 @@ DialogPlus { id: participantView anchors.fill: parent - showContactAddress:false + showSubtitle:false showSwitch : true showSeparator: false isSelectable: false diff --git a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml index 7d37f28a7..32d07973f 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml @@ -90,7 +90,7 @@ DialogPlus { ContactDescription{ id:contactDescription anchors.fill:parent - username: avatar.username + titleText: avatar.username } MouseArea{ anchors.fill:contactDescription diff --git a/linphone-app/ui/views/App/Main/HistoryView.qml b/linphone-app/ui/views/App/Main/HistoryView.qml index 316c3fa41..83eb23794 100644 --- a/linphone-app/ui/views/App/Main/HistoryView.qml +++ b/linphone-app/ui/views/App/Main/HistoryView.qml @@ -64,10 +64,10 @@ ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true - sipAddress: historyView.peerAddress - sipAddressColor: HistoryViewStyle.bar.description.sipAddressColor - username: avatar.username - usernameColor: HistoryViewStyle.bar.description.usernameColor + subtitleText: SipAddressesModel.cleanSipAddress(sipAddress)(historyView.peerAddress) + subtitleColor: HistoryViewStyle.bar.description.subtitleColor + titleText: avatar.username + titleColor: HistoryViewStyle.bar.description.titleColor visible:peerAddress } diff --git a/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml b/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml index 894428f3a..56cbf2722 100644 --- a/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml @@ -138,18 +138,18 @@ QtObject { } property QtObject contactDescription : QtObject { - property QtObject sipAddress: QtObject { - property color color: ColorsList.add(sectionName+'_description_sipAddress', 'n').color + property QtObject subtitle: QtObject { + property color color: ColorsList.add(sectionName+'_description_subtitle', 'n').color property int pointSize: Units.dp * 10 property int weight: Font.Light } - property QtObject username: QtObject { - property color color: ColorsList.add(sectionName+'_description_username', 'j').color + property QtObject title: QtObject { + property color color: ColorsList.add(sectionName+'_description_title', 'j').color property int pointSize: Units.dp * 11 property int weight: Font.Normal property QtObject status : QtObject{ - property color color : ColorsList.add(sectionName+'_description_username_status', 'g').color + property color color : ColorsList.add(sectionName+'_description_title_status', 'g').color property int pointSize : Units.dp * 9 } } diff --git a/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml b/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml index a04e41bab..d44f5134c 100644 --- a/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml @@ -31,8 +31,8 @@ QtObject { } property QtObject description: QtObject { - property color sipAddressColor: ColorsList.add(sectionName+'_bar_description_sipAddress', 'g').color - property color usernameColor: ColorsList.add(sectionName+'_bar_description_username', 'j').color + property color subtitleColor: ColorsList.add(sectionName+'_bar_description_subtitle', 'g').color + property color titleColor: ColorsList.add(sectionName+'_bar_description_title', 'j').color } }