Commit ab2af5b5 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Chat): use final style

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