mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-03 22:56:49 +00:00
fix(Calls): display correctly all menu entries on call
This commit is contained in:
parent
786f688e02
commit
d4b5066e59
2 changed files with 25 additions and 32 deletions
|
|
@ -15,10 +15,10 @@ Item {
|
|||
property alias relativeX: popup.relativeX
|
||||
property alias relativeY: popup.relativeY
|
||||
|
||||
property alias entryHeight: menuContent.entryHeight
|
||||
property alias entryWidth: menuContent.entryWidth
|
||||
property alias entryHeight: content.entryHeight
|
||||
property alias entryWidth: content.entryWidth
|
||||
|
||||
default property alias _content: menuContent.data
|
||||
default property alias _content: content.data
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -47,14 +47,13 @@ Item {
|
|||
onOpened: menu.opened()
|
||||
onClosed: menu.closed()
|
||||
|
||||
ColumnLayout {
|
||||
id: menuContent
|
||||
Column {
|
||||
id: content
|
||||
|
||||
property int entryHeight
|
||||
property int entryWidth
|
||||
|
||||
spacing: DropDownStaticMenuStyle.spacing
|
||||
height: menu._content.length
|
||||
width: menu.entryWidth
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,19 @@
|
|||
|
||||
// =============================================================================
|
||||
|
||||
var MAP_STATUS_TO_PARAMS = (function () {
|
||||
var CallModel = Linphone.CallModel
|
||||
var map = {}
|
||||
// -----------------------------------------------------------------------------
|
||||
// Helpers.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
map[CallModel.CallStatusConnected] = (function (call) {
|
||||
function getParams (call) {
|
||||
if (!call) {
|
||||
return
|
||||
}
|
||||
|
||||
var CallModel = Linphone.CallModel
|
||||
var status = call.status
|
||||
|
||||
if (status === CallModel.CallStatusConnected) {
|
||||
return {
|
||||
actions: [{
|
||||
handler: (function () { call.pausedByUser = true }),
|
||||
|
|
@ -25,15 +33,15 @@ var MAP_STATUS_TO_PARAMS = (function () {
|
|||
component: callActions,
|
||||
string: 'connected'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
map[CallModel.CallStatusEnded] = (function (call) {
|
||||
if (status === CallModel.CallStatusEnded) {
|
||||
return {
|
||||
string: 'ended'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
map[CallModel.CallStatusIncoming] = (function (call) {
|
||||
if (status === CallModel.CallStatusIncoming) {
|
||||
return {
|
||||
actions: [{
|
||||
name: qsTr('acceptAudioCall'),
|
||||
|
|
@ -48,18 +56,18 @@ var MAP_STATUS_TO_PARAMS = (function () {
|
|||
component: callActions,
|
||||
string: 'incoming'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
map[CallModel.CallStatusOutgoing] = (function (call) {
|
||||
if (status === CallModel.CallStatusOutgoing) {
|
||||
return {
|
||||
component: callAction,
|
||||
handler: call.terminate,
|
||||
icon: 'hangup',
|
||||
string: 'outgoing'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
map[CallModel.CallStatusPaused] = (function (call) {
|
||||
if (status === CallModel.CallStatusPaused) {
|
||||
return {
|
||||
actions: [(call.pausedByUser ? {
|
||||
handler: (function () { call.pausedByUser = false }),
|
||||
|
|
@ -77,23 +85,9 @@ var MAP_STATUS_TO_PARAMS = (function () {
|
|||
component: callActions,
|
||||
string: 'paused'
|
||||
}
|
||||
})
|
||||
|
||||
return map;
|
||||
})()
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
function getParams (call) {
|
||||
if (call) {
|
||||
return MAP_STATUS_TO_PARAMS[call.status](call)
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Helpers.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
function updateSelectedCall (call, index) {
|
||||
calls._selectedCall = call
|
||||
if (index != null) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue