feat(StatusChatListItem): add online badge
This commit is contained in:
parent
efc5be38bd
commit
b1025fabd7
|
@ -123,6 +123,7 @@ Column {
|
||||||
asset.isImage: model.icon.includes("data")
|
asset.isImage: model.icon.includes("data")
|
||||||
asset.name: model.icon
|
asset.name: model.icon
|
||||||
ringSettings.ringSpecModel: model.colorHash
|
ringSettings.ringSpecModel: model.colorHash
|
||||||
|
onlineStatus: model.onlineStatus
|
||||||
|
|
||||||
sensor.cursorShape: dragSensor.cursorShape
|
sensor.cursorShape: dragSensor.cursorShape
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ Rectangle {
|
||||||
property bool hasUnreadMessages: false
|
property bool hasUnreadMessages: false
|
||||||
property int notificationsCount: 0
|
property int notificationsCount: 0
|
||||||
property bool muted: false
|
property bool muted: false
|
||||||
|
property int onlineStatus: StatusChatListItem.OnlineStatus.Inactive
|
||||||
|
|
||||||
property StatusAssetSettings asset: StatusAssetSettings {
|
property StatusAssetSettings asset: StatusAssetSettings {
|
||||||
width: 24
|
width: 24
|
||||||
|
@ -50,6 +51,11 @@ Rectangle {
|
||||||
CommunityChat // 6
|
CommunityChat // 6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OnlineStatus {
|
||||||
|
Inactive,
|
||||||
|
Online
|
||||||
|
}
|
||||||
|
|
||||||
implicitWidth: 288
|
implicitWidth: 288
|
||||||
implicitHeight: 40
|
implicitHeight: 40
|
||||||
|
|
||||||
|
@ -84,6 +90,15 @@ Rectangle {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
asset: root.asset
|
asset: root.asset
|
||||||
name: root.name
|
name: root.name
|
||||||
|
|
||||||
|
badge {
|
||||||
|
visible: type === StatusChatListItem.Type.OneToOneChat
|
||||||
|
color: onlineStatus === StatusChatListItem.OnlineStatus.Online ? Theme.palette.successColor1 : Theme.palette.baseColor1
|
||||||
|
border.width: 1
|
||||||
|
border.color: root.color
|
||||||
|
implicitHeight: 9
|
||||||
|
implicitWidth: 9
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusIcon {
|
StatusIcon {
|
||||||
|
|
|
@ -99,6 +99,8 @@ Loader {
|
||||||
visible: false
|
visible: false
|
||||||
anchors.bottom: root.bottom
|
anchors.bottom: root.bottom
|
||||||
anchors.right: root.right
|
anchors.right: root.right
|
||||||
|
anchors.rightMargin: -border.width
|
||||||
|
anchors.bottomMargin: -border.width
|
||||||
border.width: 3
|
border.width: 3
|
||||||
implicitHeight: 15
|
implicitHeight: 15
|
||||||
implicitWidth: 15
|
implicitWidth: 15
|
||||||
|
|
Loading…
Reference in New Issue