Commit 5a3903dc authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Calls/Incall): use `Popup` in `CallStatistics`

parent 715d729b
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls import QtQuick.Controls 2.1 as Controls
import Common.Styles 1.0
import Utils 1.0 import Utils 1.0
// ============================================================================= // =============================================================================
Item { Item {
id: wrapper
// Optionnal parameters, set the position of popup relative to this item. // Optionnal parameters, set the position of popup relative to this item.
property var relativeTo property var relativeTo
property int relativeX: 0 property int relativeX: 0
...@@ -15,7 +18,7 @@ Item { ...@@ -15,7 +18,7 @@ Item {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
visible: false visible: false
function show () { function show () {
if (popup.visible) { if (popup.visible) {
...@@ -56,25 +59,25 @@ Item { ...@@ -56,25 +59,25 @@ Item {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Controls.Popup { Controls.Popup {
id: popup id: popup
height: wrapper._content.height
width: wrapper._content.width
background: Rectangle { background: Rectangle {
color: PopupStyle.backgroundColor
height: popup.height height: popup.height
width: popup.width width: popup.width
layer { layer {
enabled: true enabled: true
effect: PopupShadow {} effect: PopupShadow {}
} }
}
contentItem: Column {
id: internalData
} }
padding: 0 padding: 0
Component.onCompleted: parent = Utils.getTopParent(this) Component.onCompleted: parent = Utils.getTopParent(this)
} }
} }
...@@ -70,7 +70,6 @@ Collapse 1.0 Misc/Collapse.qml ...@@ -70,7 +70,6 @@ Collapse 1.0 Misc/Collapse.qml
ForceScrollBar 1.0 Misc/ForceScrollBar.qml ForceScrollBar 1.0 Misc/ForceScrollBar.qml
Paned 1.0 Misc/Paned.qml Paned 1.0 Misc/Paned.qml
AbstractDropDownMenu 1.0 Popup/AbstractDropDownMenu.qml
DesktopPopup 1.0 Popup/DesktopPopup.qml DesktopPopup 1.0 Popup/DesktopPopup.qml
DropDownDynamicMenu 1.0 Popup/DropDownDynamicMenu.qml DropDownDynamicMenu 1.0 Popup/DropDownDynamicMenu.qml
Popup 1.0 Popup/Popup.qml Popup 1.0 Popup/Popup.qml
......
...@@ -7,116 +7,111 @@ import Linphone.Styles 1.0 ...@@ -7,116 +7,111 @@ import Linphone.Styles 1.0
// ============================================================================= // =============================================================================
AbstractDropDownMenu { Popup {
id: callStatistics id: callStatistics
property var call property var call
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function _computeHeight () { Rectangle {
return CallStatisticsStyle.height color: CallStatisticsStyle.color
} height: CallStatisticsStyle.height
width: callStatistics.width
// ---------------------------------------------------------------------------
Component {
id: line
RowLayout {
spacing: CallStatisticsStyle.spacing
width: parent.width
// -----------------------------------------------------------------------
Text { Row {
Layout.preferredWidth: CallStatisticsStyle.key.width anchors {
fill: parent
topMargin: CallStatisticsStyle.topMargin
leftMargin: CallStatisticsStyle.leftMargin
rightMargin: CallStatisticsStyle.rightMargin
}
color: CallStatisticsStyle.key.color Loader {
elide: Text.ElideRight property string $label: qsTr('audioStatsLabel')
property var $data: callStatistics.call.audioStats
font { sourceComponent: media
pointSize: CallStatisticsStyle.key.fontSize width: parent.width / 2
bold: true }
}
horizontalAlignment: Text.AlignRight Loader {
verticalAlignment: Text.AlignVCenter property string $label: qsTr('videoStatsLabel')
property var $data: callStatistics.call.videoStats
text: modelData.key sourceComponent: media
width: parent.width / 2
} }
}
// ----------------------------------------------------------------------- // -------------------------------------------------------------------------
// Line.
// -------------------------------------------------------------------------
Text { Component {
Layout.fillWidth: true id: line
color: CallStatisticsStyle.value.color RowLayout {
elide: Text.ElideRight spacing: CallStatisticsStyle.spacing
font.pointSize: CallStatisticsStyle.value.fontSize width: parent.width
text: modelData.value Text {
} Layout.preferredWidth: CallStatisticsStyle.key.width
}
}
// --------------------------------------------------------------------------- color: CallStatisticsStyle.key.color
elide: Text.ElideRight
Component { font {
id: media pointSize: CallStatisticsStyle.key.fontSize
bold: true
}
Column { horizontalAlignment: Text.AlignRight
Text { verticalAlignment: Text.AlignVCenter
color: CallStatisticsStyle.title.color
font { text: modelData.key
bold: true
pointSize: CallStatisticsStyle.title.fontSize
} }
elide: Text.ElideRight Text {
horizontalAlignment: Text.AlignHCenter Layout.fillWidth: true
text: $label
height: contentHeight + CallStatisticsStyle.title.bottomMargin color: CallStatisticsStyle.value.color
width: parent.width elide: Text.ElideRight
} font.pointSize: CallStatisticsStyle.value.fontSize
Repeater { text: modelData.value
model: $data }
delegate: line
} }
} }
}
// --------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Media.
// -------------------------------------------------------------------------
Rectangle { Component {
anchors.fill: parent id: media
color: CallStatisticsStyle.color
Row { Column {
anchors { Text {
fill: parent color: CallStatisticsStyle.title.color
topMargin: CallStatisticsStyle.topMargin
leftMargin: CallStatisticsStyle.leftMargin
rightMargin: CallStatisticsStyle.rightMargin
}
Loader { font {
property string $label: qsTr('audioStatsLabel') bold: true
property var $data: callStatistics.call.audioStats pointSize: CallStatisticsStyle.title.fontSize
}
sourceComponent: media elide: Text.ElideRight
width: parent.width / 2 horizontalAlignment: Text.AlignHCenter
} text: $label
Loader { height: contentHeight + CallStatisticsStyle.title.bottomMargin
property string $label: qsTr('videoStatsLabel') width: parent.width
property var $data: callStatistics.call.videoStats }
sourceComponent: media Repeater {
width: parent.width / 2 model: $data
delegate: line
}
} }
} }
} }
......
...@@ -64,7 +64,6 @@ ListView { ...@@ -64,7 +64,6 @@ ListView {
Popup { Popup {
id: popup id: popup
implicitWidth: actionMenu.width
relativeTo: callControls relativeTo: callControls
relativeX: callControls.width relativeX: callControls.width
......
...@@ -31,3 +31,5 @@ SmartSearchBar 1.0 SmartSearchBar/SmartSearchBar.qml ...@@ -31,3 +31,5 @@ SmartSearchBar 1.0 SmartSearchBar/SmartSearchBar.qml
TelKeypad 1.0 TelKeypad/TelKeypad.qml TelKeypad 1.0 TelKeypad/TelKeypad.qml
Timeline 1.0 Timeline/Timeline.qml Timeline 1.0 Timeline/Timeline.qml
SipAddressesView 1.0 View/SipAddressesView.qml
...@@ -24,7 +24,7 @@ function handleStatusChanged (status) { ...@@ -24,7 +24,7 @@ function handleStatusChanged (status) {
} }
telKeypad.visible = false telKeypad.visible = false
callStatistics.hideMenu() callStatistics.hide()
} }
} }
......
...@@ -70,7 +70,7 @@ Rectangle { ...@@ -70,7 +70,7 @@ Rectangle {
iconSize: CallStyle.header.iconSize iconSize: CallStyle.header.iconSize
useStates: false useStates: false
onClicked: callStatistics.showMenu() onClicked: callStatistics.show()
// See: http://www.linphone.org/docs/liblinphone/group__call__misc.html#ga62c7d3d08531b0cc634b797e273a0a73 // See: http://www.linphone.org/docs/liblinphone/group__call__misc.html#ga62c7d3d08531b0cc634b797e273a0a73
Timer { Timer {
...@@ -88,7 +88,6 @@ Rectangle { ...@@ -88,7 +88,6 @@ Rectangle {
call: incall.call call: incall.call
width: container.width width: container.width
launcher: callQuality
relativeTo: callQuality relativeTo: callQuality
relativeY: CallStyle.header.stats.relativeY relativeY: CallStyle.header.stats.relativeY
} }
......
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