From e8845e271d6b7c0e4121ee8af5ab8a2f316e7646 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 26 Jun 2024 17:25:22 +0200 Subject: [PATCH] FIXES : fix delete history restore last active tab on launch fix #LINQT-1246 barre de scroll horizontale fix call notif ui + main window coordinates blason bleu confiance 100% fix contact searchbar fix contact scrollbar fix zrtp incoming call remove shadow effect not in mockup --- Linphone/core/setting/SettingsCore.cpp | 13 + Linphone/core/setting/SettingsCore.hpp | 6 + Linphone/view/App/AppWindow.qml | 2 + Linphone/view/App/CallsWindow.qml | 13 +- Linphone/view/App/Layout/MainLayout.qml | 2 + Linphone/view/Item/Call/CallContactsLists.qml | 2 +- Linphone/view/Item/Contact/Avatar.qml | 69 +++-- Linphone/view/Item/Contact/ContactsList.qml | 1 + Linphone/view/Item/Dialog.qml | 44 +-- Linphone/view/Item/MasterDetailFamily.qml | 22 +- .../Notification/NotificationReceivedCall.qml | 155 +++++----- .../view/Layout/Contact/ContactLayout.qml | 126 ++++---- Linphone/view/Page/Main/CallPage.qml | 6 + Linphone/view/Page/Main/ContactPage.qml | 277 +++++++++--------- Linphone/view/Style/DefaultStyle.qml | 1 + 15 files changed, 378 insertions(+), 361 deletions(-) diff --git a/Linphone/core/setting/SettingsCore.cpp b/Linphone/core/setting/SettingsCore.cpp index 6b44e85dc..58ee7ef4a 100644 --- a/Linphone/core/setting/SettingsCore.cpp +++ b/Linphone/core/setting/SettingsCore.cpp @@ -362,6 +362,19 @@ void Settings::setFirstLaunch(bool first) { } } +void Settings::setLastActiveTabIndex(int index) { + auto lastActiveIndex = getLastActiveTabIndex(); + if (lastActiveIndex != index) { + mAppSettings.setValue("lastActiveTabIndex", index); + mAppSettings.sync(); + emit lastActiveTabIndexChanged(); + } +} + +int Settings::getLastActiveTabIndex() { + return mAppSettings.value("lastActiveTabIndex", 1).toInt(); +} + void Settings::setDisplayDeviceCheckConfirmation(bool display) { if (getDisplayDeviceCheckConfirmation() != display) { mAppSettings.setValue("displayDeviceCheckConfirmation", display); diff --git a/Linphone/core/setting/SettingsCore.hpp b/Linphone/core/setting/SettingsCore.hpp index 69866b5f7..72893a3cb 100644 --- a/Linphone/core/setting/SettingsCore.hpp +++ b/Linphone/core/setting/SettingsCore.hpp @@ -81,6 +81,10 @@ public: Q_INVOKABLE void setDisplayDeviceCheckConfirmation(bool display); Q_INVOKABLE bool getDisplayDeviceCheckConfirmation() const; + // Used to restore the last active index on launch + Q_INVOKABLE void setLastActiveTabIndex(int index); + Q_INVOKABLE int getLastActiveTabIndex(); + // Security. -------------------------------------------------------------------- bool getVfsEnabled() { return mVfsEnabled; @@ -198,6 +202,8 @@ signals: void firstLaunchChanged(bool firstLaunch); void showVerifyDeviceConfirmationChanged(bool showVerifyDeviceConfirmation); + void lastActiveTabIndexChanged(); + private: std::shared_ptr mSettingsModel; diff --git a/Linphone/view/App/AppWindow.qml b/Linphone/view/App/AppWindow.qml index 0fc564ee4..5b8c787bc 100644 --- a/Linphone/view/App/AppWindow.qml +++ b/Linphone/view/App/AppWindow.qml @@ -7,6 +7,8 @@ import SettingsCpp 1.0 ApplicationWindow { id: mainWindow + x: 0 + y: 0 width: Math.min(1512 * DefaultStyle.dp, Screen.desktopAvailableWidth) height: Math.min(982 * DefaultStyle.dp, Screen.desktopAvailableHeight) diff --git a/Linphone/view/App/CallsWindow.qml b/Linphone/view/App/CallsWindow.qml index 463dda462..68945fad3 100644 --- a/Linphone/view/App/CallsWindow.qml +++ b/Linphone/view/App/CallsWindow.qml @@ -24,8 +24,8 @@ AppWindow { property var transferState: call && call.core.transferState onCallStateChanged: { - if (callState === LinphoneEnums.CallState.Connected) { - if (middleItemStackView.currentItem != inCallItem) { + if (callState === LinphoneEnums.CallState.Connected || callState === LinphoneEnums.CallState.StreamsRunning) { + if (middleItemStackView.currentItem.objectName != inCallItem) { middleItemStackView.replace(inCallItem) bottomButtonsLayout.visible = true } @@ -123,13 +123,7 @@ AppWindow { } } } - - Component.onCompleted: { - if(call && call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp && (!call.core.tokenVerified || call.core.isMismatch)) { - zrtpValidation.open() - } - } - + Timer { id: autoCloseWindow interval: 2000 @@ -480,7 +474,6 @@ AppWindow { initialItem: inCallItem Layout.fillWidth: true Layout.fillHeight: true - } OngoingCallRightPanel { id: rightPanel diff --git a/Linphone/view/App/Layout/MainLayout.qml b/Linphone/view/App/Layout/MainLayout.qml index 8f76a6d4c..8d76da0d9 100644 --- a/Linphone/view/App/Layout/MainLayout.qml +++ b/Linphone/view/App/Layout/MainLayout.qml @@ -108,6 +108,7 @@ Item { Layout.preferredWidth: 82 * DefaultStyle.dp defaultAccount: accountProxy.defaultAccount property int unreadMessages: defaultAccount.core.unreadMessageNotifications + currentIndex: SettingsCpp.getLastActiveTabIndex() model: [ {icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")}, {icon: AppIcons.adressBook, selectedIcon: AppIcons.adressBookSelected, label: qsTr("Contacts")}, @@ -115,6 +116,7 @@ Item { {icon: AppIcons.videoconference, selectedIcon: AppIcons.videoconferenceSelected, label: qsTr("Réunions"), visible: !SettingsCpp.disableMeetingsFeature} ] onCurrentIndexChanged: { + SettingsCpp.setLastActiveTabIndex(currentIndex) if (currentIndex === 0) accountProxy.defaultAccount.core.lResetMissedCalls() if (mainItem.contextualMenuOpenedComponent) { closeContextualMenuComponent() diff --git a/Linphone/view/Item/Call/CallContactsLists.qml b/Linphone/view/Item/Call/CallContactsLists.qml index 1a89d3e26..c81819b72 100644 --- a/Linphone/view/Item/Call/CallContactsLists.qml +++ b/Linphone/view/Item/Call/CallContactsLists.qml @@ -42,7 +42,7 @@ FocusScope { numericPad: mainItem.numPad KeyNavigation.down: grouCallButton } - Control.ScrollView { + Flickable { Layout.fillWidth: true Layout.fillHeight: true Layout.topMargin: 25 * DefaultStyle.dp diff --git a/Linphone/view/Item/Contact/Avatar.qml b/Linphone/view/Item/Contact/Avatar.qml index 6c3366262..e643265c7 100644 --- a/Linphone/view/Item/Contact/Avatar.qml +++ b/Linphone/view/Item/Contact/Avatar.qml @@ -33,7 +33,9 @@ StackView { onHaveAvatarChanged: replace(haveAvatar ? avatar : initials, StackView.Immediate) - property bool secured: false + property bool secured: contact + ? contact.core.devices.length != 0 && contact.core.verifiedDeviceCount === contact.core.devices.length + : false property bool displayPresence: (account || contact) && (account ? account.core.registrationState != LinphoneEnums.RegistrationState.Progress && account.core.registrationState != LinphoneEnums.RegistrationState.Refreshing : contact.core.consolidatedPresence != LinphoneEnums.ConsolidatedPresence.Offline) @@ -66,8 +68,9 @@ StackView { width: mainItem.width/4.5 height: width radius: width / 2 - x: 2 * mainItem.width / 3 - y: 6 * mainItem.height / 7 + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.rightMargin: mainItem.width / 15 z: 1 color: account ? account.core.registrationState == LinphoneEnums.RegistrationState.Ok @@ -93,33 +96,47 @@ StackView { } Component{ id: initials - Rectangle { - id: initialItem - property string initials: UtilsCpp.getInitials(mainItem.displayNameVal) - radius: width / 2 - color: DefaultStyle.main2_200 + Item { + id: avatarItem height: mainItem.height width: height - Text { - anchors.fill: parent - anchors.centerIn: parent - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - text: initialItem.initials - font { - pixelSize: initialItem.height * 36 / 120 - weight: 800 * DefaultStyle.dp - capitalization: Font.AllUppercase + Rectangle { + id: initialItem + property string initials: UtilsCpp.getInitials(mainItem.displayNameVal) + radius: width / 2 + color: DefaultStyle.main2_200 + height: mainItem.height + width: height + Text { + anchors.fill: parent + anchors.centerIn: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + text: initialItem.initials + font { + pixelSize: initialItem.height * 36 / 120 + weight: 800 * DefaultStyle.dp + capitalization: Font.AllUppercase + } + } + Image { + id: initialImg + visible: initialItem.initials == '' + width: mainItem.width/3 + height: width + source: AppIcons.profile + sourceSize.width: width + sourceSize.height: height + anchors.centerIn: parent } } - Image { - visible: initialItem.initials == '' - width: mainItem.width/3 - height: width - source: AppIcons.profile - sourceSize.width: width - sourceSize.height: height - anchors.centerIn: parent + MultiEffect { + source: initialItem + anchors.fill: initialItem + shadowEnabled: true + shadowBlur: 1 + shadowColor: DefaultStyle.grey_1000 + shadowOpacity: 0.1 } } } diff --git a/Linphone/view/Item/Contact/ContactsList.qml b/Linphone/view/Item/Contact/ContactsList.qml index ad5795ec9..55e0c219b 100644 --- a/Linphone/view/Item/Contact/ContactsList.qml +++ b/Linphone/view/Item/Contact/ContactsList.qml @@ -168,6 +168,7 @@ ListView { id: actionsRow z: 1 anchors.right: parent.right + anchors.rightMargin: 5 * DefaultStyle.dp anchors.verticalCenter: parent.verticalCenter spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready RowLayout{ diff --git a/Linphone/view/Item/Dialog.qml b/Linphone/view/Item/Dialog.qml index 6eb0cd3d7..7c597c091 100644 --- a/Linphone/view/Item/Dialog.qml +++ b/Linphone/view/Item/Dialog.qml @@ -13,13 +13,13 @@ Popup { leftPadding: 10 * DefaultStyle.dp topPadding: 10 * DefaultStyle.dp bottomPadding: 10 * DefaultStyle.dp + underlineColor: DefaultStyle.main1_500_main property int radius: 16 * DefaultStyle.dp - property color underlineColor: DefaultStyle.main1_500_main - property alias buttons: buttonsLayout.data - property alias content: contentLayout.data property string title property string text property string details + property alias content: contentLayout.data + property alias buttons: buttonsLayout.data property alias firstButton: firstButtonId property alias secondButton: secondButtonId property bool firstButtonAccept: true @@ -27,40 +27,10 @@ Popup { signal accepted() signal rejected() - - background: Item { - anchors.fill: parent - Rectangle { - visible: mainItem.underlineColor != undefined - width: mainItem.width - x: backgroundItem.x - y: backgroundItem.y - height: backgroundItem.height + 2 * DefaultStyle.dp - color: mainItem.underlineColor - radius: mainItem.radius - } - Rectangle { - id: backgroundItem - anchors.fill: parent - width: mainItem.width - height: mainItem.implicitHeight - radius: mainItem.radius - color: DefaultStyle.grey_0 - border.color: DefaultStyle.grey_0 - } - MultiEffect { - anchors.fill: backgroundItem - source: backgroundItem - shadowEnabled: true - shadowColor: DefaultStyle.grey_900 - shadowBlur: 1.0 - shadowOpacity: 0.1 - } - } contentItem: FocusScope{ - height: contentLayout.implicitHeight - width: contentLayout.implicitWidth + height: child.implicitHeight + width: child.implicitWidth onVisibleChanged: { if(visible) forceActiveFocus() } @@ -71,8 +41,9 @@ Popup { } } ColumnLayout { + id: child anchors.fill: parent - spacing: 20 * DefaultStyle.dp + spacing: 15 * DefaultStyle.dp Text{ id: titleText Layout.fillWidth: true @@ -96,7 +67,6 @@ Popup { id: defaultText visible: text.length != 0 Layout.fillWidth: true - //Layout.preferredWidth: 278 * DefaultStyle.dp Layout.alignment: Qt.AlignCenter text: mainItem.text font { diff --git a/Linphone/view/Item/MasterDetailFamily.qml b/Linphone/view/Item/MasterDetailFamily.qml index 7c97a4c7c..2e2ef2b7d 100644 --- a/Linphone/view/Item/MasterDetailFamily.qml +++ b/Linphone/view/Item/MasterDetailFamily.qml @@ -41,17 +41,17 @@ Item { height: 50 * DefaultStyle.dp visible: parent.containsMouse || isSelected } - MultiEffect { - enabled: mainItem.shadowEnabled - anchors.fill: background - source: background - visible: mainItem.shadowEnabled - // Crash : https://bugreports.qt.io/browse/QTBUG-124730 - shadowEnabled: true //mainItem.shadowEnabled - shadowColor: DefaultStyle.grey_1000 - shadowBlur: 1 - shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0 - } + // MultiEffect { + // enabled: mainItem.shadowEnabled + // anchors.fill: background + // source: background + // visible: mainItem.shadowEnabled + // // Crash : https://bugreports.qt.io/browse/QTBUG-124730 + // shadowEnabled: true //mainItem.shadowEnabled + // shadowColor: DefaultStyle.grey_1000 + // shadowBlur: 1 + // shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0 + // } onClicked: { mainItem.selected() } diff --git a/Linphone/view/Item/Notification/NotificationReceivedCall.qml b/Linphone/view/Item/Notification/NotificationReceivedCall.qml index 4a4bd6d7b..3eb6aa19d 100644 --- a/Linphone/view/Item/Notification/NotificationReceivedCall.qml +++ b/Linphone/view/Item/Notification/NotificationReceivedCall.qml @@ -7,9 +7,8 @@ import UtilsCpp Notification { id: mainItem radius: 20 * DefaultStyle.dp - overriddenHeight: 101 * DefaultStyle.dp - overriddenWidth: 422 * DefaultStyle.dp - + overriddenWidth: content.implicitWidth//101 * DefaultStyle.dp + overriddenHeight: content.implicitHeight//422 * DefaultStyle.dp readonly property var call: notificationData && notificationData.call property var state: call.core.state onStateChanged:{ @@ -18,86 +17,96 @@ Notification { } } - RowLayout { - anchors.fill: parent - anchors.leftMargin: 19 * DefaultStyle.dp - anchors.rightMargin: 19 * DefaultStyle.dp - anchors.bottomMargin: 15 * DefaultStyle.dp - anchors.topMargin: 15 * DefaultStyle.dp - spacing: 30 * DefaultStyle.dp - RowLayout { - Layout.fillWidth: true - Layout.alignment: Qt.AlignLeft - spacing: 13 * DefaultStyle.dp - Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp - call: mainItem.call - } - ColumnLayout { - Text { - property var remoteAddress: UtilsCpp.getDisplayName(call.core.peerAddress) - text: remoteAddress ? remoteAddress.value : "" - color: DefaultStyle.grey_600 - font { - pixelSize: 20 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - capitalization: Font.Capitalize - } + Popup { + id: content + visible: mainItem.visible + leftPadding: 19 * DefaultStyle.dp + rightPadding: 19 * DefaultStyle.dp + topPadding: 15 * DefaultStyle.dp + bottomPadding: 15 * DefaultStyle.dp + background: Item{} + contentItem: RowLayout { + id: notifContent + + spacing: 30 * DefaultStyle.dp + height: childrenRect.height + width: childrenRect.width + RowLayout { + Layout.fillWidth: true + Layout.alignment: Qt.AlignLeft + spacing: 13 * DefaultStyle.dp + Layout.preferredHeight: childrenRect.height + Layout.preferredWidth: childrenRect.width + Avatar { + Layout.preferredWidth: 45 * DefaultStyle.dp + Layout.preferredHeight: 45 * DefaultStyle.dp + call: mainItem.call } - RowLayout { - EffectImage { - imageSource: AppIcons.arrowDownLeft - colorizationColor: DefaultStyle.success_500main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - } + ColumnLayout { Text { - Layout.fillWidth: true - elide: Text.ElideRight - property var localAddress: UtilsCpp.getDisplayName(call.core.localAddress) - text: qsTr("Appel entrant%1").arg(localAddress ? qsTr(" pour %1").arg(localAddress.value) : "") //call.core.peerAddress + property var remoteAddress: UtilsCpp.getDisplayName(call.core.peerAddress) + text: remoteAddress ? remoteAddress.value : "" color: DefaultStyle.grey_600 font { - pixelSize: 13 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: 20 * DefaultStyle.dp + weight: 800 * DefaultStyle.dp + capitalization: Font.Capitalize + } + } + RowLayout { + EffectImage { + imageSource: AppIcons.arrowDownLeft + colorizationColor: DefaultStyle.success_500main + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + } + Text { + Layout.fillWidth: true + property var localAddress: UtilsCpp.getDisplayName(call.core.localAddress) + text: qsTr("Appel entrant")//.arg(localAddress ? qsTr(" pour %1").arg(localAddress.value) : "") //call.core.peerAddress + color: DefaultStyle.grey_600 + font { + pixelSize: 13 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + } } } } } - } - RowLayout { - Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true - spacing: 26 * DefaultStyle.dp - Button { - color: DefaultStyle.success_500main - Layout.preferredWidth: 75 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - contentItem: EffectImage { - colorizationColor: DefaultStyle.grey_0 - imageSource: AppIcons.phone - imageWidth: 32 * DefaultStyle.dp - imageHeight: 32 * DefaultStyle.dp + RowLayout { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + spacing: 26 * DefaultStyle.dp + Button { + color: DefaultStyle.success_500main + pressedColor: DefaultStyle.success_500main_darker + Layout.preferredWidth: 75 * DefaultStyle.dp + Layout.preferredHeight: 55 * DefaultStyle.dp + contentItem: EffectImage { + colorizationColor: DefaultStyle.grey_0 + imageSource: AppIcons.phone + imageWidth: 32 * DefaultStyle.dp + imageHeight: 32 * DefaultStyle.dp + } + onClicked: { + mainItem.call.core.lAccept(false) + UtilsCpp.openCallsWindow(mainItem.call) + } } - onClicked: { - mainItem.call.core.lAccept(false) - UtilsCpp.openCallsWindow(mainItem.call) - } - } - Button { - color: DefaultStyle.danger_500main - Layout.preferredWidth: 75 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - contentItem: EffectImage { - colorizationColor: DefaultStyle.grey_0 - imageSource: AppIcons.endCall - imageWidth: 32 * DefaultStyle.dp - imageHeight: 32 * DefaultStyle.dp - } - onClicked: { - mainItem.call.core.lDecline() + Button { + color: DefaultStyle.danger_500main + Layout.preferredWidth: 75 * DefaultStyle.dp + Layout.preferredHeight: 55 * DefaultStyle.dp + contentItem: EffectImage { + colorizationColor: DefaultStyle.grey_0 + imageSource: AppIcons.endCall + imageWidth: 32 * DefaultStyle.dp + imageHeight: 32 * DefaultStyle.dp + } + onClicked: { + mainItem.call.core.lDecline() + } } } } diff --git a/Linphone/view/Layout/Contact/ContactLayout.qml b/Linphone/view/Layout/Contact/ContactLayout.qml index 0d34d61c0..c6efe7689 100644 --- a/Linphone/view/Layout/Contact/ContactLayout.qml +++ b/Linphone/view/Layout/Contact/ContactLayout.qml @@ -51,73 +51,77 @@ ColumnLayout { } } - Item { - Layout.preferredWidth: 360 * DefaultStyle.dp - Layout.preferredHeight: detailAvatar.height - // Layout.fillWidth: true - 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 - Text { + spacing: 13 * DefaultStyle.dp + Item { + Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredHeight: detailAvatar.height + // Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - wrapMode: Text.WrapAnywhere - elide: Text.ElideRight - text: mainItem.contactName - maximumLineCount: 1 - font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - capitalization: Font.Capitalize + 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 } } - Text { - property var mode : contact ? contact.core.consolidatedPresence : -1 + ColumnLayout { Layout.alignment: Qt.AlignHCenter - horizontalAlignment: Text.AlignHCenter - 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 + Layout.preferredWidth: 360 * DefaultStyle.dp + spacing: 2 * DefaultStyle.dp + Text { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WrapAnywhere + elide: Text.ElideRight + text: mainItem.contactName + maximumLineCount: 1 + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + capitalization: Font.Capitalize + } + } + Text { + property var mode : contact ? contact.core.consolidatedPresence : -1 + Layout.alignment: Qt.AlignHCenter + horizontalAlignment: Text.AlignHCenter + 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 + } + } + Text { + // connection status } - } - Text { - // connection status } } RowLayout { diff --git a/Linphone/view/Page/Main/CallPage.qml b/Linphone/view/Page/Main/CallPage.qml index 168cbaaa2..58202a1cf 100644 --- a/Linphone/view/Page/Main/CallPage.qml +++ b/Linphone/view/Page/Main/CallPage.qml @@ -168,6 +168,12 @@ AbstractMainPage { } } } + Connections { + target: deleteHistoryPopup + onAccepted: { + if (listStackView.currentItem.listView) listStackView.currentItem.listView.model.removeAllEntries() + } + } onClicked: { removeHistory.close() deleteHistoryPopup.open() diff --git a/Linphone/view/Page/Main/ContactPage.qml b/Linphone/view/Page/Main/ContactPage.qml index 42b8b8f82..2d7322f25 100644 --- a/Linphone/view/Page/Main/ContactPage.qml +++ b/Linphone/view/Page/Main/ContactPage.qml @@ -195,167 +195,159 @@ AbstractMainPage { spacing: 38 * DefaultStyle.dp SearchBar { id: searchBar - visible: contactList.count > 0 + visible: contactList.model.sourceModel.count != 0 Layout.leftMargin: leftPanel.leftMargin Layout.rightMargin: leftPanel.rightMargin Layout.topMargin: 18 * DefaultStyle.dp Layout.fillWidth: true placeholderText: qsTr("Rechercher un contact") } - Item { - id: contactsArea + + Flickable { + id: listLayout + contentWidth: width + contentHeight: content.height + clip: true + Control.ScrollBar.vertical: contactsScrollbar Layout.fillWidth: true Layout.fillHeight: true - - Control.ScrollView { - id: listLayout - anchors.fill: parent - contentWidth: width - contentHeight: content.height - clip: true - Control.ScrollBar.vertical: contactsScrollbar + ColumnLayout { + id: content + width: parent.width + spacing: 15 * DefaultStyle.dp + Text { + visible: contactList.count === 0 && favoriteList.count === 0 + Layout.alignment: Qt.AlignHCenter + Layout.topMargin: 137 * DefaultStyle.dp + text: qsTr("Aucun contact") + font { + pixelSize: 16 * DefaultStyle.dp + weight: 800 * DefaultStyle.dp + } + } ColumnLayout { - id: content - width: parent.width - // anchors.fill: parent - spacing: 15 * DefaultStyle.dp - Text { - visible: contactList.count === 0 && favoriteList.count === 0 - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 137 * DefaultStyle.dp - text: qsTr("Aucun contact") - font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + visible: favoriteList.contentHeight > 0 + onVisibleChanged: if (visible && !favoriteList.visible) favoriteList.visible = true + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin + spacing: 18 * DefaultStyle.dp + RowLayout { + spacing: 0 + Text { + text: qsTr("Favoris") + font { + pixelSize: 16 * DefaultStyle.dp + weight: 800 * DefaultStyle.dp + } + } + Item { + Layout.fillWidth: true + } + Button { + background: Item{} + icon.source: favoriteList.visible ? AppIcons.upArrow : AppIcons.downArrow + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + icon.width: 24 * DefaultStyle.dp + icon.height: 24 * DefaultStyle.dp + onClicked: favoriteList.visible = !favoriteList.visible } } - ColumnLayout { - visible: favoriteList.contentHeight > 0 - onVisibleChanged: if (visible && !favoriteList.visible) favoriteList.visible = true - Layout.leftMargin: leftPanel.leftMargin - Layout.rightMargin: leftPanel.rightMargin - spacing: 18 * DefaultStyle.dp - RowLayout { - spacing: 0 - Text { - text: qsTr("Favoris") - font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - } - } - Item { - Layout.fillWidth: true - } - Button { - background: Item{} - icon.source: favoriteList.visible ? AppIcons.upArrow : AppIcons.downArrow - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - onClicked: favoriteList.visible = !favoriteList.visible + ContactsList{ + id: favoriteList + hoverEnabled: mainItem.leftPanelEnabled + Layout.fillWidth: true + Layout.preferredHeight: contentHeight + Control.ScrollBar.vertical.visible: false + showOnlyFavourites: true + contactMenuVisible: true + model: allFriends + onSelectedContactChanged: { + if (selectedContact) { + contactList.currentIndex = -1 } + mainItem.selectedContact = selectedContact } - ContactsList{ - id: favoriteList - hoverEnabled: mainItem.leftPanelEnabled - Layout.fillWidth: true - Layout.preferredHeight: contentHeight - Control.ScrollBar.vertical.visible: false - showOnlyFavourites: true - contactMenuVisible: true - model: allFriends - onSelectedContactChanged: { - if (selectedContact) { - contactList.currentIndex = -1 - } - mainItem.selectedContact = selectedContact - } - onContactDeletionRequested: (contact) => { - dialog.contact = contact - dialog.open() - } - } - } - ColumnLayout { - visible: contactList.count > 0 - onVisibleChanged: if (visible && !contactList.visible) contactList.visible = true - Layout.leftMargin: leftPanel.leftMargin - Layout.rightMargin: leftPanel.rightMargin - spacing: 16 * DefaultStyle.dp - RowLayout { - spacing: 0 - Text { - text: qsTr("All contacts") - font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - } - } - Item { - Layout.fillWidth: true - } - Button { - background: Item{} - icon.source: contactList.visible ? AppIcons.upArrow : AppIcons.downArrow - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - onClicked: contactList.visible = !contactList.visible - } - } - ContactsList{ - id: contactList - onCountChanged: { - if (initialFriendToDisplay.length !== 0) { - if (selectContact(initialFriendToDisplay) != -1) initialFriendToDisplay = "" - } - } - Layout.fillWidth: true - Layout.preferredHeight: contentHeight - interactive: false - Control.ScrollBar.vertical.visible: false - hoverEnabled: mainItem.leftPanelEnabled - contactMenuVisible: true - searchBarText: searchBar.text - model: allFriends - Connections { - target: allFriends - function onFriendCreated(index) { - contactList.currentIndex = index - } - } - onSelectedContactChanged: { - if (selectedContact) { - favoriteList.currentIndex = -1 - } - mainItem.selectedContact = selectedContact - } - onContactDeletionRequested: (contact) => { - dialog.contact = contact - dialog.open() - } + onContactDeletionRequested: (contact) => { + dialog.contact = contact + dialog.open() } } } - - ScrollBar { - id: contactsScrollbar - anchors.right: listLayout.right - anchors.rightMargin: 8 * DefaultStyle.dp - anchors.top: listLayout.top - anchors.bottom: listLayout.bottom - height: listLayout.availableHeight - active: true - interactive: true - policy: Control.ScrollBar.AsNeeded + ColumnLayout { + visible: contactList.count > 0 + onVisibleChanged: if (visible && !contactList.visible) contactList.visible = true + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin + spacing: 16 * DefaultStyle.dp + RowLayout { + spacing: 0 + Text { + text: qsTr("All contacts") + font { + pixelSize: 16 * DefaultStyle.dp + weight: 800 * DefaultStyle.dp + } + } + Item { + Layout.fillWidth: true + } + Button { + background: Item{} + icon.source: contactList.visible ? AppIcons.upArrow : AppIcons.downArrow + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + icon.width: 24 * DefaultStyle.dp + icon.height: 24 * DefaultStyle.dp + onClicked: contactList.visible = !contactList.visible + } + } + ContactsList{ + id: contactList + onCountChanged: { + if (initialFriendToDisplay.length !== 0) { + if (selectContact(initialFriendToDisplay) != -1) initialFriendToDisplay = "" + } + } + Layout.fillWidth: true + Layout.preferredHeight: contentHeight + interactive: false + Control.ScrollBar.vertical.visible: false + hoverEnabled: mainItem.leftPanelEnabled + contactMenuVisible: true + searchBarText: searchBar.text + model: allFriends + Connections { + target: allFriends + function onFriendCreated(index) { + contactList.currentIndex = index + } + } + onSelectedContactChanged: { + if (selectedContact) { + favoriteList.currentIndex = -1 + } + mainItem.selectedContact = selectedContact + } + onContactDeletionRequested: (contact) => { + dialog.contact = contact + dialog.open() + } + } } - } - + } + ScrollBar { + id: contactsScrollbar + anchors.right: listLayout.right + anchors.rightMargin: 8 * DefaultStyle.dp + anchors.top: listLayout.top + anchors.bottom: listLayout.bottom + height: listLayout.height + active: true + interactive: true + policy: Control.ScrollBar.AsNeeded } } } @@ -583,6 +575,7 @@ AbstractMainPage { } } RoundedBackgroundControl { + Layout.preferredWidth: 360 * DefaultStyle.dp contentItem: ColumnLayout { spacing: 13 * DefaultStyle.dp Text { diff --git a/Linphone/view/Style/DefaultStyle.qml b/Linphone/view/Style/DefaultStyle.qml index 6d2dde2dd..dcb3d61f7 100644 --- a/Linphone/view/Style/DefaultStyle.qml +++ b/Linphone/view/Style/DefaultStyle.qml @@ -29,6 +29,7 @@ QtObject { property color warning_600: "#DBB820" property color danger_500main: "#DD5F5F" property color success_500main: "#4FAE80" + property color success_500main_darker: "#3F8C67" property color info_500_main: "#4AA8FF" property color vue_meter_light_green: "#6FF88D"