Verified Commit 01a4f401 authored by Melvin Keskin's avatar Melvin Keskin Committed by Linus Jahn

Show presence indicator for contacts as vertical bar to left of avatar

parent 0fe0fadf
...@@ -46,17 +46,30 @@ Kirigami.SwipeListItem { ...@@ -46,17 +46,30 @@ Kirigami.SwipeListItem {
property int presenceType property int presenceType
property string statusMsg property string statusMsg
topPadding: Kirigami.Units.smallSpacing * 1.5 topPadding: 0
leftPadding: 0
bottomPadding: 0
height: Kirigami.Units.gridUnit * 3.5 height: Kirigami.Units.gridUnit * 3.5
RowLayout { RowLayout {
spacing: Kirigami.Units.gridUnit * 0.5 spacing: Kirigami.Units.gridUnit * 0.5
// left side: Avatar // left border: presence
Rectangle {
id: presenceIndicator
visible: presenceType !== Enums.PresInvisible
width: Kirigami.Units.gridUnit * 0.2
height: parent.height
color: presenceTypeToColor(presenceType)
}
// left: avatar
Item { Item {
id: avatarSpace id: avatarSpace
Layout.preferredHeight: parent.height Layout.preferredHeight: parent.height - Kirigami.Units.gridUnit * 0.8
Layout.preferredWidth: parent.height Layout.preferredWidth: parent.height - Kirigami.Units.gridUnit * 0.8
Controls.ToolTip { Controls.ToolTip {
visible: hovered && !Kirigami.Settings.isMobile visible: hovered && !Kirigami.Settings.isMobile
...@@ -82,28 +95,6 @@ Kirigami.SwipeListItem { ...@@ -82,28 +95,6 @@ Kirigami.SwipeListItem {
id: textAvatar id: textAvatar
name: listItem.name name: listItem.name
} }
Rectangle {
id: presenceIndicator
visible: presenceType !== 8 // invisible when presence is invalid
anchors.right: avatarSpace.right
anchors.bottom: avatarSpace.bottom
width: Kirigami.Units.gridUnit
height: Kirigami.Units.gridUnit
color: presenceTypeToColor(presenceType)
radius: Math.min(width, height) * 0.5
// shadow
layer.enabled: presenceIndicator.visible
layer.effect: DropShadow {
verticalOffset: Kirigami.Units.gridUnit * 0.08
horizontalOffset: Kirigami.Units.gridUnit * 0.08
color: Kirigami.Theme.disabledTextColor
samples: 10
spread: 0.1
}
}
} }
// right side // right side
...@@ -138,15 +129,15 @@ Kirigami.SwipeListItem { ...@@ -138,15 +129,15 @@ Kirigami.SwipeListItem {
font.pixelSize: Kirigami.Units.gridUnit * 0.8 font.pixelSize: Kirigami.Units.gridUnit * 0.8
} }
} }
}
// unread message counter // unread message counter
MessageCounter { MessageCounter {
visible: unreadMessages > 0 visible: unreadMessages > 0
counter: unreadMessages counter: unreadMessages
Layout.preferredHeight: Kirigami.Units.gridUnit * 1.25 Layout.preferredHeight: Kirigami.Units.gridUnit * 1.25
Layout.preferredWidth: Kirigami.Units.gridUnit * 1.25 Layout.preferredWidth: Kirigami.Units.gridUnit * 1.25
}
} }
} }
......
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