From df6f39addc99d42761492131a69ad09f37f2941a Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 25 Nov 2024 10:44:26 +0100 Subject: [PATCH] feature #LINQT-1449 new call notif --- Linphone/view/Control/Button/Button.qml | 26 +-- .../Popup/Notification/Notification.qml | 20 +-- .../Notification/NotificationReceivedCall.qml | 148 ++++++++++-------- Linphone/view/Style/AppIcons.qml | 1 + 4 files changed, 108 insertions(+), 87 deletions(-) diff --git a/Linphone/view/Control/Button/Button.qml b/Linphone/view/Control/Button/Button.qml index f63995c17..25c2ab892 100644 --- a/Linphone/view/Control/Button/Button.qml +++ b/Linphone/view/Control/Button/Button.qml @@ -135,17 +135,21 @@ Control.Button { Component{ id: imageTextComponent - RowLayout { - spacing: mainItem.spacing - ButtonImage{ - Layout.preferredWidth: mainItem.icon.width - Layout.preferredHeight: mainItem.icon.height - } - ButtonText { - horizontalAlignment: Text.AlignLeft - } - Item{ - Layout.fillWidth: true + // Workaround for centering the content when its + // width is smaller than the button width + Item { + implicitWidth: content.implicitWidth + implicitHeight: content.implicitHeight + RowLayout { + id: content + spacing: mainItem.spacing + anchors.centerIn: parent + ButtonImage{ + Layout.preferredWidth: mainItem.icon.width + Layout.preferredHeight: mainItem.icon.height + } + ButtonText { + } } } } diff --git a/Linphone/view/Control/Popup/Notification/Notification.qml b/Linphone/view/Control/Popup/Notification/Notification.qml index e35c88487..b49cfba45 100644 --- a/Linphone/view/Control/Popup/Notification/Notification.qml +++ b/Linphone/view/Control/Popup/Notification/Notification.qml @@ -14,6 +14,8 @@ DesktopPopup { property int overriddenHeight: 120 * DefaultStyle.dp property int overriddenWidth: 300 * DefaultStyle.dp property double radius: 0 + property color backgroundColor: DefaultStyle.grey_0 + property double backgroundOpacity: 1 default property alias _content: content.data signal deleteNotification (var notification) @@ -34,12 +36,9 @@ DesktopPopup { Rectangle { anchors.fill: parent visible: backgroundLoader.status != Loader.Ready - color: DefaultStyle.grey_0 + color: mainItem.backgroundColor radius: mainItem.radius - border { - color: DefaultStyle.grey_400 - width: 1 * DefaultStyle.dp - } + opacity: mainItem.backgroundOpacity } Loader{ @@ -52,12 +51,13 @@ DesktopPopup { id: background anchors.fill: parent visible: backgroundLoader.status != Loader.Ready - color: DefaultStyle.grey_0 + color: mainItem.backgroundColor radius: mainItem.radius - border { - color: DefaultStyle.grey_400 - width: 1 * DefaultStyle.dp - } + opacity: mainItem.backgroundOpacity + // border { + // color: DefaultStyle.grey_400 + // width: 1 * DefaultStyle.dp + // } } MultiEffect { source: background diff --git a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml index 094a50e7a..97d043666 100644 --- a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml +++ b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml @@ -7,8 +7,10 @@ import UtilsCpp Notification { id: mainItem radius: 20 * DefaultStyle.dp - overriddenWidth: 450 * DefaultStyle.dp//content.width - overriddenHeight: 101 * DefaultStyle.dp//content.height + backgroundColor: DefaultStyle.grey_600 + backgroundOpacity: 0.8 + overriddenWidth: 245 * DefaultStyle.dp// + overriddenHeight: content.height //126 * DefaultStyle.dp// readonly property var call: notificationData && notificationData.call property var state: call.core.state @@ -25,75 +27,85 @@ Notification { Popup { id: content visible: mainItem.visible - width: parent.width - height: parent.height - leftPadding: 26 * DefaultStyle.dp - rightPadding: 26 * DefaultStyle.dp - topPadding: 15 * DefaultStyle.dp - bottomPadding: 15 * DefaultStyle.dp + leftPadding: 16 * DefaultStyle.dp + rightPadding: 16 * DefaultStyle.dp + topPadding: 3 * DefaultStyle.dp + bottomPadding: 3 * DefaultStyle.dp + anchors.centerIn: parent background: Item{} - contentItem: RowLayout { - spacing: 15 * DefaultStyle.dp + contentItem: ColumnLayout { + anchors.centerIn: parent + spacing: 9 * DefaultStyle.dp 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 + spacing: 4 * DefaultStyle.dp + Layout.alignment: Qt.AlignHCenter + Image { + Layout.preferredWidth: 10 * DefaultStyle.dp + Layout.preferredHeight: 10 * DefaultStyle.dp + source: AppIcons.logo } - ColumnLayout { - Text { - text: call.core.remoteName - Layout.fillWidth: true - Layout.maximumWidth: 200 * DefaultStyle.dp - maximumLineCount: 1 - color: DefaultStyle.grey_600 - font { - 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.remoteAddress - color: DefaultStyle.grey_600 - font { - pixelSize: 13 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - } - } + Text { + text: "Linphone" + color: DefaultStyle.grey_0 + font { + pixelSize: 8 * DefaultStyle.dp + weight: 600 * DefaultStyle.dp + capitalization: Font.Capitalize + } + } + } + ColumnLayout { + spacing: 2 * DefaultStyle.dp + Layout.alignment: Qt.AlignHCenter + Avatar { + Layout.preferredWidth: 40 * DefaultStyle.dp + Layout.preferredHeight: 40 * DefaultStyle.dp + Layout.alignment: Qt.AlignHCenter + call: mainItem.call + } + Text { + text: call.core.remoteName + Layout.fillWidth: true + Layout.maximumWidth: 200 * DefaultStyle.dp + Layout.alignment: Qt.AlignHCenter + horizontalAlignment: Text.AlignHCenter + maximumLineCount: 1 + color: DefaultStyle.grey_0 + font { + pixelSize: 14 * DefaultStyle.dp + weight: 600 * DefaultStyle.dp + capitalization: Font.Capitalize + } + } + Text { + text: qsTr("Vous appelle...") + Layout.alignment: Qt.AlignHCenter + color: DefaultStyle.grey_0 + font { + pixelSize: 10 * DefaultStyle.dp + weight: 500 * DefaultStyle.dp } } } - Item{Layout.fillWidth: true} RowLayout { Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true spacing: 26 * DefaultStyle.dp Button { + spacing: 6 * DefaultStyle.dp color: DefaultStyle.success_500main - Layout.preferredWidth: 75 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp + borderColor: color + Layout.preferredWidth: 93 * DefaultStyle.dp + Layout.preferredHeight: 25 * DefaultStyle.dp asynchronous: false - contentItem: EffectImage { - colorizationColor: DefaultStyle.grey_0 - imageSource: AppIcons.phone - imageWidth: 32 * DefaultStyle.dp - imageHeight: 32 * DefaultStyle.dp - } + icon.source: AppIcons.phone + icon.width: 14 * DefaultStyle.dp + icon.height: 14 * DefaultStyle.dp + contentImageColor: DefaultStyle.grey_0 + text: qsTr("Répondre") + textColor: DefaultStyle.grey_0 + textSize: 10 * DefaultStyle.dp + textWeight: 500 * DefaultStyle.dp onClicked: { console.debug("[NotificationReceivedCall] Accept click") UtilsCpp.openCallsWindow(mainItem.call) @@ -101,16 +113,20 @@ Notification { } } Button { + spacing: 6 * DefaultStyle.dp color: DefaultStyle.danger_500main - Layout.preferredWidth: 75 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp + borderColor: color + Layout.preferredWidth: 93 * DefaultStyle.dp + Layout.preferredHeight: 25 * DefaultStyle.dp asynchronous: false - contentItem: EffectImage { - colorizationColor: DefaultStyle.grey_0 - imageSource: AppIcons.endCall - imageWidth: 32 * DefaultStyle.dp - imageHeight: 32 * DefaultStyle.dp - } + icon.source: AppIcons.endCall + icon.width: 14 * DefaultStyle.dp + icon.height: 14 * DefaultStyle.dp + contentImageColor: DefaultStyle.grey_0 + text: qsTr("Refuser") + textColor: DefaultStyle.grey_0 + textSize: 10 * DefaultStyle.dp + textWeight: 500 * DefaultStyle.dp onClicked: { console.debug("[NotificationReceivedCall] Decline click") mainItem.call.core.lDecline() diff --git a/Linphone/view/Style/AppIcons.qml b/Linphone/view/Style/AppIcons.qml index 562e06233..2374a9572 100644 --- a/Linphone/view/Style/AppIcons.qml +++ b/Linphone/view/Style/AppIcons.qml @@ -3,6 +3,7 @@ import QtQuick QtObject { property string welcomeLinphoneLogo: "image://internal/linphone.svg" + property string logo: "image://internal/logo.svg" property string welcomeLock: "image://internal/secured.svg" property string lock: "image://internal/lock.svg" property string lockSimple: "image://internal/lock-simple.svg"