Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Commit

Permalink
feat(StatusChatListItem): add online badge
Browse files Browse the repository at this point in the history
  • Loading branch information
osmaczko committed Sep 12, 2022
1 parent efc5be3 commit b1025fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/StatusQ/Components/StatusChatList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Column {
asset.isImage: model.icon.includes("data")
asset.name: model.icon
ringSettings.ringSpecModel: model.colorHash
onlineStatus: model.onlineStatus

sensor.cursorShape: dragSensor.cursorShape

Expand Down
15 changes: 15 additions & 0 deletions src/StatusQ/Components/StatusChatListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Rectangle {
property bool hasUnreadMessages: false
property int notificationsCount: 0
property bool muted: false
property int onlineStatus: StatusChatListItem.OnlineStatus.Inactive

property StatusAssetSettings asset: StatusAssetSettings {
width: 24
Expand Down Expand Up @@ -50,6 +51,11 @@ Rectangle {
CommunityChat // 6
}

enum OnlineStatus {
Inactive,
Online
}

implicitWidth: 288
implicitHeight: 40

Expand Down Expand Up @@ -84,6 +90,15 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
asset: root.asset
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 {
Expand Down
2 changes: 2 additions & 0 deletions src/StatusQ/Components/StatusSmartIdenticon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Loader {
visible: false
anchors.bottom: root.bottom
anchors.right: root.right
anchors.rightMargin: -border.width
anchors.bottomMargin: -border.width
border.width: 3
implicitHeight: 15
implicitWidth: 15
Expand Down

0 comments on commit b1025fa

Please sign in to comment.