From 8644ddaad4a82636b7a622ba6fa449a71caabef6 Mon Sep 17 00:00:00 2001 From: vslg Date: Mon, 29 Jun 2020 21:49:01 -0300 Subject: [PATCH] Add offline presence text --- .../RoomPane/MemberView/MemberDelegate.qml | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml index 803871bb..de04882b 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml @@ -28,16 +28,28 @@ HTile { } HColumnLayout { - TitleLabel { - text: model.display_name || model.id - color: - member.hovered ? - utils.nameColor( - model.display_name || model.id.substring(1) - ) : - theme.chat.roomPane.listView.member.name + HRowLayout { + TitleLabel { + text: model.display_name || model.id + color: + member.hovered ? + utils.nameColor( + model.display_name || model.id.substring(1) + ) : + theme.chat.roomPane.listView.member.name - Behavior on color { HColorAnimation {} } + Behavior on color { HColorAnimation {} } + } + + TitleRightInfoLabel { + tile: member + text: + model.presence === "offline" && + model.last_active_ago !== -1 ? + "offline for " + + utils.formatRelativeTime(model.last_active_ago) : + "" + } } SubtitleLabel {