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
This commit is contained in:
Gaelle Braud 2024-11-13 11:44:45 +01:00 committed by gaelle
parent 10ab8395f7
commit 9c36745673
6 changed files with 127 additions and 127 deletions

View file

@ -17,14 +17,6 @@ Control.TabBar {
onDefaultAccountChanged: { onDefaultAccountChanged: {
if (defaultAccount) defaultAccount.core?.lRefreshNotifications() 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 { component UnreadNotification: Rectangle {
id: unreadNotifications id: unreadNotifications

View file

@ -181,11 +181,13 @@ ListView {
id: contactDelegate id: contactDelegate
anchors.left: initial.visible ? initial.right : parent.left anchors.left: initial.visible ? initial.right : parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 5 * DefaultStyle.dp anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 16 * DefaultStyle.dp spacing: 16 * DefaultStyle.dp
z: 1 z: 1
Avatar { Avatar {
Layout.leftMargin: 5 * DefaultStyle.dp
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
contact: modelData contact: modelData
@ -343,8 +345,6 @@ ListView {
} }
} }
} }
MouseArea { MouseArea {
id: contactArea id: contactArea
@ -358,7 +358,8 @@ ListView {
Rectangle { Rectangle {
anchors.fill: contactArea anchors.fill: contactArea
opacity: 0.7 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 visible: contactArea.containsMouse || friendPopup.hovered || mainItem.currentIndex === index
} }
Keys.onPressed: (event)=> { Keys.onPressed: (event)=> {

View file

@ -7,8 +7,8 @@ import UtilsCpp
Notification { Notification {
id: mainItem id: mainItem
radius: 20 * DefaultStyle.dp radius: 20 * DefaultStyle.dp
overriddenWidth: content.implicitWidth//101 * DefaultStyle.dp overriddenWidth: content.width//101 * DefaultStyle.dp
overriddenHeight: content.implicitHeight//422 * DefaultStyle.dp overriddenHeight: content.height//422 * DefaultStyle.dp
readonly property var call: notificationData && notificationData.call readonly property var call: notificationData && notificationData.call
property var state: call.core.state property var state: call.core.state

View file

@ -20,6 +20,7 @@ FocusScope {
signal transferCallToAnotherRequested(CallGui dest) signal transferCallToAnotherRequested(CallGui dest)
signal contactClicked(FriendGui contact) signal contactClicked(FriendGui contact)
clip: true clip: true
onVisibleChanged: if (numPadPopup.opened) numPadPopup.close()
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent

View file

@ -78,6 +78,16 @@ Item {
sourceModel: AppCpp.calls 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{ Item{
Popup { Popup {
@ -612,6 +622,7 @@ Item {
id: mainStackLayoutComponent id: mainStackLayoutComponent
StackLayout { StackLayout {
id: mainStackLayout id: mainStackLayout
objectName: "mainStackLayout"
currentIndex: tabbar.currentIndex currentIndex: tabbar.currentIndex
onActiveFocusChanged: if(activeFocus && currentIndex >= 0) children[currentIndex].forceActiveFocus() onActiveFocusChanged: if(activeFocus && currentIndex >= 0) children[currentIndex].forceActiveFocus()
CallPage { CallPage {

View file

@ -276,131 +276,126 @@ AbstractMainPage {
} }
onAtYEndChanged: if(atYEnd) callHistoryProxy.displayMore() onAtYEndChanged: if(atYEnd) callHistoryProxy.displayMore()
delegate: FocusScope { delegate: FocusScope {
width:historyListView.width width:historyListView.width
height: 56 * DefaultStyle.dp height: 56 * DefaultStyle.dp
anchors.topMargin: 5 * DefaultStyle.dp anchors.topMargin: 5 * DefaultStyle.dp
anchors.bottomMargin: 5 * DefaultStyle.dp anchors.bottomMargin: 5 * DefaultStyle.dp
visible: !!modelData visible: !!modelData
RowLayout { RowLayout {
z: 1 z: 1
anchors.fill: parent anchors.fill: parent
spacing: 10 * DefaultStyle.dp anchors.leftMargin: 5 * DefaultStyle.dp
Avatar { anchors.rightMargin: 5 * DefaultStyle.dp
id: historyAvatar spacing: 10 * DefaultStyle.dp
property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.remoteAddress) Avatar {
contact: contactObj && contactObj.value || null id: historyAvatar
_address: modelData.core.remoteAddress property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.remoteAddress)
width: 45 * DefaultStyle.dp contact: contactObj && contactObj.value || null
height: 45 * DefaultStyle.dp _address: modelData.core.remoteAddress
} width: 45 * DefaultStyle.dp
ColumnLayout { height: 45 * DefaultStyle.dp
Layout.fillHeight: true }
ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
spacing: 5 * DefaultStyle.dp
Text {
id: friendAddress
Layout.fillWidth: true Layout.fillWidth: true
spacing: 5 * DefaultStyle.dp maximumLineCount: 1
Text { text: modelData.core.displayName
id: friendAddress font {
Layout.fillWidth: true pixelSize: 14 * DefaultStyle.dp
maximumLineCount: 1 weight: 400 * DefaultStyle.dp
text: modelData.core.displayName capitalization: Font.Capitalize
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
}
}
} }
} }
Button { RowLayout {
Layout.rightMargin: 5 * DefaultStyle.dp spacing: 6 * DefaultStyle.dp
padding: 0 EffectImage {
background: Item { id: statusIcon
visible: false imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined
} || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
icon.source: AppIcons.phone || modelData.core.status === LinphoneEnums.CallStatus.Aborted
Layout.preferredWidth: 24 * DefaultStyle.dp || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
Layout.preferredHeight: 24 * DefaultStyle.dp ? AppIcons.arrowElbow
icon.width: 24 * DefaultStyle.dp : modelData.core.isOutgoing
icon.height: 24 * DefaultStyle.dp ? AppIcons.arrowUpRight
contentImageColor: DefaultStyle.main2_600 : AppIcons.arrowDownLeft
focus: true colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined
activeFocusOnTab: false || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
onClicked: { || modelData.core.status === LinphoneEnums.CallStatus.Aborted
if (modelData.core.isConference) { || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
var callsWindow = UtilsCpp.getCallsWindow() || modelData.core.status === LinphoneEnums.CallStatus.Missed
callsWindow.setupConference(modelData.core.conferenceInfo) ? DefaultStyle.danger_500main
callsWindow.show() : 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 { Button {
hoverEnabled: true padding: 0
anchors.fill: parent 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 focus: true
Rectangle { activeFocusOnTab: false
anchors.fill: parent onClicked: {
opacity: 0.1 if (modelData.core.isConference) {
color: DefaultStyle.main2_500main var callsWindow = UtilsCpp.getCallsWindow()
visible: parent.containsMouse callsWindow.setupConference(modelData.core.conferenceInfo)
} callsWindow.show()
Rectangle { }
anchors.fill: parent else {
visible: historyListView.currentIndex === model.index UtilsCpp.createCall(modelData.core.remoteAddress)
color: DefaultStyle.main2_100 }
}
onPressed: {
historyListView.currentIndex = model.index
historyListView.forceActiveFocus()
} }
} }
} }
//} 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: { onCurrentIndexChanged: {
positionViewAtIndex(currentIndex, ListView.Visible) positionViewAtIndex(currentIndex, ListView.Visible)
mainItem.selectedRowHistoryGui = model.getAt(currentIndex) mainItem.selectedRowHistoryGui = model.getAt(currentIndex)