Commit fedf0cae authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/IncallFullscreen): escape quit fullscreen

parent ffd3b4b4
......@@ -30,6 +30,9 @@ Window {
// ---------------------------------------------------------------------------
height: Screen.height
width: Screen.width
visible: true
visibility: Window.FullScreen
......@@ -40,193 +43,196 @@ Window {
Rectangle {
anchors.fill: parent
color: '#000000' // Not a style.
}
focus: true
Camera {
id: camera
Keys.onEscapePressed: incall.close()
anchors.fill: parent
call: incall.call
}
Camera {
id: camera
ColumnLayout {
anchors {
fill: parent
topMargin: CallStyle.header.topMargin
anchors.fill: parent
call: incall.call
}
spacing: 0
// -------------------------------------------------------------------------
// Call info.
// -------------------------------------------------------------------------
Item {
id: info
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.leftMargin: CallStyle.header.leftMargin
Layout.rightMargin: CallStyle.header.rightMargin
Layout.preferredHeight: CallStyle.header.contactDescription.height
Icon {
id: callQuality
anchors.left: parent.left
icon: 'call_quality_0'
iconSize: CallStyle.header.iconSize
// See: http://www.linphone.org/docs/liblinphone/group__call__misc.html#ga62c7d3d08531b0cc634b797e273a0a73
Timer {
interval: 5000
repeat: true
running: true
triggeredOnStart: true
onTriggered: {
var quality = call.quality
callQuality.icon = 'call_quality_' + (
// Note: `quality` is in the [0, 5] interval.
// It's necessary to map in the `call_quality_` interval. ([0, 3])
quality >= 0 ? Math.round(quality / (5 / 3)) : 0
)
}
}
ColumnLayout {
anchors {
fill: parent
topMargin: CallStyle.header.topMargin
}
spacing: 0
// -----------------------------------------------------------------------
// Timer.
// Call info.
// -----------------------------------------------------------------------
Text {
id: elapsedTime
Item {
id: info
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.leftMargin: CallStyle.header.leftMargin
Layout.rightMargin: CallStyle.header.rightMargin
Layout.preferredHeight: CallStyle.header.contactDescription.height
Icon {
id: callQuality
anchors.left: parent.left
icon: 'call_quality_0'
iconSize: CallStyle.header.iconSize
// See: http://www.linphone.org/docs/liblinphone/group__call__misc.html#ga62c7d3d08531b0cc634b797e273a0a73
Timer {
interval: 5000
repeat: true
running: true
triggeredOnStart: true
onTriggered: {
var quality = call.quality
callQuality.icon = 'call_quality_' + (
// Note: `quality` is in the [0, 5] interval.
// It's necessary to map in the `call_quality_` interval. ([0, 3])
quality >= 0 ? Math.round(quality / (5 / 3)) : 0
)
}
}
}
anchors.fill: parent
// ---------------------------------------------------------------------
// Timer.
// ---------------------------------------------------------------------
font.pointSize: CallStyle.header.elapsedTime.fullscreenFontSize
Text {
id: elapsedTime
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
anchors.fill: parent
// Not a customizable style.
color: 'white'
style: Text.Raised
styleColor: 'black'
font.pointSize: CallStyle.header.elapsedTime.fullscreenFontSize
Component.onCompleted: {
var updateDuration = function () {
text = Utils.formatElapsedTime(call.duration)
Utils.setTimeout(elapsedTime, 1000, updateDuration)
}
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// Not a customizable style.
color: 'white'
style: Text.Raised
styleColor: 'black'
updateDuration()
Component.onCompleted: {
var updateDuration = function () {
text = Utils.formatElapsedTime(call.duration)
Utils.setTimeout(elapsedTime, 1000, updateDuration)
}
updateDuration()
}
}
}
// -----------------------------------------------------------------------
// Video actions.
// -----------------------------------------------------------------------
// ---------------------------------------------------------------------
// Video actions.
// ---------------------------------------------------------------------
ActionBar {
anchors.right: parent.right
iconSize: CallStyle.header.iconSize
ActionBar {
anchors.right: parent.right
iconSize: CallStyle.header.iconSize
ActionButton {
icon: 'screenshot'
ActionButton {
icon: 'screenshot'
onClicked: call.takeSnapshot()
}
onClicked: call.takeSnapshot()
}
ActionSwitch {
enabled: call.recording
icon: 'record'
useStates: false
ActionSwitch {
enabled: call.recording
icon: 'record'
useStates: false
onClicked: !enabled ? call.startRecording() : call.stopRecording()
}
onClicked: !enabled ? call.startRecording() : call.stopRecording()
}
ActionButton {
icon: 'fullscreen'
ActionButton {
icon: 'fullscreen'
onClicked: _exit()
}
}
}
onClicked: _exit()
}
}
}
// -------------------------------------------------------------------------
// Action Buttons.
// -------------------------------------------------------------------------
// -----------------------------------------------------------------------
// Action Buttons.
// -----------------------------------------------------------------------
Item {
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Layout.preferredHeight: CallStyle.actionArea.height
Item {
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Layout.preferredHeight: CallStyle.actionArea.height
GridLayout {
anchors {
left: parent.left
leftMargin: CallStyle.actionArea.leftButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
GridLayout {
anchors {
left: parent.left
leftMargin: CallStyle.actionArea.leftButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
rowSpacing: ActionBarStyle.spacing
rowSpacing: ActionBarStyle.spacing
ActionSwitch {
enabled: !call.microMuted
icon: 'micro'
iconSize: CallStyle.actionArea.iconSize
ActionSwitch {
enabled: !call.microMuted
icon: 'micro'
iconSize: CallStyle.actionArea.iconSize
onClicked: call.microMuted = enabled
}
onClicked: call.microMuted = enabled
}
ActionSwitch {
enabled: true
icon: 'camera'
iconSize: CallStyle.actionArea.iconSize
updating: call.updating
ActionSwitch {
enabled: true
icon: 'camera'
iconSize: CallStyle.actionArea.iconSize
updating: call.updating
onClicked: _exit(function () { call.videoEnabled = false })
}
onClicked: _exit(function () { call.videoEnabled = false })
}
ActionButton {
Layout.preferredHeight: CallStyle.actionArea.iconSize
Layout.preferredWidth: CallStyle.actionArea.iconSize
icon: 'options' // TODO: display options.
iconSize: CallStyle.actionArea.iconSize
ActionButton {
Layout.preferredHeight: CallStyle.actionArea.iconSize
Layout.preferredWidth: CallStyle.actionArea.iconSize
icon: 'options' // TODO: display options.
iconSize: CallStyle.actionArea.iconSize
}
}
}
Camera {
anchors.centerIn: parent
height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width
Camera {
anchors.centerIn: parent
height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width
isPreview: true
isPreview: true
call: incall.call
}
ActionBar {
anchors {
right: parent.right
rightMargin: CallStyle.actionArea.rightButtonsGroupMargin
verticalCenter: parent.verticalCenter
call: incall.call
}
iconSize: CallStyle.actionArea.iconSize
ActionSwitch {
enabled: !call.pausedByUser
icon: 'pause'
updating: call.updating
ActionBar {
anchors {
right: parent.right
rightMargin: CallStyle.actionArea.rightButtonsGroupMargin
verticalCenter: parent.verticalCenter
}
iconSize: CallStyle.actionArea.iconSize
ActionSwitch {
enabled: !call.pausedByUser
icon: 'pause'
updating: call.updating
onClicked: _exit(function () { call.pausedByUser = enabled })
}
onClicked: _exit(function () { call.pausedByUser = enabled })
}
ActionButton {
icon: 'hangup'
ActionButton {
icon: 'hangup'
onClicked: _exit(call.terminate)
onClicked: _exit(call.terminate)
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment