mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-19 07:18:24 +00:00
- Split content type to be filtered by proxy lists. - Add a message in notification when receiving a conference invitation. - Change chat bubbles colors to match mobile application. - Change date display on messages to remove sections. It allows to be more coherent when sorting messages. - Change Chat Layout : outgoing messages to right, incoming messages to left. - Change bubble design to be squared when grouped. - Group messages on 1 second away from previous (and same sender). - Add a background color with radius to files in reply messages. - Make color corners on reply. - Fix filename to 2 lines in file download icon. - Add a background color on conference invitations. - Change conference title from bold to normal on invitations. - Rework chat message content layout to be used with grids and lists : files are now displayed in grid. - Remove cyclic dependencies with reply design (which was recursivly linked with ChatContent). - Fix center layouts that were not bind to the correct one. - Align pictures to center. - Fix hidden admin usernames in participant view.
135 lines
4 KiB
QML
135 lines
4 KiB
QML
import QtQuick 2.7
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import Linphone 1.0
|
|
import Linphone.Styles 1.0
|
|
import Common 1.0
|
|
|
|
import UtilsCpp 1.0
|
|
// =============================================================================
|
|
|
|
Column {
|
|
id:mainItem
|
|
property alias titleText: title.fullText
|
|
property alias subtitleText: subtitle.fullText
|
|
property string sipAddress
|
|
|
|
property alias statusText : status.text
|
|
|
|
property var contactDescriptionStyle : ContactDescriptionStyle
|
|
|
|
property color subtitleColor: contactDescriptionStyle.subtitle.colorModel.color
|
|
property color titleColor: contactDescriptionStyle.title.colorModel.color
|
|
property int horizontalTextAlignment
|
|
property int contentWidth : Math.max(titleImplicitWidthWorkaround.implicitWidth, subtitleImplicitWidthWorkaround.implicitWidth)
|
|
+10
|
|
+statusWidth
|
|
property int contentHeight : Math.max(title.implicitHeight, subtitle.implicitHeight)+10
|
|
|
|
readonly property int statusWidth : (status.visible ? status.width + 5 : 0)
|
|
|
|
property bool titleClickable: false
|
|
|
|
signal titleClicked()
|
|
|
|
// ---------------------------------------------------------------------------
|
|
Item{
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
height: (parent.height-parent.topPadding-parent.bottomPadding)/parent.visibleChildren.length
|
|
RowLayout{
|
|
anchors.fill: parent
|
|
TextEdit {
|
|
id: title
|
|
property string fullText
|
|
Layout.fillWidth: true
|
|
color: titleColor
|
|
font.family: SettingsModel.textMessageFont.family
|
|
font.weight: contactDescriptionStyle.title.weight
|
|
font.pointSize: contactDescriptionStyle.title.pointSize
|
|
textFormat: Text.RichText
|
|
horizontalAlignment: horizontalTextAlignment
|
|
verticalAlignment: (subtitle.visible?Text.AlignBottom:Text.AlignVCenter)
|
|
text: UtilsCpp.encodeTextToQmlRichFormat(metrics.elidedText, {noLink:true})
|
|
onActiveFocusChanged: deselect();
|
|
readOnly: true
|
|
selectByMouse: true
|
|
Layout.preferredHeight: parent.height
|
|
|
|
Text{// Workaround to get implicitWidth from text without eliding
|
|
id: titleImplicitWidthWorkaround
|
|
text: title.fullText
|
|
font.family: SettingsModel.textMessageFont.family
|
|
font.weight: title.font.weight
|
|
font.pointSize: title.font.pointSize
|
|
textFormat: Text.RichText
|
|
visible: false
|
|
}
|
|
|
|
TextMetrics {
|
|
id: metrics
|
|
font: title.font
|
|
text: title.fullText
|
|
elideWidth: title.width
|
|
elide: Qt.ElideRight
|
|
}
|
|
}
|
|
Text{
|
|
id:status
|
|
Layout.alignment: Qt.AlignVCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
visible: text != ''
|
|
text : ''
|
|
color: contactDescriptionStyle.title.status.colorModel.color
|
|
font.pointSize: contactDescriptionStyle.title.status.pointSize
|
|
font.italic : true
|
|
}
|
|
}
|
|
MouseArea{
|
|
anchors.fill:parent
|
|
visible: titleClickable
|
|
onClicked: titleClicked()
|
|
}
|
|
}
|
|
Item{
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
height: (parent.height-parent.topPadding-parent.bottomPadding)/parent.visibleChildren.length
|
|
visible: subtitle.fullText != ''
|
|
TextEdit {
|
|
id:subtitle
|
|
property string fullText
|
|
anchors.fill: parent
|
|
color: subtitleColor
|
|
font.family: SettingsModel.textMessageFont.family
|
|
font.weight: contactDescriptionStyle.subtitle.weight
|
|
font.pointSize: contactDescriptionStyle.subtitle.pointSize
|
|
textFormat: Text.RichText
|
|
horizontalAlignment: horizontalTextAlignment
|
|
verticalAlignment: (title.visible?Text.AlignTop:Text.AlignVCenter)
|
|
|
|
text: UtilsCpp.encodeTextToQmlRichFormat(subtitleMetrics.elidedText, {noLink:true})
|
|
|
|
onActiveFocusChanged: deselect();
|
|
readOnly: true
|
|
selectByMouse: true
|
|
Text{// Workaround to get implicitWidth from text without eliding
|
|
id: subtitleImplicitWidthWorkaround
|
|
text: subtitle.fullText
|
|
font.weight: subtitle.font.weight
|
|
font.pointSize: subtitle.font.pointSize
|
|
visible: false
|
|
textFormat: Text.RichText
|
|
}
|
|
|
|
TextMetrics {
|
|
id: subtitleMetrics
|
|
font: subtitle.font
|
|
text: subtitle.fullText
|
|
elideWidth: subtitle.width
|
|
elide: Qt.ElideRight
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|