From 8a6c9b918275dc7692ade82e625a496361372458 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 28 Oct 2024 15:55:42 +0100 Subject: [PATCH] new contact ui --- Linphone/data/image/arrow-right.svg | 1 + Linphone/data/image/question.svg | 2 +- Linphone/view/CMakeLists.txt | 2 + Linphone/view/Control/Button/Button.qml | 1 - .../Container/Call/CallHistoryLayout.qml | 211 +++++++ .../Container/Contact/ContactLayout.qml | 231 ++----- Linphone/view/Control/Container/ScrollBar.qml | 4 +- .../view/Control/Display/Contact/Avatar.qml | 4 +- Linphone/view/Control/Display/Flickable.qml | 3 +- .../Control/Display/GradientRectangle.qml | 27 + .../view/Page/Form/Contact/ContactEdition.qml | 143 ++--- .../view/Page/Form/Meeting/MeetingForm.qml | 2 +- Linphone/view/Page/Main/Call/CallPage.qml | 2 +- .../view/Page/Main/Contact/ContactPage.qml | 578 +++++++++++------- Linphone/view/Page/Window/AbstractWindow.qml | 8 +- Linphone/view/Style/AppIcons.qml | 1 + 16 files changed, 695 insertions(+), 525 deletions(-) create mode 100644 Linphone/data/image/arrow-right.svg create mode 100644 Linphone/view/Control/Container/Call/CallHistoryLayout.qml create mode 100644 Linphone/view/Control/Display/GradientRectangle.qml diff --git a/Linphone/data/image/arrow-right.svg b/Linphone/data/image/arrow-right.svg new file mode 100644 index 00000000..39e1452e --- /dev/null +++ b/Linphone/data/image/arrow-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Linphone/data/image/question.svg b/Linphone/data/image/question.svg index 6d8013ce..7825afec 100644 --- a/Linphone/data/image/question.svg +++ b/Linphone/data/image/question.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Linphone/view/CMakeLists.txt b/Linphone/view/CMakeLists.txt index 6277c5cb..7233f132 100644 --- a/Linphone/view/CMakeLists.txt +++ b/Linphone/view/CMakeLists.txt @@ -26,6 +26,7 @@ list(APPEND _LINPHONEAPP_QML_FILES view/Control/Container/TabBar.qml view/Control/Container/VerticalTabBar.qml view/Control/Container/Call/ActiveSpeakerLayout.qml + view/Control/Container/Call/CallHistoryLayout.qml view/Control/Container/Call/CallLayout.qml view/Control/Container/Call/GridLayout.qml view/Control/Container/Call/Mosaic.qml @@ -35,6 +36,7 @@ list(APPEND _LINPHONEAPP_QML_FILES view/Control/Display/BusyIndicator.qml view/Control/Display/EffectImage.qml view/Control/Display/Flickable.qml + view/Control/Display/GradientRectangle.qml view/Control/Display/TemporaryText.qml view/Control/Display/ProgressBar.qml view/Control/Display/RoundedPane.qml diff --git a/Linphone/view/Control/Button/Button.qml b/Linphone/view/Control/Button/Button.qml index ba3f39e8..4ad1a8ec 100644 --- a/Linphone/view/Control/Button/Button.qml +++ b/Linphone/view/Control/Button/Button.qml @@ -91,7 +91,6 @@ Control.Button { TextMetrics { id: textMetrics text: mainItem.text - font: buttonText.font } } diff --git a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml new file mode 100644 index 00000000..c2c8eaec --- /dev/null +++ b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml @@ -0,0 +1,211 @@ +import QtQuick +import QtQuick.Effects +import QtQuick.Layouts +import QtQuick.Controls.Basic as Control +import Linphone +import UtilsCpp +import SettingsCpp + +ColumnLayout { + id: mainItem + spacing: 30 * DefaultStyle.dp + + property FriendGui contact + property ConferenceInfoGui conferenceInfo + property bool isConference: conferenceInfo != undefined && conferenceInfo != null + property string contactAddress: specificAddress != "" ? specificAddress : contact && contact.core.defaultAddress || "" + property var computedContactNameObj: UtilsCpp.getDisplayName(contactAddress) + property string computedContactName: computedContactNameObj ? computedContactNameObj.value: "" + property string contactName: contact + ? contact.core.displayName + : conferenceInfo + ? conferenceInfo.core.subject + : computedContactName + + // Set this property to get the security informations + // for a specific address and not for the entire contact + property string specificAddress: "" + + property alias buttonContent: rightButton.data + property alias detailContent: detailControl.data + + component LabelButton: ColumnLayout { + id: labelButton + // property alias image: buttonImg + property alias button: button + property string label + spacing: 8 * DefaultStyle.dp + Button { + id: button + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: 56 * DefaultStyle.dp + Layout.preferredHeight: 56 * DefaultStyle.dp + topPadding: 16 * DefaultStyle.dp + bottomPadding: 16 * DefaultStyle.dp + leftPadding: 16 * DefaultStyle.dp + rightPadding: 16 * DefaultStyle.dp + contentImageColor: DefaultStyle.main2_600 + background: Rectangle { + anchors.fill: parent + radius: 40 * DefaultStyle.dp + color: DefaultStyle.main2_200 + } + } + Text { + Layout.alignment: Qt.AlignHCenter + text: labelButton.label + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + } + } + } + + ColumnLayout { + spacing: 13 * DefaultStyle.dp + Item { + Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredHeight: detailAvatar.height + Layout.alignment: Qt.AlignHCenter + Avatar { + id: detailAvatar + anchors.horizontalCenter: parent.horizontalCenter + width: 100 * DefaultStyle.dp + height: 100 * DefaultStyle.dp + contact: mainItem.contact || null + _address: mainItem.conferenceInfo + ? mainItem.conferenceInfo.core.subject + : mainItem.contactAddress || mainItem.contactName + } + Item { + id: rightButton + anchors.right: parent.right + anchors.verticalCenter: detailAvatar.verticalCenter + anchors.rightMargin: 20 * DefaultStyle.dp + width: 30 * DefaultStyle.dp + height: 30 * DefaultStyle.dp + } + } + ColumnLayout { + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: 360 * DefaultStyle.dp + spacing: 2 * DefaultStyle.dp + + Text { + Layout.preferredWidth: implicitWidth + Layout.alignment: Qt.AlignHCenter + horizontalAlignment: Text.AlignHCenter + elide: Text.ElideRight + text: mainItem.contactName + maximumLineCount: 1 + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + capitalization: Font.Capitalize + } + } + Text { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + visible: mainItem.specificAddress != "" + text: mainItem.specificAddress + elide: Text.ElideMiddle + maximumLineCount: 1 + font { + pixelSize: 12 * DefaultStyle.dp + weight: 300 * DefaultStyle.dp + } + } + Text { + property var mode : contact ? contact.core.consolidatedPresence : -1 + Layout.alignment: Qt.AlignHCenter + horizontalAlignment: Text.AlignHCenter + Layout.fillWidth: true + visible: mainItem.contact + text: mode === LinphoneEnums.ConsolidatedPresence.Online + ? qsTr("En ligne") + : mode === LinphoneEnums.ConsolidatedPresence.Busy + ? qsTr("Occupé") + : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb + ? qsTr("Ne pas déranger") + : qsTr("Hors ligne") + color: mode === LinphoneEnums.ConsolidatedPresence.Online + ? DefaultStyle.success_500main + : mode === LinphoneEnums.ConsolidatedPresence.Busy + ? DefaultStyle.warning_600 + : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb + ? DefaultStyle.danger_500main + : DefaultStyle.main2_500main + font { + pixelSize: 12 * DefaultStyle.dp + weight: 300 * DefaultStyle.dp + } + } + } + } + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 72 * DefaultStyle.dp + Layout.fillWidth: true + Layout.preferredHeight: childrenRect.height + Button { + visible: mainItem.isConference && !SettingsCpp.disableMeetingsFeature + Layout.alignment: Qt.AlignHCenter + text: qsTr("Rejoindre la réunion") + color: DefaultStyle.main2_200 + textColor: DefaultStyle.main2_600 + onClicked: { + if (mainItem.conferenceInfo) { + var callsWindow = UtilsCpp.getCallsWindow() + callsWindow.setupConference(mainItem.conferenceInfo) + callsWindow.show() + } + } + } + LabelButton { + visible: !mainItem.isConference + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.icon.source: AppIcons.phone + label: qsTr("Appel") + button.onClicked: { + if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, false, mainItem) + else UtilsCpp.createCall(mainItem.specificAddress) + } + } + LabelButton { + visible: !mainItem.isConference && !SettingsCpp.disableChatFeature + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.icon.source: AppIcons.chatTeardropText + label: qsTr("Message") + button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation") + } + LabelButton { + visible: !mainItem.isConference + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.icon.source: AppIcons.videoCamera + label: qsTr("Appel Video") + button.onClicked: { + if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, true, mainItem) + else UtilsCpp.createCall(mainItem.specificAddress, {'localVideoEnabled': true}) + } + } + } + ColumnLayout { + id: detailControl + Layout.fillWidth: true + Layout.fillHeight: true + + Layout.alignment: Qt.AlignHCenter + Layout.topMargin: 30 * DefaultStyle.dp + } +} diff --git a/Linphone/view/Control/Container/Contact/ContactLayout.qml b/Linphone/view/Control/Container/Contact/ContactLayout.qml index c2c8eaec..62f03187 100644 --- a/Linphone/view/Control/Container/Contact/ContactLayout.qml +++ b/Linphone/view/Control/Container/Contact/ContactLayout.qml @@ -11,201 +11,62 @@ ColumnLayout { spacing: 30 * DefaultStyle.dp property FriendGui contact - property ConferenceInfoGui conferenceInfo - property bool isConference: conferenceInfo != undefined && conferenceInfo != null - property string contactAddress: specificAddress != "" ? specificAddress : contact && contact.core.defaultAddress || "" - property var computedContactNameObj: UtilsCpp.getDisplayName(contactAddress) - property string computedContactName: computedContactNameObj ? computedContactNameObj.value: "" - property string contactName: contact - ? contact.core.displayName - : conferenceInfo - ? conferenceInfo.core.subject - : computedContactName - // Set this property to get the security informations - // for a specific address and not for the entire contact - property string specificAddress: "" + property alias button: rightButton + property alias content: detailLayout.data + property alias bannerContent: bannerLayout.data - property alias buttonContent: rightButton.data - property alias detailContent: detailControl.data - - component LabelButton: ColumnLayout { - id: labelButton - // property alias image: buttonImg - property alias button: button - property string label - spacing: 8 * DefaultStyle.dp - Button { - id: button - Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 56 * DefaultStyle.dp - Layout.preferredHeight: 56 * DefaultStyle.dp - topPadding: 16 * DefaultStyle.dp - bottomPadding: 16 * DefaultStyle.dp - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp - contentImageColor: DefaultStyle.main2_600 - background: Rectangle { - anchors.fill: parent - radius: 40 * DefaultStyle.dp - color: DefaultStyle.main2_200 - } - } - Text { - Layout.alignment: Qt.AlignHCenter - text: labelButton.label - font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - } - } - } - - ColumnLayout { - spacing: 13 * DefaultStyle.dp - Item { - Layout.preferredWidth: 360 * DefaultStyle.dp - Layout.preferredHeight: detailAvatar.height - Layout.alignment: Qt.AlignHCenter - Avatar { - id: detailAvatar - anchors.horizontalCenter: parent.horizontalCenter - width: 100 * DefaultStyle.dp - height: 100 * DefaultStyle.dp - contact: mainItem.contact || null - _address: mainItem.conferenceInfo - ? mainItem.conferenceInfo.core.subject - : mainItem.contactAddress || mainItem.contactName - } - Item { - id: rightButton - anchors.right: parent.right - anchors.verticalCenter: detailAvatar.verticalCenter - anchors.rightMargin: 20 * DefaultStyle.dp - width: 30 * DefaultStyle.dp - height: 30 * DefaultStyle.dp - } - } - ColumnLayout { - Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 360 * DefaultStyle.dp - spacing: 2 * DefaultStyle.dp - - Text { - Layout.preferredWidth: implicitWidth - Layout.alignment: Qt.AlignHCenter - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideRight - text: mainItem.contactName - maximumLineCount: 1 - font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - capitalization: Font.Capitalize - } - } - Text { - Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - visible: mainItem.specificAddress != "" - text: mainItem.specificAddress - elide: Text.ElideMiddle - maximumLineCount: 1 - font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp - } - } - Text { - property var mode : contact ? contact.core.consolidatedPresence : -1 - Layout.alignment: Qt.AlignHCenter - horizontalAlignment: Text.AlignHCenter - Layout.fillWidth: true - visible: mainItem.contact - text: mode === LinphoneEnums.ConsolidatedPresence.Online - ? qsTr("En ligne") - : mode === LinphoneEnums.ConsolidatedPresence.Busy - ? qsTr("Occupé") - : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb - ? qsTr("Ne pas déranger") - : qsTr("Hors ligne") - color: mode === LinphoneEnums.ConsolidatedPresence.Online - ? DefaultStyle.success_500main - : mode === LinphoneEnums.ConsolidatedPresence.Busy - ? DefaultStyle.warning_600 - : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb - ? DefaultStyle.danger_500main - : DefaultStyle.main2_500main - font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp - } - } - } - } RowLayout { - Layout.alignment: Qt.AlignHCenter - spacing: 72 * DefaultStyle.dp - Layout.fillWidth: true - Layout.preferredHeight: childrenRect.height - Button { - visible: mainItem.isConference && !SettingsCpp.disableMeetingsFeature - Layout.alignment: Qt.AlignHCenter - text: qsTr("Rejoindre la réunion") - color: DefaultStyle.main2_200 - textColor: DefaultStyle.main2_600 - onClicked: { - if (mainItem.conferenceInfo) { - var callsWindow = UtilsCpp.getCallsWindow() - callsWindow.setupConference(mainItem.conferenceInfo) - callsWindow.show() + spacing: 49 * DefaultStyle.dp + Layout.leftMargin: 64 * DefaultStyle.dp + Layout.rightMargin: 64 * DefaultStyle.dp + Layout.topMargin: 56 * DefaultStyle.dp + Control.Control { + // Layout.preferredWidth: 734 * DefaultStyle.dp + Layout.fillWidth: true + width: 734 * DefaultStyle.dp + height: 100 * DefaultStyle.dp + rightPadding: 21 * DefaultStyle.dp + background: GradientRectangle { + anchors.fill: parent + anchors.leftMargin: avatar.width / 2 + radius: 15 * DefaultStyle.dp + borderGradient: Gradient { + orientation: Gradient.Horizontal + GradientStop { position: 0.0; color: DefaultStyle.grey_100 } + GradientStop { position: 1.0; color: DefaultStyle.main2_200 } + } + gradient: Gradient { + orientation: Gradient.Horizontal + GradientStop { position: 0.0; color: DefaultStyle.grey_0 } + GradientStop { position: 1.0; color: DefaultStyle.grey_100 } + } + } + contentItem: RowLayout { + id: bannerLayout + spacing: 32 * DefaultStyle.dp + Avatar { + id: avatar + contact: mainItem.contact + Layout.preferredWidth: 100 * DefaultStyle.dp + Layout.preferredHeight: 100 * DefaultStyle.dp } } } - LabelButton { - visible: !mainItem.isConference - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp - button.icon.source: AppIcons.phone - label: qsTr("Appel") - button.onClicked: { - if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, false, mainItem) - else UtilsCpp.createCall(mainItem.specificAddress) - } - } - LabelButton { - visible: !mainItem.isConference && !SettingsCpp.disableChatFeature - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp - button.icon.source: AppIcons.chatTeardropText - label: qsTr("Message") - button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation") - } - LabelButton { - visible: !mainItem.isConference - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp - button.icon.source: AppIcons.videoCamera - label: qsTr("Appel Video") - button.onClicked: { - if (mainItem.specificAddress === "") mainWindow.startCallWithContact(mainItem.contact, true, mainItem) - else UtilsCpp.createCall(mainItem.specificAddress, {'localVideoEnabled': true}) - } + Button { + id: rightButton + width: childrenRect.width + height: childrenRect.height } } ColumnLayout { - id: detailControl + id: detailLayout + Layout.alignment: Qt.AlignCenter + Layout.topMargin: 30 * DefaultStyle.dp + Layout.leftMargin: 64 * DefaultStyle.dp + Layout.rightMargin: 64 * DefaultStyle.dp + Layout.bottomMargin: 53 * DefaultStyle.dp Layout.fillWidth: true Layout.fillHeight: true - - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 30 * DefaultStyle.dp } } diff --git a/Linphone/view/Control/Container/ScrollBar.qml b/Linphone/view/Control/Container/ScrollBar.qml index 0ff8ca23..8b842836 100644 --- a/Linphone/view/Control/Container/ScrollBar.qml +++ b/Linphone/view/Control/Container/ScrollBar.qml @@ -7,11 +7,9 @@ import Linphone Control.ScrollBar { id: mainItem padding: 0 - background: Item{} contentItem: Rectangle { implicitWidth: 6 * DefaultStyle.dp radius: 32 * DefaultStyle.dp - // TODO : ask for color names - color: "#D9D9D9" + color: DefaultStyle.grey_850 } } \ No newline at end of file diff --git a/Linphone/view/Control/Display/Contact/Avatar.qml b/Linphone/view/Control/Display/Contact/Avatar.qml index 341e0fef..7322a9e8 100644 --- a/Linphone/view/Control/Display/Contact/Avatar.qml +++ b/Linphone/view/Control/Display/Contact/Avatar.qml @@ -87,9 +87,9 @@ Loader{ color: mainItem.secured ? DefaultStyle.info_500_main : DefaultStyle.danger_500main } Image { - x: stackView.width / 7 + x: parent.width / 7 anchors.bottom: parent.bottom - width: stackView.width / 4.5 + width: parent.width / 4.5 height: width asynchronous: true source: mainItem.secured ? AppIcons.trusted : AppIcons.notTrusted diff --git a/Linphone/view/Control/Display/Flickable.qml b/Linphone/view/Control/Display/Flickable.qml index 44d1c104..999348d7 100644 --- a/Linphone/view/Control/Display/Flickable.qml +++ b/Linphone/view/Control/Display/Flickable.qml @@ -2,9 +2,8 @@ import QtQuick import Linphone Flickable { - width: contentWidth + width: parent.width contentWidth: contentItem.childrenRect.width contentHeight: contentItem.childrenRect.height clip: true - flickableDirection: Flickable.VerticalFlick } \ No newline at end of file diff --git a/Linphone/view/Control/Display/GradientRectangle.qml b/Linphone/view/Control/Display/GradientRectangle.qml new file mode 100644 index 00000000..590c176d --- /dev/null +++ b/Linphone/view/Control/Display/GradientRectangle.qml @@ -0,0 +1,27 @@ +import QtQuick +import Linphone + +Item { + id: mainItem + property int borderWidth: 1 * DefaultStyle.dp + property alias borderGradient: border.gradient + property alias gradient: fill.gradient + property alias color: fill.color + property int radius + Rectangle { + id: border + radius: mainItem.radius + anchors.fill: parent + gradient: Gradient { + orientation: Gradient.Horizontal + GradientStop { position: 0.0; color: DefaultStyle.grey_0 } + GradientStop { position: 1.0; color: DefaultStyle.grey_100 } + } + Rectangle { + id: fill + anchors.fill: parent + anchors.margins: mainItem.borderWidth + radius: mainItem.radius + } + } +} \ No newline at end of file diff --git a/Linphone/view/Page/Form/Contact/ContactEdition.qml b/Linphone/view/Page/Form/Contact/ContactEdition.qml index 79513670..1817fa9f 100644 --- a/Linphone/view/Page/Form/Contact/ContactEdition.qml +++ b/Linphone/view/Page/Form/Contact/ContactEdition.qml @@ -25,6 +25,8 @@ MainRightPanel { property string title: qsTr("Modifier contact") property string saveButtonText: qsTr("Enregistrer") property string oldPictureUri + property int addressCount: 0 + signal closeEdition() Dialog { @@ -64,19 +66,21 @@ MainRightPanel { } ] - content: ColumnLayout { + content: ContactLayout { anchors.fill: parent - spacing : 0 - ColumnLayout { - spacing: 8 * DefaultStyle.dp - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 69 * DefaultStyle.dp - Avatar { - contact: mainItem.contact - Layout.preferredWidth: 72 * DefaultStyle.dp - Layout.preferredHeight: 72 * DefaultStyle.dp - Layout.alignment: Qt.AlignHCenter + contact: mainItem.contact + button.text: mainItem.saveButtonText + + button.onClicked: { + if (contact.core.givenName.length === 0 || (addressesList.count === 0 && phoneNumberList.count === 0)) { + if (contact.core.givenName.length === 0) givenName.errorMessage = qsTr("Veuillez saisir un prénom") + if (addressesList.count === 0 && phoneNumberList.count === 0) addressesErrorText.text = qsTr("Veuillez saisir une adresse ou un numéro de téléphone") + return } + mainItem.contact.core.save() + mainItem.closeEdition() + } + bannerContent: [ IconLabelButton { id: addPictureButton visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0 @@ -88,7 +92,7 @@ MainRightPanel { text: qsTr("Ajouter une image") KeyNavigation.down: editButton.visible ? editButton : givenNameEdit onClicked: fileDialog.open() - } + }, RowLayout { visible: mainItem.contact && mainItem.contact.core.pictureUri.length != 0 Layout.alignment: Qt.AlignHCenter @@ -100,7 +104,7 @@ MainRightPanel { iconSize: 17 * DefaultStyle.dp backgroundColor: "transparent" text: qsTr("Modifier") - KeyNavigation.down: givenNameEdit + KeyNavigation.right: removeButton onClicked: fileDialog.open() } FileDialog { @@ -122,35 +126,47 @@ MainRightPanel { iconSource: AppIcons.trashCan backgroundColor: "transparent" text: qsTr("Supprimer") - KeyNavigation.down: givenNameEdit + KeyNavigation.left: editButton onClicked: mainItem.contact.core.pictureUri = "" } - } - } - RowLayout { + }, + Item{Layout.fillWidth: true} + ] + content: Flickable { + id: editFlicakble Layout.fillHeight: true Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 63 * DefaultStyle.dp - Layout.bottomMargin: 78 * DefaultStyle.dp - spacing: 100 * DefaultStyle.dp - Flickable { - Layout.preferredWidth: contentWidth - Layout.fillHeight: true - Layout.leftMargin: 100 * DefaultStyle.dp - contentWidth: content.implicitWidth - contentHeight: content.height - clip: true + // width: parent.width + // height: parent.height + function ensureVisible(r) { + if (contentY >= r.y) + contentY = r.y; + else if (contentY+height <= r.y+r.height+content.spacing) + contentY = r.y+r.height-height; + } + ScrollBar.vertical: Control.ScrollBar { + } + ScrollBar.horizontal: Control.ScrollBar { + } + + RowLayout { + spacing: 100 * DefaultStyle.dp + // anchors.left: parent.left + // anchors.right: parent.right ColumnLayout { spacing: 20 * DefaultStyle.dp - anchors.fill: parent + Layout.fillWidth: true + Layout.fillHeight: true + FormItemLayout { id: givenName enableErrorText: true label: qsTr("Prénom") + Layout.fillWidth: true contentItem: TextField { id: givenNameEdit + Layout.fillWidth: true initialText: contact.core.givenName onTextEdited: contact.core.givenName = text backgroundColor: DefaultStyle.grey_0 @@ -202,44 +218,14 @@ MainRightPanel { } Item{Layout.fillHeight: true} } - } - Flickable { - id: addressesFlickable - Layout.preferredWidth: contentWidth - Layout.fillHeight: true - Layout.rightMargin: 76 * DefaultStyle.dp - contentWidth: content.implicitWidth - contentHeight: content.implicitHeight - clip: true - - flickableDirection: Flickable.VerticalFlick - function ensureVisible(r) - { - if (contentY >= r.y) - contentY = r.y; - else if (contentY+height <= r.y+r.height+content.spacing) - contentY = r.y+r.height-height; - } - - Control.ScrollBar.vertical: Control.ScrollBar{ - id: scrollbar - active: true - interactive: true - policy: Control.ScrollBar.AlwaysOff - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.leftMargin: 15 * DefaultStyle.dp - } - Control.ScrollBar.horizontal: Control.ScrollBar{ - visible: false - } ColumnLayout { - id: content - anchors.fill: parent spacing: 20 * DefaultStyle.dp + Layout.fillWidth: true + Layout.fillHeight: true Repeater { id: addressesList + Layout.fillWidth: true + onCountChanged: mainItem.addressCount = count model: VariantList { model: mainItem.contact && mainItem.contact.core.addresses || [] } @@ -296,7 +282,7 @@ MainRightPanel { } } RowLayout { - onYChanged: addressesFlickable.ensureVisible(this) + onYChanged: editFlicakble.ensureVisible(this) spacing: 10 * DefaultStyle.dp FormItemLayout { label: qsTr("Adresse SIP") @@ -387,7 +373,7 @@ MainRightPanel { } } RowLayout { - onYChanged: addressesFlickable.ensureVisible(this) + onYChanged: editFlicakble.ensureVisible(this) spacing: 10 * DefaultStyle.dp FormItemLayout { id: phoneNumberInput @@ -431,29 +417,8 @@ MainRightPanel { } } } - - Button { - id: saveButton - Layout.bottomMargin: 100 * DefaultStyle.dp - Layout.preferredWidth: 165 * DefaultStyle.dp - Layout.alignment: Qt.AlignHCenter - enabled: mainItem.contact && mainItem.contact.core.allAddresses.length > 0 - text: mainItem.saveButtonText - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - topPadding: 11 * DefaultStyle.dp - bottomPadding: 11 * DefaultStyle.dp - KeyNavigation.up: phoneNumberInputTextField - KeyNavigation.down: givenNameEdit - onClicked: { - if (givenNameEdit.text.length === 0 || (addressesList.count === 0 && phoneNumberList.count === 0)) { - if (givenNameEdit.text.length === 0) givenName.errorMessage = qsTr("Veuillez saisir un prénom") - if (addressesList.count === 0 && phoneNumberList.count === 0) addressesErrorText.text = qsTr("Veuillez saisir une adresse ou un numéro de téléphone") - return - } - mainItem.contact.core.save() - mainItem.closeEdition() - } - } + } + + } diff --git a/Linphone/view/Page/Form/Meeting/MeetingForm.qml b/Linphone/view/Page/Form/Meeting/MeetingForm.qml index fa7a2334..d97320f4 100644 --- a/Linphone/view/Page/Form/Meeting/MeetingForm.qml +++ b/Linphone/view/Page/Form/Meeting/MeetingForm.qml @@ -328,7 +328,7 @@ FocusScope { ] } Switch { - text: qsTr("Send invitation to participants") + text: qsTr("Envoyerune invitation aux participants") checked: mainItem.conferenceInfoGui.core.inviteEnabled onToggled: mainItem.conferenceInfoGui.core.inviteEnabled = checked } diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index b4b10a88..4f86374a 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -645,7 +645,7 @@ AbstractMainPage { objectName: "contactDetailComp" width: parent?.width height: parent?.height - ContactLayout { + CallHistoryLayout { id: contactDetail anchors.fill: parent anchors.topMargin: 45 * DefaultStyle.dp diff --git a/Linphone/view/Page/Main/Contact/ContactPage.qml b/Linphone/view/Page/Main/Contact/ContactPage.qml index f88a996e..00840556 100644 --- a/Linphone/view/Page/Main/Contact/ContactPage.qml +++ b/Linphone/view/Page/Main/Contact/ContactPage.qml @@ -73,83 +73,91 @@ AbstractMainPage { ) } - Popup { + Dialog { id: verifyDevicePopup property string deviceName property string deviceAddress padding: 30 * DefaultStyle.dp + width: 637 * DefaultStyle.dp anchors.centerIn: parent closePolicy: Control.Popup.CloseOnEscape modal: true onAboutToHide: neverDisplayAgainCheckbox.checked = false - contentItem: ColumnLayout { - spacing: 45 * DefaultStyle.dp - ColumnLayout { - spacing: 10 * DefaultStyle.dp - Text { - text: qsTr("Augmenter la confiance") - font { - pixelSize: 22 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - } + title: qsTr("Augmenter la confiance") + text: qsTr("Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.

Vous êtes sur le point d’appeler “%1” voulez vous continuer ?").arg(verifyDevicePopup.deviceName) + buttons: RowLayout { + RowLayout { + spacing: 7 * DefaultStyle.dp + CheckBox{ + id: neverDisplayAgainCheckbox } - ColumnLayout { - spacing: 24 * DefaultStyle.dp - Text { - Layout.preferredWidth: 529 * DefaultStyle.dp - text: qsTr("Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.") - font.pixelSize: 14 * DefaultStyle.dp - } - Text { - Layout.preferredWidth: 529 * DefaultStyle.dp - text: qsTr("Vous êtes sur le point d’appeler “%1” voulez vous continuer ?").arg(verifyDevicePopup.deviceName) - font.pixelSize: 14 * DefaultStyle.dp + Text { + text: qsTr("Ne plus afficher") + font.pixelSize: 14 * DefaultStyle.dp + MouseArea { + anchors.fill: parent + onClicked: neverDisplayAgainCheckbox.toggle() } } } + Item{Layout.fillWidth: true} RowLayout { - RowLayout { - spacing: 7 * DefaultStyle.dp - CheckBox{ - id: neverDisplayAgainCheckbox - } - Text { - text: qsTr("Ne plus afficher") - font.pixelSize: 14 * DefaultStyle.dp - MouseArea { - anchors.fill: parent - onClicked: neverDisplayAgainCheckbox.toggle() - } - } + spacing: 15 * DefaultStyle.dp + Button { + inversedColors: true + text: qsTr("Annuler") + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp + onClicked: verifyDevicePopup.close() } - Item{Layout.fillWidth: true} - RowLayout { - spacing: 15 * DefaultStyle.dp - Button { - inversedColors: true - text: qsTr("Annuler") - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - topPadding: 11 * DefaultStyle.dp - bottomPadding: 11 * DefaultStyle.dp + Button { + text: qsTr("Appeler") + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp + onClicked: { + SettingsCpp.setDisplayDeviceCheckConfirmation(!neverDisplayAgainCheckbox.checked) + UtilsCpp.createCall(verifyDevicePopup.deviceAddress, {}, LinphoneEnums.MediaEncryption.Zrtp) onClicked: verifyDevicePopup.close() } - Button { - text: qsTr("Appeler") - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - topPadding: 11 * DefaultStyle.dp - bottomPadding: 11 * DefaultStyle.dp - onClicked: { - SettingsCpp.setDisplayDeviceCheckConfirmation(!neverDisplayAgainCheckbox.checked) - UtilsCpp.createCall(verifyDevicePopup.deviceAddress, {}, LinphoneEnums.MediaEncryption.Zrtp) - onClicked: verifyDevicePopup.close() - } - } } } } } + Dialog { + id: trustInfoDialog + width: 637 * DefaultStyle.dp + title: qsTr("Niveau de confiance") + text: qsTr("Vérifiez les appareils de votre contact pour confirmer que vos communications seront sécurisées et sans compromission.
Quand tous seront vérifiés, vous atteindrez le niveau de confiance maximal.") + content: RowLayout { + spacing: 50 * DefaultStyle.dp + Avatar { + _address: "sip:a.c@sip.linphone.org" + Layout.preferredWidth: 45 * DefaultStyle.dp + Layout.preferredHeight: 45 * DefaultStyle.dp + } + EffectImage { + imageSource: AppIcons.arrowRight + Layout.preferredWidth: 45 * DefaultStyle.dp + Layout.preferredHeight: 45 * DefaultStyle.dp + } + Avatar { + _address: "sip:a.c@sip.linphone.org" + secured: true + Layout.preferredWidth: 45 * DefaultStyle.dp + Layout.preferredHeight: 45 * DefaultStyle.dp + } + } + buttons: Button { + text: qsTr("Ok") + leftPadding: 30 * DefaultStyle.dp + rightPadding: 30 * DefaultStyle.dp + onClicked: trustInfoDialog.close() + } + } leftPanelContent: FocusScope { id: leftPanel @@ -178,6 +186,7 @@ AbstractMainPage { } Button { id: createContactButton + visible: !rightPanelStackView.currentItem || rightPanelStackView.currentItem.objectName !== "contactEdition" background: Item { } icon.source: AppIcons.plusCircle @@ -372,56 +381,193 @@ AbstractMainPage { width: parent?.width height: parent?.height property string objectName: "contactDetail" - Control.StackView.onActivated: mainItem.leftPanelEnabled = true - Control.StackView.onDeactivated: mainItem.leftPanelEnabled = false - RowLayout { - visible: mainItem.selectedContact != undefined - anchors.fill: parent - anchors.topMargin: 45 * DefaultStyle.dp - anchors.bottomMargin: 23 * DefaultStyle.dp - ContactLayout { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - contact: mainItem.selectedContact - Layout.preferredWidth: 360 * DefaultStyle.dp - buttonContent: Button { - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + component ContactDetailLayout: ColumnLayout { + id: contactDetailLayout + spacing: 15 * DefaultStyle.dp + property string label + property var icon + property alias content: contentControl.contentItem + signal titleIconClicked() + RowLayout { + spacing: 10 * DefaultStyle.dp + Text { + text: contactDetailLayout.label + color: DefaultStyle.main1_500_main + font { + pixelSize: 16 * DefaultStyle.dp + weight: 800 * DefaultStyle.dp + } + } + Button { + visible: contactDetailLayout.icon != undefined + icon.source: contactDetailLayout.icon + contentImageColor: DefaultStyle.main1_500_main + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + background: Item{} + onClicked: contactDetailLayout.titleIconClicked() + } + Item{Layout.fillWidth: true} + Button { + id: expandButton + background: Item{} + checkable: true + checked: true + icon.source: checked ? AppIcons.upArrow : AppIcons.downArrow + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp icon.height: 24 * DefaultStyle.dp - background: Item{} - onClicked: mainItem.editContact(mainItem.selectedContact) - icon.source: AppIcons.pencil - visible: !mainItem.selectedContact?.core.readOnly + contentImageColor: DefaultStyle.main2_600 + KeyNavigation.down: contentControl } - detailContent: ColumnLayout { - Layout.fillWidth: false - Layout.preferredWidth: 360 * DefaultStyle.dp - spacing: 32 * DefaultStyle.dp - ColumnLayout { - spacing: 9 * DefaultStyle.dp - Text { - Layout.leftMargin: 10 * DefaultStyle.dp - text: qsTr("Informations") - font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - } + } + RoundedPane { + id: contentControl + visible: expandButton.checked + Layout.fillWidth: true + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 17 * DefaultStyle.dp + bottomPadding: 17 * DefaultStyle.dp + } + } + ContactLayout { + id: contactDetail + anchors.fill: parent + contact: mainItem.selectedContact + button.color: DefaultStyle.main1_100 + button.text: qsTr("Modifier") + button.icon.source: AppIcons.pencil + button.textColor: DefaultStyle.main1_500_main + button.contentImageColor: DefaultStyle.main1_500_main + button.leftPadding: 16 * DefaultStyle.dp + button.rightPadding: 16 * DefaultStyle.dp + button.topPadding: 10 * DefaultStyle.dp + button.bottomPadding: 10 * DefaultStyle.dp + button.onClicked: mainItem.editContact(mainItem.selectedContact) + property string contactAddress: contact ? contact.core.defaultAddress : "" + property var computedContactNameObj: UtilsCpp.getDisplayName(contactAddress) + property string computedContactName: computedContactNameObj ? computedContactNameObj.value : "" + property string contactName: contact + ? contact.core.displayName + : computedContactName + component LabelButton: ColumnLayout { + id: labelButton + // property alias image: buttonImg + property alias button: button + property string label + spacing: 8 * DefaultStyle.dp + Button { + id: button + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: 56 * DefaultStyle.dp + Layout.preferredHeight: 56 * DefaultStyle.dp + topPadding: 16 * DefaultStyle.dp + bottomPadding: 16 * DefaultStyle.dp + leftPadding: 16 * DefaultStyle.dp + rightPadding: 16 * DefaultStyle.dp + contentImageColor: DefaultStyle.main2_600 + background: Rectangle { + anchors.fill: parent + radius: 40 * DefaultStyle.dp + color: DefaultStyle.main2_200 + } + } + Text { + Layout.alignment: Qt.AlignHCenter + text: labelButton.label + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + } + } + } + bannerContent: [ + ColumnLayout { + spacing: 0 + Text { + text: contactDetail.contactName + font { + pixelSize: 29 * DefaultStyle.dp + weight: 800 * DefaultStyle.dp } - - RoundedPane { - Layout.preferredHeight: Math.min(226 * DefaultStyle.dp, addrList.contentHeight + topPadding + bottomPadding) - height: Math.min(226 * DefaultStyle.dp, addrList.contentHeight) + } + Text { + visible: contactDetail.contact + property var mode : contactDetail.contact ? contactDetail.contact.core.consolidatedPresence : -1 + horizontalAlignment: Text.AlignLeft + Layout.fillWidth: true + text: mode === LinphoneEnums.ConsolidatedPresence.Online + ? qsTr("En ligne") + : mode === LinphoneEnums.ConsolidatedPresence.Busy + ? qsTr("Occupé") + : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb + ? qsTr("Ne pas déranger") + : qsTr("Hors ligne") + color: mode === LinphoneEnums.ConsolidatedPresence.Online + ? DefaultStyle.success_500main + : mode === LinphoneEnums.ConsolidatedPresence.Busy + ? DefaultStyle.warning_600 + : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb + ? DefaultStyle.danger_500main + : DefaultStyle.main2_500main + font.pixelSize: 14 * DefaultStyle.dp + } + }, + Item{Layout.fillWidth: true}, + RowLayout { + spacing: 58 * DefaultStyle.dp + LabelButton { + button.icon.source: AppIcons.phone + label: qsTr("Appel") + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, false, mainItem) + } + LabelButton { + button.icon.source: AppIcons.chatTeardropText + visible: !SettingsCpp.disableChatFeature + label: qsTr("Message") + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation") + } + LabelButton { + button.icon.source: AppIcons.videoCamera + label: qsTr("Appel vidéo") + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, true, mainItem) + } + } + ] + content: Flickable { + Layout.fillWidth: true + Layout.fillHeight: true + contentWidth: parent.width + ColumnLayout { + spacing: 32 * DefaultStyle.dp + anchors.left: parent.left + anchors.right: parent.right + ColumnLayout { + spacing: 15 * DefaultStyle.dp + Layout.fillWidth: true + ContactDetailLayout { + id: infoLayout Layout.fillWidth: true - topPadding: 12 * DefaultStyle.dp - bottomPadding: 12 * DefaultStyle.dp - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - contentItem: ListView { + label: qsTr("Informations") + content: ListView { id: addrList - width: 360 * DefaultStyle.dp height: contentHeight + implicitHeight: contentHeight + width: parent.width clip: true spacing: 9 * DefaultStyle.dp model: VariantList { @@ -491,108 +637,96 @@ AbstractMainPage { } } } - } - RoundedPane { - visible: companyText.text.length != 0 || jobText.text.length != 0 - Layout.fillWidth: true - topPadding: 17 * DefaultStyle.dp - bottomPadding: 17 * DefaultStyle.dp - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - // Layout.fillHeight: true + RoundedPane { + visible: infoLayout.visible && companyText.text.length != 0 || jobText.text.length != 0 + Layout.fillWidth: true + topPadding: 17 * DefaultStyle.dp + bottomPadding: 17 * DefaultStyle.dp + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp - contentItem: ColumnLayout { - // height: 100 * DefaultStyle.dp - RowLayout { - height: 50 * DefaultStyle.dp - Text { - text: qsTr("Company :") - font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp - } - } - Text { - id: companyText - text: mainItem.selectedContact && mainItem.selectedContact.core.organization - font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - } - } - } - RowLayout { - height: 50 * DefaultStyle.dp - Text { - text: qsTr("Job :") - font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp - } - } - Text { - id: jobText - text: mainItem.selectedContact && mainItem.selectedContact.core.job - font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - } - } - } - } - ColumnLayout { - visible: false - Text { - text: qsTr("Medias") - font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - } - } - Button { - Rectangle { - anchors.fill: parent - color: DefaultStyle.grey_0 - radius: 15 * DefaultStyle.dp - } - contentItem: RowLayout { - Image { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - source: AppIcons.shareNetwork + contentItem: ColumnLayout { + RowLayout { + height: 50 * DefaultStyle.dp + visible: companyText.text.length != 0 + Text { + text: qsTr("Company :") + font { + pixelSize: 13 * DefaultStyle.dp + weight: 700 * DefaultStyle.dp + } } Text { - text: qsTr("Show media shared") + id: companyText + text: mainItem.selectedContact && mainItem.selectedContact.core.organization + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + } + } + } + RowLayout { + height: 50 * DefaultStyle.dp + visible: jobText.text.length != 0 + Text { + text: qsTr("Job :") + font { + pixelSize: 13 * DefaultStyle.dp + weight: 700 * DefaultStyle.dp + } + } + Text { + id: jobText + text: mainItem.selectedContact && mainItem.selectedContact.core.job font { pixelSize: 14 * DefaultStyle.dp weight: 400 * DefaultStyle.dp } } } - onClicked: console.debug("TODO : go to shared media") } } } - } - } - ColumnLayout { - spacing: 10 * DefaultStyle.dp - Layout.rightMargin: 90 * DefaultStyle.dp - ColumnLayout { - RowLayout { - Text { - text: qsTr("Confiance") - Layout.leftMargin: 10 * DefaultStyle.dp - font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + ContactDetailLayout { + visible: !SettingsCpp.disableChatFeature + label: qsTr("Medias") + Layout.fillWidth: true + content: Button { + background: Rectangle { + anchors.fill: parent + color: DefaultStyle.grey_0 + radius: 15 * DefaultStyle.dp } + contentItem: RowLayout { + Image { + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + source: AppIcons.shareNetwork + } + Text { + text: qsTr("Show media shared") + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + } + } + Item{Layout.fillWidth: true} + EffectImage { + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + imageSource: AppIcons.rightArrow + colorizationColor: DefaultStyle.main2_600 + } + } + onClicked: console.debug("TODO : go to shared media") } } - RoundedPane { - Layout.preferredWidth: 360 * DefaultStyle.dp - bottomPadding: 21 * DefaultStyle.dp - contentItem: ColumnLayout { + ContactDetailLayout { + Layout.fillWidth: true + label: qsTr("Confiance") + icon: AppIcons.question + onTitleIconClicked: trustInfoDialog.open() + content: ColumnLayout { spacing: 13 * DefaultStyle.dp Text { text: qsTr("Niveau de confiance - Appareils vérifiés") @@ -607,7 +741,7 @@ AbstractMainPage { } ProgressBar { visible: deviceList.count > 0 - Layout.preferredWidth: 320 * DefaultStyle.dp + Layout.fillWidth: true Layout.preferredHeight: 28 * DefaultStyle.dp value: mainItem.selectedContact ? mainItem.selectedContact.core.verifiedDeviceCount / deviceList.count : 0 } @@ -648,10 +782,10 @@ AbstractMainPage { textColor: DefaultStyle.main1_500_main textSize: 13 * DefaultStyle.dp text: qsTr("Vérifier") - leftPadding: 12 * DefaultStyle.dp - rightPadding: 12 * DefaultStyle.dp - topPadding: 6 * DefaultStyle.dp - bottomPadding: 6 * DefaultStyle.dp + // leftPadding: 12 * DefaultStyle.dp + // rightPadding: 12 * DefaultStyle.dp + // topPadding: 6 * DefaultStyle.dp + // bottomPadding: 6 * DefaultStyle.dp onClicked: { if (SettingsCpp.getDisplayDeviceCheckConfirmation()) { verifyDevicePopup.deviceName = deviceDelegate.deviceName @@ -668,62 +802,40 @@ AbstractMainPage { } } } - } - ColumnLayout { - spacing: 9 * DefaultStyle.dp - Text { - Layout.preferredHeight: 22 * DefaultStyle.dp - Layout.leftMargin: 10 * DefaultStyle.dp - text: qsTr("Other actions") - font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - } - } - RoundedPane { - Layout.preferredWidth: 360 * DefaultStyle.dp - contentItem: ColumnLayout { + ContactDetailLayout { + Layout.fillWidth: true + label: qsTr("Autres actions") + content: ColumnLayout { width: parent.width - IconLabelButton { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 50 * DefaultStyle.dp iconSize: 24 * DefaultStyle.dp iconSource: AppIcons.pencil - text: qsTr("Edit") + text: qsTr("Éditer") onClicked: mainItem.editContact(mainItem.selectedContact) visible: !mainItem.selectedContact?.core.readOnly } Rectangle { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 1 * DefaultStyle.dp color: DefaultStyle.main2_200 } IconLabelButton { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 50 * DefaultStyle.dp iconSize: 24 * DefaultStyle.dp iconSource: mainItem.selectedContact && mainItem.selectedContact.core.starred ? AppIcons.heartFill : AppIcons.heart - text: mainItem.selectedContact && mainItem.selectedContact.core.starred ? qsTr("Remove from favorites") : qsTr("Add to favorites") + text: mainItem.selectedContact && mainItem.selectedContact.core.starred ? qsTr("Retirer des favoris") : qsTr("Ajouter aux favoris") onClicked: if (mainItem.selectedContact) mainItem.selectedContact.core.lSetStarred(!mainItem.selectedContact.core.starred) } Rectangle { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 1 * DefaultStyle.dp color: DefaultStyle.main2_200 } IconLabelButton { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 50 * DefaultStyle.dp iconSize: 24 * DefaultStyle.dp iconSource: AppIcons.shareNetwork @@ -741,60 +853,52 @@ AbstractMainPage { } Rectangle { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 1 * DefaultStyle.dp color: DefaultStyle.main2_200 } IconLabelButton { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 50 * DefaultStyle.dp iconSize: 24 * DefaultStyle.dp iconSource: AppIcons.bellSlash - text: qsTr("Mute") + text: qsTr("Mettre en sourdine") onClicked: console.log("TODO : mute contact") } Rectangle { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 1 * DefaultStyle.dp color: DefaultStyle.main2_200 } IconLabelButton { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 50 * DefaultStyle.dp iconSize: 24 * DefaultStyle.dp iconSource: AppIcons.empty - text: qsTr("Block") + text: qsTr("Bloquer") onClicked: console.log("TODO : block contact") } Rectangle { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 1 * DefaultStyle.dp color: DefaultStyle.main2_200 } IconLabelButton { Layout.fillWidth: true - Layout.leftMargin: 15 * DefaultStyle.dp - Layout.rightMargin: 15 * DefaultStyle.dp Layout.preferredHeight: 50 * DefaultStyle.dp iconSize: 24 * DefaultStyle.dp iconSource: AppIcons.trashCan color: DefaultStyle.danger_500main - text: qsTr("Delete this contact") + text: qsTr("Supprimer ce contact") visible: !mainItem.selectedContact?.core.readOnly onClicked: { mainItem.deleteContact(contact) } } } + + } + Item{ + Layout.fillHeight: true } } } @@ -805,9 +909,9 @@ AbstractMainPage { Component { id: contactEdition ContactEdition { - width: rightPanelStackView.width - height: rightPanelStackView.height property string objectName: "contactEdition" + Control.StackView.onActivated: mainItem.leftPanelEnabled = false + Control.StackView.onDeactivated: mainItem.leftPanelEnabled = true onCloseEdition: { if (rightPanelStackView.depth <= 1) rightPanelStackView.clear() else rightPanelStackView.pop(Control.StackView.Immediate) diff --git a/Linphone/view/Page/Window/AbstractWindow.qml b/Linphone/view/Page/Window/AbstractWindow.qml index e7f71c21..f31f669f 100644 --- a/Linphone/view/Page/Window/AbstractWindow.qml +++ b/Linphone/view/Page/Window/AbstractWindow.qml @@ -62,15 +62,17 @@ ApplicationWindow { contentItem: ColumnLayout { spacing: 16 * DefaultStyle.dp RowLayout { - spacing: 0 + spacing: 5 * DefaultStyle.dp + width: startCallPopup.width Text { - text: qsTr("Which channel do you choose?") + text: qsTr("Quelle addresse souhaitez-vous appeler ?") + wrapMode: Text.Wrap + Layout.fillWidth: true font { pixelSize: 16 * DefaultStyle.dp weight: 800 * DefaultStyle.dp } } - Item{Layout.fillWidth: true} Button { Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp diff --git a/Linphone/view/Style/AppIcons.qml b/Linphone/view/Style/AppIcons.qml index af476eee..0576ef44 100644 --- a/Linphone/view/Style/AppIcons.qml +++ b/Linphone/view/Style/AppIcons.qml @@ -57,6 +57,7 @@ QtObject { property string backspaceFill: "image://internal/backspace-fill.svg" property string closeX: "image://internal/x.svg" property string arrowDownLeft: "image://internal/arrow-down-left.svg" + property string arrowRight: "image://internal/arrow-right.svg" property string arrowUpRight: "image://internal/arrow-up-right.svg" property string arrowElbow: "image://internal/arrow-elbow-left.svg" property string microphone: "image://internal/microphone.svg"