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 { ...@@ -30,6 +30,9 @@ Window {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
height: Screen.height
width: Screen.width
visible: true visible: true
visibility: Window.FullScreen visibility: Window.FullScreen
...@@ -40,193 +43,196 @@ Window { ...@@ -40,193 +43,196 @@ Window {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: '#000000' // Not a style. color: '#000000' // Not a style.
} focus: true
Camera { Keys.onEscapePressed: incall.close()
id: camera
anchors.fill: parent Camera {
call: incall.call id: camera
}
ColumnLayout { anchors.fill: parent
anchors { call: incall.call
fill: parent
topMargin: CallStyle.header.topMargin
} }
spacing: 0 ColumnLayout {
anchors {
// ------------------------------------------------------------------------- fill: parent
// Call info. topMargin: CallStyle.header.topMargin
// -------------------------------------------------------------------------
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
)
}
}
} }
spacing: 0
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Timer. // Call info.
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
Text { Item {
id: elapsedTime 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 anchors.fill: parent
verticalAlignment: Text.AlignVCenter
// Not a customizable style. font.pointSize: CallStyle.header.elapsedTime.fullscreenFontSize
color: 'white'
style: Text.Raised
styleColor: 'black'
Component.onCompleted: { horizontalAlignment: Text.AlignHCenter
var updateDuration = function () { verticalAlignment: Text.AlignVCenter
text = Utils.formatElapsedTime(call.duration)
Utils.setTimeout(elapsedTime, 1000, updateDuration) // 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 { ActionBar {
anchors.right: parent.right anchors.right: parent.right
iconSize: CallStyle.header.iconSize iconSize: CallStyle.header.iconSize
ActionButton { ActionButton {
icon: 'screenshot' icon: 'screenshot'
onClicked: call.takeSnapshot() onClicked: call.takeSnapshot()
} }
ActionSwitch { ActionSwitch {
enabled: call.recording enabled: call.recording
icon: 'record' icon: 'record'
useStates: false useStates: false
onClicked: !enabled ? call.startRecording() : call.stopRecording() onClicked: !enabled ? call.startRecording() : call.stopRecording()
} }
ActionButton { ActionButton {
icon: 'fullscreen' icon: 'fullscreen'
onClicked: _exit() onClicked: _exit()
} }
} }
} }
// ------------------------------------------------------------------------- // -----------------------------------------------------------------------
// Action Buttons. // Action Buttons.
// ------------------------------------------------------------------------- // -----------------------------------------------------------------------
Item { Item {
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: CallStyle.actionArea.height Layout.preferredHeight: CallStyle.actionArea.height
GridLayout { GridLayout {
anchors { anchors {
left: parent.left left: parent.left
leftMargin: CallStyle.actionArea.leftButtonsGroupMargin leftMargin: CallStyle.actionArea.leftButtonsGroupMargin
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
rowSpacing: ActionBarStyle.spacing rowSpacing: ActionBarStyle.spacing
ActionSwitch { ActionSwitch {
enabled: !call.microMuted enabled: !call.microMuted
icon: 'micro' icon: 'micro'
iconSize: CallStyle.actionArea.iconSize iconSize: CallStyle.actionArea.iconSize
onClicked: call.microMuted = enabled onClicked: call.microMuted = enabled
} }
ActionSwitch { ActionSwitch {
enabled: true enabled: true
icon: 'camera' icon: 'camera'
iconSize: CallStyle.actionArea.iconSize iconSize: CallStyle.actionArea.iconSize
updating: call.updating updating: call.updating
onClicked: _exit(function () { call.videoEnabled = false }) onClicked: _exit(function () { call.videoEnabled = false })
} }
ActionButton { ActionButton {
Layout.preferredHeight: CallStyle.actionArea.iconSize Layout.preferredHeight: CallStyle.actionArea.iconSize
Layout.preferredWidth: CallStyle.actionArea.iconSize Layout.preferredWidth: CallStyle.actionArea.iconSize
icon: 'options' // TODO: display options. icon: 'options' // TODO: display options.
iconSize: CallStyle.actionArea.iconSize iconSize: CallStyle.actionArea.iconSize
}
} }
}
Camera { Camera {
anchors.centerIn: parent anchors.centerIn: parent
height: CallStyle.actionArea.userVideo.height height: CallStyle.actionArea.userVideo.height
width: CallStyle.actionArea.userVideo.width width: CallStyle.actionArea.userVideo.width
isPreview: true isPreview: true
call: incall.call call: incall.call
}
ActionBar {
anchors {
right: parent.right
rightMargin: CallStyle.actionArea.rightButtonsGroupMargin
verticalCenter: parent.verticalCenter
} }
iconSize: CallStyle.actionArea.iconSize
ActionSwitch { ActionBar {
enabled: !call.pausedByUser anchors {
icon: 'pause' right: parent.right
updating: call.updating 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 { ActionButton {
icon: 'hangup' 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