Commit ab2af5b5 authored by Ronan's avatar Ronan
Browse files

feat(Chat): use final style

parent 9461ba26
......@@ -188,28 +188,3 @@ ColumnLayout {
}
}
}
// Icons area.
/* Row { */
/* Layout.alignment: Qt.AlignTop */
/* Layout.preferredHeight: 30 */
/* Layout.preferredWidth: 54 */
/* spacing: 10 */
/* Icon { */
/* anchors.verticalCenter: parent.verticalCenter */
/* icon: ($type === 'event' && $content) || '' */
/* iconSize: 16 */
/* } */
/* ActionButton { */
/* anchors.verticalCenter: parent.verticalCenter */
/* icon: 'delete' */
/* iconSize: 16 */
/* id: removeAction */
/* onClicked: chat.model.remove(index) */
/* visible: false */
/* } */
/* } */
......@@ -8,6 +8,7 @@ import Utils 1.0
Row {
height: ChatStyle.entry.lineHeight
spacing: ChatStyle.entry.message.extraContent.spacing
Icon {
height: parent.height
......@@ -39,4 +40,13 @@ Row {
text: qsTr(Utils.snakeToCamel($content))
verticalAlignment: Text.AlignVCenter
}
ActionButton {
height: ChatStyle.entry.lineHeight
icon: 'delete'
iconSize: ChatStyle.entry.deleteIconSize
visible: isHoverEntry()
onClicked: deleteEntry()
}
}
......@@ -18,9 +18,9 @@ RowLayout {
Avatar {
anchors.centerIn: parent
height: ChatStyle.entry.message.incoming.avatarSize
username: contact.username
width: ChatStyle.entry.lineHeight
height: ChatStyle.entry.lineHeight
width: ChatStyle.entry.message.incoming.avatarSize
}
}
......
......@@ -7,17 +7,22 @@ import Linphone.Styles 1.0
// ===================================================================
RowLayout {
Item {
implicitHeight: message.height
spacing: 0
width: parent.width
Message {
id: message
Layout.fillWidth: true
anchors {
left: parent.left
leftMargin: ChatStyle.entry.metaWidth
right: parent.right
}
backgroundColor: ChatStyle.entry.message.outgoing.backgroundColor
color: ChatStyle.entry.message.outgoing.text.color
fontSize: ChatStyle.entry.message.outgoing.text.fontSize
width: parent.width
Row {
spacing: ChatStyle.entry.message.extraContent.spacing
......
......@@ -43,7 +43,16 @@ Item {
Text {
anchors.centerIn: parent
color: AvatarStyle.initials.color
font.pointSize: AvatarStyle.initials.fontSize
font.pointSize: {
var width
if (parent.width > 0) {
width = parent.width / AvatarStyle.initials.ratio
}
return AvatarStyle.initials.fontSize * (width || 1)
}
text: _computeInitials()
}
......
......@@ -58,6 +58,7 @@ QtObject {
property QtObject incoming: QtObject {
property color backgroundColor: '#D0D8DE'
property int avatarSize: 20
property QtObject text: QtObject {
property color color: '#595759'
......
......@@ -9,6 +9,7 @@ QtObject {
property QtObject initials: QtObject {
property color color: Colors.k
property int fontSize: 10
property int ratio: 30
}
property QtObject mask: QtObject {
......
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