diff --git a/ui/modules/Common/Menus/DropDownStaticMenu.qml b/ui/modules/Common/Menus/DropDownStaticMenu.qml index ef1977796..bb6a36b7f 100644 --- a/ui/modules/Common/Menus/DropDownStaticMenu.qml +++ b/ui/modules/Common/Menus/DropDownStaticMenu.qml @@ -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 } } diff --git a/ui/modules/Linphone/Calls/Calls.js b/ui/modules/Linphone/Calls/Calls.js index e49858bf7..3232b0627 100644 --- a/ui/modules/Linphone/Calls/Calls.js +++ b/ui/modules/Linphone/Calls/Calls.js @@ -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) {