Commit f50be474 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Linphone/Codecs): in progress

parent 01e54c5c
...@@ -240,27 +240,27 @@ Server url not configured.</translation> ...@@ -240,27 +240,27 @@ Server url not configured.</translation>
<name>CodecsViewer</name> <name>CodecsViewer</name>
<message> <message>
<source>codecMime</source> <source>codecMime</source>
<translation type="unfinished"></translation> <translation>Name</translation>
</message> </message>
<message> <message>
<source>codecEncoderDescription</source> <source>codecEncoderDescription</source>
<translation type="unfinished"></translation> <translation>Description</translation>
</message> </message>
<message> <message>
<source>codecEncoderClockRate</source> <source>codecEncoderClockRate</source>
<translation type="unfinished"></translation> <translation>Rate (Hz)</translation>
</message> </message>
<message> <message>
<source>codecBitrate</source> <source>codecBitrate</source>
<translation type="unfinished"></translation> <translation>Bitrate (Kbit/s)</translation>
</message> </message>
<message> <message>
<source>codecRecvFmtp</source> <source>codecRecvFmtp</source>
<translation type="unfinished"></translation> <translation>Parameters</translation>
</message> </message>
<message> <message>
<source>codecStatus</source> <source>codecStatus</source>
<translation type="unfinished"></translation> <translation>Status</translation>
</message> </message>
</context> </context>
<context> <context>
......
...@@ -5,7 +5,7 @@ import Linphone.Styles 1.0 ...@@ -5,7 +5,7 @@ import Linphone.Styles 1.0
// ============================================================================= // =============================================================================
Text { Text {
color: CodecsViewerStyle.attribute.color color: CodecsViewerStyle.attribute.text.color
elide: Text.ElideRight elide: Text.ElideRight
font.pointSize: CodecsViewerStyle.attribute.fontSize font.pointSize: CodecsViewerStyle.attribute.text.fontSize
} }
...@@ -12,6 +12,4 @@ Text { ...@@ -12,6 +12,4 @@ Text {
bold: true bold: true
pointSize: CodecsViewerStyle.legend.fontSize pointSize: CodecsViewerStyle.legend.fontSize
} }
horizontalAlignment: Text.AlignHCenter
} }
...@@ -14,7 +14,7 @@ Column { ...@@ -14,7 +14,7 @@ Column {
// Header. // Header.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Row { RowLayout {
anchors { anchors {
left: parent.left left: parent.left
leftMargin: CodecsViewerStyle.leftMargin leftMargin: CodecsViewerStyle.leftMargin
...@@ -50,6 +50,9 @@ Column { ...@@ -50,6 +50,9 @@ Column {
} }
CodecLegend { CodecLegend {
Layout.fillWidth: true
Layout.leftMargin: 10
text: qsTr('codecStatus') text: qsTr('codecStatus')
} }
} }
...@@ -76,6 +79,10 @@ Column { ...@@ -76,6 +79,10 @@ Column {
model: DelegateModel { model: DelegateModel {
id: visualModel id: visualModel
// -----------------------------------------------------------------------
// One codec.
// -----------------------------------------------------------------------
delegate: MouseArea { delegate: MouseArea {
id: dragArea id: dragArea
...@@ -88,15 +95,23 @@ Column { ...@@ -88,15 +95,23 @@ Column {
drag { drag {
axis: Drag.YAxis axis: Drag.YAxis
maximumY: (view.count - DelegateModel.itemsIndex) * height - height
minimumY: -DelegateModel.itemsIndex * height
target: held ? content : undefined target: held ? content : undefined
} }
height: CodecsViewerStyle.attribute.height height: CodecsViewerStyle.attribute.height
onPressAndHold: held = true onPressed: held = true
onReleased: held = false onReleased: {
held = false
RowLayout { content.y = 0
}
Rectangle {
id: content id: content
Drag.active: dragArea.held Drag.active: dragArea.held
...@@ -104,45 +119,57 @@ Column { ...@@ -104,45 +119,57 @@ Column {
Drag.hotSpot.x: width / 2 Drag.hotSpot.x: width / 2
Drag.hotSpot.y: height / 2 Drag.hotSpot.y: height / 2
color: CodecsViewerStyle.attribute.background.color.normal
height: dragArea.height height: dragArea.height
width: dragArea.width width: dragArea.width
spacing: CodecsViewerStyle.column.spacing RowLayout {
anchors.fill: parent
CodecAttribute { spacing: CodecsViewerStyle.column.spacing
Layout.preferredWidth: CodecsViewerStyle.column.mimeWidth
text: $codec.mime
}
CodecAttribute { CodecAttribute {
Layout.preferredWidth: CodecsViewerStyle.column.encoderDescriptionWidth Layout.preferredWidth: CodecsViewerStyle.column.mimeWidth
text: $codec.encoderDescription text: $codec.mime
} }
CodecAttribute { CodecAttribute {
Layout.preferredWidth: CodecsViewerStyle.column.clockRateWidth Layout.preferredWidth: CodecsViewerStyle.column.encoderDescriptionWidth
text: $codec.clockRate text: $codec.encoderDescription
} }
CodecAttribute { CodecAttribute {
Layout.preferredWidth: CodecsViewerStyle.column.bitrateWidth Layout.preferredWidth: CodecsViewerStyle.column.clockRateWidth
text: $codec.bitrate text: $codec.clockRate
} }
TextField { CodecAttribute {
Layout.preferredWidth: CodecsViewerStyle.column.recvFmtpWidth Layout.preferredWidth: CodecsViewerStyle.column.bitrateWidth
text: $codec.recvFmtp text: $codec.bitrate
} }
TextField {
Layout.preferredWidth: CodecsViewerStyle.column.recvFmtpWidth
text: $codec.recvFmtp
}
Switch { Switch {
checked: $codec.enabled Layout.fillWidth: true
Layout.leftMargin: 10
onClicked: view.model.enableCodec(index, !checked) checked: $codec.enabled
onClicked: visualModel.model.enableCodec(index, !checked)
}
} }
} }
DropArea { DropArea {
anchors.fill: parent anchors {
fill: parent
margins: CodecsViewerStyle.attribute.dropArea.margins
}
onEntered: { onEntered: {
visualModel.items.move( visualModel.items.move(
...@@ -151,6 +178,28 @@ Column { ...@@ -151,6 +178,28 @@ Column {
) )
} }
} }
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onPressed: mouse.accepted = false
}
// ---------------------------------------------------------------------
// Animations/States codec.
// ---------------------------------------------------------------------
states: State {
when: mouseArea.containsMouse
PropertyChanges {
target: content
color: CodecsViewerStyle.attribute.background.color.hovered
}
}
} }
} }
} }
......
...@@ -9,23 +9,36 @@ QtObject { ...@@ -9,23 +9,36 @@ QtObject {
property int leftMargin: 10 property int leftMargin: 10
property QtObject attribute: QtObject { property QtObject attribute: QtObject {
property color color: Colors.j
property int fontSize: 10
property int height: 40 property int height: 40
property QtObject background: QtObject {
property QtObject color: QtObject {
property color normal: Colors.a
property color hovered: Colors.y
}
}
property QtObject dropArea: QtObject {
property int margins: 5
}
property QtObject text: QtObject {
property color color: Colors.j
property int fontSize: 10
}
} }
property QtObject column: QtObject { property QtObject column: QtObject {
property int spacing: 5 property int bitrateWidth: 120
property int bitrateWidth: 100
property int clockRateWidth: 100 property int clockRateWidth: 100
property int recvFmtpWidth: 200 property int encoderDescriptionWidth: 280
property int encoderDescriptionWidth: 300
property int mimeWidth: 100 property int mimeWidth: 100
property int recvFmtpWidth: 200
property int spacing: 5
} }
property QtObject legend: QtObject { property QtObject legend: QtObject {
property color color: Colors.k property color color: Colors.j
property int fontSize: 10 property int fontSize: 10
property int height: 50 property int height: 50
} }
......
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