Finesse mobile call invite screen

This commit is contained in:
trilene 2021-01-13 16:00:41 -05:00
parent ebe61701d9
commit dfe2f7dc57
1 changed files with 37 additions and 28 deletions

View File

@ -34,14 +34,9 @@ Popup {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
spacing: 48
Item {
Layout.fillHeight: true
}
Label { Label {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.topMargin: msgView.height / 25
text: CallManager.callParty text: CallManager.callParty
font.pointSize: fontMetrics.font.pointSize * 2 font.pointSize: fontMetrics.font.pointSize * 2
color: colors.windowText color: colors.windowText
@ -49,20 +44,21 @@ Popup {
Avatar { Avatar {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
width: avatarSize * 4 width: msgView.height / 5
height: avatarSize * 4 height: msgView.height / 5
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/") url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
displayName: CallManager.callParty displayName: CallManager.callParty
} }
ColumnLayout { ColumnLayout {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: msgView.height / 25
Image { Image {
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: avatarSize
Layout.preferredHeight: avatarSize
property string image: CallManager.isVideo ? ":/icons/icons/ui/video-call.png" : ":/icons/icons/ui/place-call.png" property string image: CallManager.isVideo ? ":/icons/icons/ui/video-call.png" : ":/icons/icons/ui/place-call.png"
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: msgView.height / 10
Layout.preferredHeight: msgView.height / 10
source: "image://colorimage/" + image + "?" + colors.windowText source: "image://colorimage/" + image + "?" + colors.windowText
} }
@ -76,8 +72,10 @@ Popup {
ColumnLayout { ColumnLayout {
id: deviceCombos id: deviceCombos
property int imageSize: msgView.height / 20
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
property int imageSize: 32 Layout.bottomMargin: msgView.height / 25
RowLayout { RowLayout {
@ -118,9 +116,9 @@ Popup {
RowLayout { RowLayout {
id: buttonLayout id: buttonLayout
property int iconSize: 64 property int buttonSize: msgView.height / 8
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
spacing: 160 spacing: msgView.height / 6
function validateMic() { function validateMic() {
if (CallManager.mics.length == 0) { if (CallManager.mics.length == 0) {
@ -135,11 +133,17 @@ Popup {
} }
RoundButton { RoundButton {
icon.source: "qrc:/icons/icons/ui/end-call.png" implicitWidth: buttonLayout.buttonSize
icon.width: buttonLayout.iconSize implicitHeight: buttonLayout.buttonSize
icon.height: buttonLayout.iconSize
icon.color: "#ffffff" background: Rectangle {
palette.button: "#ff0000" radius: buttonLayout.buttonSize / 2
color: "#ff0000"
}
contentItem : Image {
source: "image://colorimage/:/icons/icons/ui/end-call.png?#ffffff"
}
onClicked: { onClicked: {
CallManager.hangUp(); CallManager.hangUp();
@ -148,11 +152,20 @@ Popup {
} }
RoundButton { RoundButton {
icon.source: CallManager.isVideo ? "qrc:/icons/icons/ui/video-call.png" : "qrc:/icons/icons/ui/place-call.png" id: acceptButton
icon.width: buttonLayout.iconSize
icon.height: buttonLayout.iconSize property string image: CallManager.isVideo ? ":/icons/icons/ui/video-call.png" : ":/icons/icons/ui/place-call.png"
icon.color: "#ffffff" implicitWidth: buttonLayout.buttonSize
palette.button: "#00ff00" implicitHeight: buttonLayout.buttonSize
background: Rectangle {
radius: buttonLayout.buttonSize / 2
color: "#00ff00"
}
contentItem : Image {
source: "image://colorimage/" + acceptButton.image + "?#ffffff"
}
onClicked: { onClicked: {
if (buttonLayout.validateMic()) { if (buttonLayout.validateMic()) {
@ -165,9 +178,5 @@ Popup {
} }
} }
} }
Item {
Layout.fillHeight: true
}
} }
} }