feature #LINQT-1449 new call notif
This commit is contained in:
parent
2a26d23470
commit
df6f39addc
4 changed files with 108 additions and 87 deletions
|
|
@ -135,17 +135,21 @@ Control.Button {
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id: imageTextComponent
|
id: imageTextComponent
|
||||||
RowLayout {
|
// Workaround for centering the content when its
|
||||||
spacing: mainItem.spacing
|
// width is smaller than the button width
|
||||||
ButtonImage{
|
Item {
|
||||||
Layout.preferredWidth: mainItem.icon.width
|
implicitWidth: content.implicitWidth
|
||||||
Layout.preferredHeight: mainItem.icon.height
|
implicitHeight: content.implicitHeight
|
||||||
}
|
RowLayout {
|
||||||
ButtonText {
|
id: content
|
||||||
horizontalAlignment: Text.AlignLeft
|
spacing: mainItem.spacing
|
||||||
}
|
anchors.centerIn: parent
|
||||||
Item{
|
ButtonImage{
|
||||||
Layout.fillWidth: true
|
Layout.preferredWidth: mainItem.icon.width
|
||||||
|
Layout.preferredHeight: mainItem.icon.height
|
||||||
|
}
|
||||||
|
ButtonText {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ DesktopPopup {
|
||||||
property int overriddenHeight: 120 * DefaultStyle.dp
|
property int overriddenHeight: 120 * DefaultStyle.dp
|
||||||
property int overriddenWidth: 300 * DefaultStyle.dp
|
property int overriddenWidth: 300 * DefaultStyle.dp
|
||||||
property double radius: 0
|
property double radius: 0
|
||||||
|
property color backgroundColor: DefaultStyle.grey_0
|
||||||
|
property double backgroundOpacity: 1
|
||||||
default property alias _content: content.data
|
default property alias _content: content.data
|
||||||
|
|
||||||
signal deleteNotification (var notification)
|
signal deleteNotification (var notification)
|
||||||
|
|
@ -34,12 +36,9 @@ DesktopPopup {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: backgroundLoader.status != Loader.Ready
|
visible: backgroundLoader.status != Loader.Ready
|
||||||
color: DefaultStyle.grey_0
|
color: mainItem.backgroundColor
|
||||||
radius: mainItem.radius
|
radius: mainItem.radius
|
||||||
border {
|
opacity: mainItem.backgroundOpacity
|
||||||
color: DefaultStyle.grey_400
|
|
||||||
width: 1 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader{
|
Loader{
|
||||||
|
|
@ -52,12 +51,13 @@ DesktopPopup {
|
||||||
id: background
|
id: background
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: backgroundLoader.status != Loader.Ready
|
visible: backgroundLoader.status != Loader.Ready
|
||||||
color: DefaultStyle.grey_0
|
color: mainItem.backgroundColor
|
||||||
radius: mainItem.radius
|
radius: mainItem.radius
|
||||||
border {
|
opacity: mainItem.backgroundOpacity
|
||||||
color: DefaultStyle.grey_400
|
// border {
|
||||||
width: 1 * DefaultStyle.dp
|
// color: DefaultStyle.grey_400
|
||||||
}
|
// width: 1 * DefaultStyle.dp
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
MultiEffect {
|
MultiEffect {
|
||||||
source: background
|
source: background
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,10 @@ import UtilsCpp
|
||||||
Notification {
|
Notification {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
radius: 20 * DefaultStyle.dp
|
radius: 20 * DefaultStyle.dp
|
||||||
overriddenWidth: 450 * DefaultStyle.dp//content.width
|
backgroundColor: DefaultStyle.grey_600
|
||||||
overriddenHeight: 101 * DefaultStyle.dp//content.height
|
backgroundOpacity: 0.8
|
||||||
|
overriddenWidth: 245 * DefaultStyle.dp//
|
||||||
|
overriddenHeight: content.height //126 * 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
|
||||||
|
|
@ -25,75 +27,85 @@ Notification {
|
||||||
Popup {
|
Popup {
|
||||||
id: content
|
id: content
|
||||||
visible: mainItem.visible
|
visible: mainItem.visible
|
||||||
width: parent.width
|
leftPadding: 16 * DefaultStyle.dp
|
||||||
height: parent.height
|
rightPadding: 16 * DefaultStyle.dp
|
||||||
leftPadding: 26 * DefaultStyle.dp
|
topPadding: 3 * DefaultStyle.dp
|
||||||
rightPadding: 26 * DefaultStyle.dp
|
bottomPadding: 3 * DefaultStyle.dp
|
||||||
topPadding: 15 * DefaultStyle.dp
|
anchors.centerIn: parent
|
||||||
bottomPadding: 15 * DefaultStyle.dp
|
|
||||||
background: Item{}
|
background: Item{}
|
||||||
contentItem: RowLayout {
|
contentItem: ColumnLayout {
|
||||||
spacing: 15 * DefaultStyle.dp
|
anchors.centerIn: parent
|
||||||
|
spacing: 9 * DefaultStyle.dp
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
spacing: 4 * DefaultStyle.dp
|
||||||
Layout.alignment: Qt.AlignLeft
|
Layout.alignment: Qt.AlignHCenter
|
||||||
spacing: 13 * DefaultStyle.dp
|
Image {
|
||||||
Layout.preferredHeight: childrenRect.height
|
Layout.preferredWidth: 10 * DefaultStyle.dp
|
||||||
Layout.preferredWidth: childrenRect.width
|
Layout.preferredHeight: 10 * DefaultStyle.dp
|
||||||
Avatar {
|
source: AppIcons.logo
|
||||||
Layout.preferredWidth: 45 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 45 * DefaultStyle.dp
|
|
||||||
call: mainItem.call
|
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
Text {
|
||||||
Text {
|
text: "Linphone"
|
||||||
text: call.core.remoteName
|
color: DefaultStyle.grey_0
|
||||||
Layout.fillWidth: true
|
font {
|
||||||
Layout.maximumWidth: 200 * DefaultStyle.dp
|
pixelSize: 8 * DefaultStyle.dp
|
||||||
maximumLineCount: 1
|
weight: 600 * DefaultStyle.dp
|
||||||
color: DefaultStyle.grey_600
|
capitalization: Font.Capitalize
|
||||||
font {
|
}
|
||||||
pixelSize: 20 * DefaultStyle.dp
|
}
|
||||||
weight: 800 * DefaultStyle.dp
|
}
|
||||||
capitalization: Font.Capitalize
|
ColumnLayout {
|
||||||
}
|
spacing: 2 * DefaultStyle.dp
|
||||||
}
|
Layout.alignment: Qt.AlignHCenter
|
||||||
RowLayout {
|
Avatar {
|
||||||
EffectImage {
|
Layout.preferredWidth: 40 * DefaultStyle.dp
|
||||||
imageSource: AppIcons.arrowDownLeft
|
Layout.preferredHeight: 40 * DefaultStyle.dp
|
||||||
colorizationColor: DefaultStyle.success_500main
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
call: mainItem.call
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
}
|
||||||
}
|
Text {
|
||||||
Text {
|
text: call.core.remoteName
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
property var localAddress: UtilsCpp.getDisplayName(call.core.localAddress)
|
Layout.maximumWidth: 200 * DefaultStyle.dp
|
||||||
text: qsTr("Appel entrant")//.arg(localAddress ? qsTr(" pour %1").arg(localAddress.value) : "") //call.core.remoteAddress
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: DefaultStyle.grey_600
|
horizontalAlignment: Text.AlignHCenter
|
||||||
font {
|
maximumLineCount: 1
|
||||||
pixelSize: 13 * DefaultStyle.dp
|
color: DefaultStyle.grey_0
|
||||||
weight: 400 * DefaultStyle.dp
|
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 {
|
RowLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 26 * DefaultStyle.dp
|
spacing: 26 * DefaultStyle.dp
|
||||||
Button {
|
Button {
|
||||||
|
spacing: 6 * DefaultStyle.dp
|
||||||
color: DefaultStyle.success_500main
|
color: DefaultStyle.success_500main
|
||||||
Layout.preferredWidth: 75 * DefaultStyle.dp
|
borderColor: color
|
||||||
Layout.preferredHeight: 55 * DefaultStyle.dp
|
Layout.preferredWidth: 93 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 25 * DefaultStyle.dp
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
contentItem: EffectImage {
|
icon.source: AppIcons.phone
|
||||||
colorizationColor: DefaultStyle.grey_0
|
icon.width: 14 * DefaultStyle.dp
|
||||||
imageSource: AppIcons.phone
|
icon.height: 14 * DefaultStyle.dp
|
||||||
imageWidth: 32 * DefaultStyle.dp
|
contentImageColor: DefaultStyle.grey_0
|
||||||
imageHeight: 32 * DefaultStyle.dp
|
text: qsTr("Répondre")
|
||||||
}
|
textColor: DefaultStyle.grey_0
|
||||||
|
textSize: 10 * DefaultStyle.dp
|
||||||
|
textWeight: 500 * DefaultStyle.dp
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.debug("[NotificationReceivedCall] Accept click")
|
console.debug("[NotificationReceivedCall] Accept click")
|
||||||
UtilsCpp.openCallsWindow(mainItem.call)
|
UtilsCpp.openCallsWindow(mainItem.call)
|
||||||
|
|
@ -101,16 +113,20 @@ Notification {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
|
spacing: 6 * DefaultStyle.dp
|
||||||
color: DefaultStyle.danger_500main
|
color: DefaultStyle.danger_500main
|
||||||
Layout.preferredWidth: 75 * DefaultStyle.dp
|
borderColor: color
|
||||||
Layout.preferredHeight: 55 * DefaultStyle.dp
|
Layout.preferredWidth: 93 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 25 * DefaultStyle.dp
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
contentItem: EffectImage {
|
icon.source: AppIcons.endCall
|
||||||
colorizationColor: DefaultStyle.grey_0
|
icon.width: 14 * DefaultStyle.dp
|
||||||
imageSource: AppIcons.endCall
|
icon.height: 14 * DefaultStyle.dp
|
||||||
imageWidth: 32 * DefaultStyle.dp
|
contentImageColor: DefaultStyle.grey_0
|
||||||
imageHeight: 32 * DefaultStyle.dp
|
text: qsTr("Refuser")
|
||||||
}
|
textColor: DefaultStyle.grey_0
|
||||||
|
textSize: 10 * DefaultStyle.dp
|
||||||
|
textWeight: 500 * DefaultStyle.dp
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.debug("[NotificationReceivedCall] Decline click")
|
console.debug("[NotificationReceivedCall] Decline click")
|
||||||
mainItem.call.core.lDecline()
|
mainItem.call.core.lDecline()
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import QtQuick
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
property string welcomeLinphoneLogo: "image://internal/linphone.svg"
|
property string welcomeLinphoneLogo: "image://internal/linphone.svg"
|
||||||
|
property string logo: "image://internal/logo.svg"
|
||||||
property string welcomeLock: "image://internal/secured.svg"
|
property string welcomeLock: "image://internal/secured.svg"
|
||||||
property string lock: "image://internal/lock.svg"
|
property string lock: "image://internal/lock.svg"
|
||||||
property string lockSimple: "image://internal/lock-simple.svg"
|
property string lockSimple: "image://internal/lock-simple.svg"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue