From 01a4f40183ba7153ca0cbeaa88431880b3be4f5c Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Tue, 11 Jun 2019 02:02:00 +0200 Subject: [PATCH] Show presence indicator for contacts as vertical bar to left of avatar --- src/qml/elements/RosterListItem.qml | 57 ++++++++++++----------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/src/qml/elements/RosterListItem.qml b/src/qml/elements/RosterListItem.qml index 0d1bd29..9da80ae 100644 --- a/src/qml/elements/RosterListItem.qml +++ b/src/qml/elements/RosterListItem.qml @@ -46,17 +46,30 @@ Kirigami.SwipeListItem { property int presenceType property string statusMsg - topPadding: Kirigami.Units.smallSpacing * 1.5 + topPadding: 0 + leftPadding: 0 + bottomPadding: 0 height: Kirigami.Units.gridUnit * 3.5 RowLayout { 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 { id: avatarSpace - Layout.preferredHeight: parent.height - Layout.preferredWidth: parent.height + Layout.preferredHeight: parent.height - Kirigami.Units.gridUnit * 0.8 + Layout.preferredWidth: parent.height - Kirigami.Units.gridUnit * 0.8 Controls.ToolTip { visible: hovered && !Kirigami.Settings.isMobile @@ -82,28 +95,6 @@ Kirigami.SwipeListItem { id: textAvatar 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 @@ -138,15 +129,15 @@ Kirigami.SwipeListItem { font.pixelSize: Kirigami.Units.gridUnit * 0.8 } } - } - // unread message counter - MessageCounter { - visible: unreadMessages > 0 - counter: unreadMessages + // unread message counter + MessageCounter { + visible: unreadMessages > 0 + counter: unreadMessages - Layout.preferredHeight: Kirigami.Units.gridUnit * 1.25 - Layout.preferredWidth: Kirigami.Units.gridUnit * 1.25 + Layout.preferredHeight: Kirigami.Units.gridUnit * 1.25 + Layout.preferredWidth: Kirigami.Units.gridUnit * 1.25 + } } } -- GitLab