mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-01 11:39:26 +00:00
Fix notifications for not going to foreground after clicking on them
This commit is contained in:
parent
78e6b28106
commit
540928e449
1 changed files with 75 additions and 74 deletions
|
|
@ -8,78 +8,79 @@ import Linphone.Styles 1.0
|
|||
// =============================================================================
|
||||
|
||||
Notification {
|
||||
id: notification
|
||||
|
||||
icon: 'message_sign'
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
readonly property TimelineModel timelineModel: notificationData && notificationData.timelineModel
|
||||
readonly property string peerAddress: notificationData && notificationData.peerAddress || ''
|
||||
readonly property string localAddress: notificationData && notificationData.localAddress || ''
|
||||
readonly property string fullPeerAddress: notificationData && notificationData.fullPeerAddress || ''
|
||||
readonly property string fullLocalAddress: notificationData && notificationData.fullLocalAddress || ''
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Loader {
|
||||
active: timelineModel//Boolean(notification.peerAddress) && Boolean(notification.localAddress)
|
||||
anchors {
|
||||
fill: parent
|
||||
|
||||
leftMargin: NotificationReceivedMessageStyle.leftMargin
|
||||
rightMargin: NotificationReceivedMessageStyle.rightMargin
|
||||
bottomMargin: NotificationReceivedMessageStyle.bottomMargin
|
||||
}
|
||||
|
||||
sourceComponent: ColumnLayout {
|
||||
spacing: NotificationReceivedMessageStyle.spacing
|
||||
|
||||
Contact {
|
||||
Layout.fillWidth: true
|
||||
|
||||
//entry: SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress)
|
||||
entry:notification.timelineModel.getChatRoomModel()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
color: NotificationReceivedMessageStyle.messageContainer.color
|
||||
radius: NotificationReceivedMessageStyle.messageContainer.radius
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: NotificationReceivedMessageStyle.messageContainer.margins
|
||||
}
|
||||
|
||||
color: NotificationReceivedMessageStyle.messageContainer.text.color
|
||||
elide: Text.ElideRight
|
||||
|
||||
font {
|
||||
italic: true
|
||||
pointSize: NotificationReceivedMessageStyle.messageContainer.text.pointSize
|
||||
}
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: notification.notificationData.message
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
onClicked: notification._close(function () {
|
||||
AccountSettingsModel.setDefaultProxyConfigFromSipAddress(notification.localAddress)
|
||||
notification.timelineModel.selected = true
|
||||
notification.notificationData.window.setView('Conversation', {
|
||||
chatRoomModel:notification.timelineModel.getChatRoomModel()
|
||||
})
|
||||
})
|
||||
}
|
||||
id: notification
|
||||
|
||||
icon: 'message_sign'
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
readonly property TimelineModel timelineModel: notificationData && notificationData.timelineModel
|
||||
readonly property string peerAddress: notificationData && notificationData.peerAddress || ''
|
||||
readonly property string localAddress: notificationData && notificationData.localAddress || ''
|
||||
readonly property string fullPeerAddress: notificationData && notificationData.fullPeerAddress || ''
|
||||
readonly property string fullLocalAddress: notificationData && notificationData.fullLocalAddress || ''
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Loader {
|
||||
active: timelineModel//Boolean(notification.peerAddress) && Boolean(notification.localAddress)
|
||||
anchors {
|
||||
fill: parent
|
||||
|
||||
leftMargin: NotificationReceivedMessageStyle.leftMargin
|
||||
rightMargin: NotificationReceivedMessageStyle.rightMargin
|
||||
bottomMargin: NotificationReceivedMessageStyle.bottomMargin
|
||||
}
|
||||
|
||||
sourceComponent: ColumnLayout {
|
||||
spacing: NotificationReceivedMessageStyle.spacing
|
||||
|
||||
Contact {
|
||||
Layout.fillWidth: true
|
||||
|
||||
//entry: SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress)
|
||||
entry:notification.timelineModel.getChatRoomModel()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
color: NotificationReceivedMessageStyle.messageContainer.color
|
||||
radius: NotificationReceivedMessageStyle.messageContainer.radius
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: NotificationReceivedMessageStyle.messageContainer.margins
|
||||
}
|
||||
|
||||
color: NotificationReceivedMessageStyle.messageContainer.text.color
|
||||
elide: Text.ElideRight
|
||||
|
||||
font {
|
||||
italic: true
|
||||
pointSize: NotificationReceivedMessageStyle.messageContainer.text.pointSize
|
||||
}
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: notification.notificationData.message
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
onClicked: notification._close(function () {
|
||||
AccountSettingsModel.setDefaultProxyConfigFromSipAddress(notification.localAddress)
|
||||
notification.timelineModel.selected = true
|
||||
notification.notificationData.window.setView('Conversation', {
|
||||
chatRoomModel:notification.timelineModel.getChatRoomModel()
|
||||
})
|
||||
App.smartShowWindow(notification.notificationData.window)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue