fix(chat): display correctly busy indicator when a message is sent

This commit is contained in:
Ronan Abhamon 2017-08-04 12:19:27 +02:00
parent bfef418741
commit 21e74f2734
4 changed files with 29 additions and 5 deletions

View file

@ -137,7 +137,7 @@ Rectangle {
ChatStyle.entry.message.extraContent.spacing +
ChatStyle.entry.message.extraContent.rightMargin +
ChatStyle.entry.message.extraContent.leftMargin +
ChatStyle.entry.message.outgoing.sendIconSize
ChatStyle.entry.message.outgoing.areaSize
}
color: ChatStyle.color

View file

@ -284,6 +284,8 @@ Row {
id: icon
Icon {
anchors.centerIn: parent
icon: rectangle.isNotDelivered
? 'chat_error'
: (rectangle.isRead ? 'chat_read' : 'chat_delivered')
@ -299,12 +301,22 @@ Row {
Component {
id: indicator
BusyIndicator {}
Item {
anchors.fill: parent
BusyIndicator {
anchors.centerIn: parent
height: ChatStyle.entry.message.outgoing.busyIndicatorSize
width: ChatStyle.entry.message.outgoing.busyIndicatorSize
}
}
}
Loader {
height: ChatStyle.entry.lineHeight
width: ChatStyle.entry.message.outgoing.sendIconSize
width: ChatStyle.entry.message.outgoing.areaSize
sourceComponent: $chatEntry.isOutgoing
? (

View file

@ -62,12 +62,22 @@ Item {
Component {
id: indicator
BusyIndicator {}
Item {
anchors.fill: parent
BusyIndicator {
anchors.centerIn: parent
height: ChatStyle.entry.message.outgoing.busyIndicatorSize
width: ChatStyle.entry.message.outgoing.busyIndicatorSize
}
}
}
Loader {
height: ChatStyle.entry.lineHeight
width: ChatStyle.entry.message.outgoing.sendIconSize
width: ChatStyle.entry.message.outgoing.areaSize
sourceComponent: $chatEntry.status === ChatModel.MessageStatusInProgress
? indicator

View file

@ -122,6 +122,8 @@ QtObject {
property QtObject outgoing: QtObject {
property color backgroundColor: Colors.e
property int areaSize: 16
property int busyIndicatorSize: 16
property int sendIconSize: 12
property QtObject text: QtObject {