Commit d4b5066e authored by Ronan's avatar Ronan

fix(Calls): display correctly all menu entries on call

parent 786f688e
......@@ -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 () {
// -----------------------------------------------------------------------------
// Helpers.
// -----------------------------------------------------------------------------
function getParams (call) {
if (!call) {
return
}
var CallModel = Linphone.CallModel
var map = {}
var status = call.status
map[CallModel.CallStatusConnected] = (function (call) {
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) {
......
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