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