From 9c3674567390caedd32f7d304635d10294a0eab8 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 13 Nov 2024 11:44:45 +0100 Subject: [PATCH] fix #LINQT-1407 close numeric pad delegate mousearea color + padding fix #LINQT-1408 reset call notif on pressed try to fix notif coordinates #LINQT-1415 --- .../view/Control/Container/VerticalTabBar.qml | 8 - .../Display/Contact/ContactListView.qml | 9 +- .../Notification/NotificationReceivedCall.qml | 4 +- Linphone/view/Page/Form/Call/NewCallForm.qml | 1 + Linphone/view/Page/Layout/Main/MainLayout.qml | 11 + Linphone/view/Page/Main/Call/CallPage.qml | 221 +++++++++--------- 6 files changed, 127 insertions(+), 127 deletions(-) diff --git a/Linphone/view/Control/Container/VerticalTabBar.qml b/Linphone/view/Control/Container/VerticalTabBar.qml index ae2ea54af..c8795fd51 100644 --- a/Linphone/view/Control/Container/VerticalTabBar.qml +++ b/Linphone/view/Control/Container/VerticalTabBar.qml @@ -17,14 +17,6 @@ Control.TabBar { onDefaultAccountChanged: { if (defaultAccount) defaultAccount.core?.lRefreshNotifications() } - Connections { - enabled: defaultAccount - target: defaultAccount.core - onUnreadCallNotificationsChanged: { - console.log("unread changed", currentIndex) - if (currentIndex === 0) defaultAccount?.core.lResetMissedCalls() - } - } component UnreadNotification: Rectangle { id: unreadNotifications diff --git a/Linphone/view/Control/Display/Contact/ContactListView.qml b/Linphone/view/Control/Display/Contact/ContactListView.qml index add606248..030eae10d 100644 --- a/Linphone/view/Control/Display/Contact/ContactListView.qml +++ b/Linphone/view/Control/Display/Contact/ContactListView.qml @@ -181,11 +181,13 @@ ListView { id: contactDelegate anchors.left: initial.visible ? initial.right : parent.left anchors.right: parent.right - anchors.rightMargin: 5 * DefaultStyle.dp + anchors.top: parent.top + anchors.bottom: parent.bottom anchors.verticalCenter: parent.verticalCenter spacing: 16 * DefaultStyle.dp z: 1 Avatar { + Layout.leftMargin: 5 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp contact: modelData @@ -343,8 +345,6 @@ ListView { } } } - - MouseArea { id: contactArea @@ -358,7 +358,8 @@ ListView { Rectangle { anchors.fill: contactArea opacity: 0.7 - color: DefaultStyle.main2_100 + radius: 8 * DefaultStyle.dp + color: mainItem.currentIndex === index ? DefaultStyle.main2_200 : DefaultStyle.main2_100 visible: contactArea.containsMouse || friendPopup.hovered || mainItem.currentIndex === index } Keys.onPressed: (event)=> { diff --git a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml index 3098e45c8..3964df138 100644 --- a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml +++ b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml @@ -7,8 +7,8 @@ import UtilsCpp Notification { id: mainItem radius: 20 * DefaultStyle.dp - overriddenWidth: content.implicitWidth//101 * DefaultStyle.dp - overriddenHeight: content.implicitHeight//422 * DefaultStyle.dp + overriddenWidth: content.width//101 * DefaultStyle.dp + overriddenHeight: content.height//422 * DefaultStyle.dp readonly property var call: notificationData && notificationData.call property var state: call.core.state diff --git a/Linphone/view/Page/Form/Call/NewCallForm.qml b/Linphone/view/Page/Form/Call/NewCallForm.qml index bbaae3e18..000b957ac 100644 --- a/Linphone/view/Page/Form/Call/NewCallForm.qml +++ b/Linphone/view/Page/Form/Call/NewCallForm.qml @@ -20,6 +20,7 @@ FocusScope { signal transferCallToAnotherRequested(CallGui dest) signal contactClicked(FriendGui contact) clip: true + onVisibleChanged: if (numPadPopup.opened) numPadPopup.close() ColumnLayout { anchors.fill: parent diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index 750dc1e49..a033e7502 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -78,6 +78,16 @@ Item { sourceModel: AppCpp.calls } + MouseArea { + anchors.fill: parent + focus: true + z: 100 + onPressed: { + if (mainStackView.currentItem.objectName === "mainStackLayout" && mainStackView.currentItem.currentIndex === 0 + && accountProxy.defaultAccount && accountProxy.defaultAccount.core.unreadCallNotifications > 0) accountProxy.defaultAccount.core.lResetMissedCalls() + mouse.accepted = false + } + } Item{ Popup { @@ -612,6 +622,7 @@ Item { id: mainStackLayoutComponent StackLayout { id: mainStackLayout + objectName: "mainStackLayout" currentIndex: tabbar.currentIndex onActiveFocusChanged: if(activeFocus && currentIndex >= 0) children[currentIndex].forceActiveFocus() CallPage { diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index ef7537bbb..2c1fcc5cd 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -276,131 +276,126 @@ AbstractMainPage { } onAtYEndChanged: if(atYEnd) callHistoryProxy.displayMore() delegate: FocusScope { - width:historyListView.width - height: 56 * DefaultStyle.dp - anchors.topMargin: 5 * DefaultStyle.dp - anchors.bottomMargin: 5 * DefaultStyle.dp - visible: !!modelData - RowLayout { - z: 1 - anchors.fill: parent - spacing: 10 * DefaultStyle.dp - Avatar { - id: historyAvatar - property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.remoteAddress) - contact: contactObj && contactObj.value || null - _address: modelData.core.remoteAddress - width: 45 * DefaultStyle.dp - height: 45 * DefaultStyle.dp - } - ColumnLayout { - Layout.fillHeight: true + width:historyListView.width + height: 56 * DefaultStyle.dp + anchors.topMargin: 5 * DefaultStyle.dp + anchors.bottomMargin: 5 * DefaultStyle.dp + visible: !!modelData + RowLayout { + z: 1 + anchors.fill: parent + anchors.leftMargin: 5 * DefaultStyle.dp + anchors.rightMargin: 5 * DefaultStyle.dp + spacing: 10 * DefaultStyle.dp + Avatar { + id: historyAvatar + property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.remoteAddress) + contact: contactObj && contactObj.value || null + _address: modelData.core.remoteAddress + width: 45 * DefaultStyle.dp + height: 45 * DefaultStyle.dp + } + ColumnLayout { + Layout.fillHeight: true + Layout.fillWidth: true + spacing: 5 * DefaultStyle.dp + Text { + id: friendAddress Layout.fillWidth: true - spacing: 5 * DefaultStyle.dp - Text { - id: friendAddress - Layout.fillWidth: true - maximumLineCount: 1 - text: modelData.core.displayName - font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - capitalization: Font.Capitalize - } - } - RowLayout { - spacing: 6 * DefaultStyle.dp - EffectImage { - id: statusIcon - imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined - || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere - || modelData.core.status === LinphoneEnums.CallStatus.Aborted - || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted - ? AppIcons.arrowElbow - : modelData.core.isOutgoing - ? AppIcons.arrowUpRight - : AppIcons.arrowDownLeft - colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined - || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere - || modelData.core.status === LinphoneEnums.CallStatus.Aborted - || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted - || modelData.core.status === LinphoneEnums.CallStatus.Missed - ? DefaultStyle.danger_500main - : modelData.core.isOutgoing - ? DefaultStyle.info_500_main - : DefaultStyle.success_500main - Layout.preferredWidth: 12 * DefaultStyle.dp - Layout.preferredHeight: 12 * DefaultStyle.dp - transform: Rotation { - angle: modelData.core.isOutgoing && (modelData.core.status === LinphoneEnums.CallStatus.Declined - || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere - || modelData.core.status === LinphoneEnums.CallStatus.Aborted - || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0 - origin { - x: statusIcon.width/2 - y: statusIcon.height/2 - } - } - } - Text { - // text: modelData.core.date - text: UtilsCpp.formatDate(modelData.core.date) - font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp - } - } + maximumLineCount: 1 + text: modelData.core.displayName + font { + pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp + capitalization: Font.Capitalize } } - Button { - Layout.rightMargin: 5 * DefaultStyle.dp - padding: 0 - background: Item { - visible: false - } - icon.source: AppIcons.phone - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - contentImageColor: DefaultStyle.main2_600 - focus: true - activeFocusOnTab: false - onClicked: { - if (modelData.core.isConference) { - var callsWindow = UtilsCpp.getCallsWindow() - callsWindow.setupConference(modelData.core.conferenceInfo) - callsWindow.show() + RowLayout { + spacing: 6 * DefaultStyle.dp + EffectImage { + id: statusIcon + imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined + || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere + || modelData.core.status === LinphoneEnums.CallStatus.Aborted + || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted + ? AppIcons.arrowElbow + : modelData.core.isOutgoing + ? AppIcons.arrowUpRight + : AppIcons.arrowDownLeft + colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined + || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere + || modelData.core.status === LinphoneEnums.CallStatus.Aborted + || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted + || modelData.core.status === LinphoneEnums.CallStatus.Missed + ? DefaultStyle.danger_500main + : modelData.core.isOutgoing + ? DefaultStyle.info_500_main + : DefaultStyle.success_500main + Layout.preferredWidth: 12 * DefaultStyle.dp + Layout.preferredHeight: 12 * DefaultStyle.dp + transform: Rotation { + angle: modelData.core.isOutgoing && (modelData.core.status === LinphoneEnums.CallStatus.Declined + || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere + || modelData.core.status === LinphoneEnums.CallStatus.Aborted + || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0 + origin { + x: statusIcon.width/2 + y: statusIcon.height/2 + } } - else { - UtilsCpp.createCall(modelData.core.remoteAddress) + } + Text { + // text: modelData.core.date + text: UtilsCpp.formatDate(modelData.core.date) + font { + pixelSize: 12 * DefaultStyle.dp + weight: 300 * DefaultStyle.dp } } } } - MouseArea { - hoverEnabled: true - anchors.fill: parent + Button { + padding: 0 + background: Item { + visible: false + } + icon.source: AppIcons.phone + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + icon.width: 24 * DefaultStyle.dp + icon.height: 24 * DefaultStyle.dp + contentImageColor: DefaultStyle.main2_600 focus: true - Rectangle { - anchors.fill: parent - opacity: 0.1 - color: DefaultStyle.main2_500main - visible: parent.containsMouse - } - Rectangle { - anchors.fill: parent - visible: historyListView.currentIndex === model.index - color: DefaultStyle.main2_100 - } - onPressed: { - historyListView.currentIndex = model.index - historyListView.forceActiveFocus() + activeFocusOnTab: false + onClicked: { + if (modelData.core.isConference) { + var callsWindow = UtilsCpp.getCallsWindow() + callsWindow.setupConference(modelData.core.conferenceInfo) + callsWindow.show() + } + else { + UtilsCpp.createCall(modelData.core.remoteAddress) + } } } } - //} - //} + MouseArea { + hoverEnabled: true + anchors.fill: parent + focus: true + Rectangle { + anchors.fill: parent + opacity: 0.7 + radius: 8 * DefaultStyle.dp + color: historyListView.currentIndex === index ? DefaultStyle.main2_200 : DefaultStyle.main2_100 + visible: parent.containsMouse || historyListView.currentIndex === index + } + onPressed: { + historyListView.currentIndex = model.index + historyListView.forceActiveFocus() + } + } + } onCurrentIndexChanged: { positionViewAtIndex(currentIndex, ListView.Visible) mainItem.selectedRowHistoryGui = model.getAt(currentIndex)