summary refs log tree commit diff
path: root/resources/qml/Avatar.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-06-08 01:45:24 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-06-08 01:59:05 +0200
commit96f4169be97715e6b6b45663492e3791ba21ae09 (patch)
tree618753677e69ac590aa2cad267dfd7d31c574bfd /resources/qml/Avatar.qml
parentSmooth scaling for images (diff)
downloadnheko-96f4169be97715e6b6b45663492e3791ba21ae09.tar.xz
Show presence and set custom status messages
Diffstat (limited to 'resources/qml/Avatar.qml')
-rw-r--r--resources/qml/Avatar.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml
index 465a8e1c..9ac7b562 100644
--- a/resources/qml/Avatar.qml
+++ b/resources/qml/Avatar.qml
@@ -9,6 +9,7 @@ Rectangle {
 	radius: settings.avatarCircles ? height/2 : 3
 
 	property alias url: img.source
+	property string userid
 	property string displayName
 
 	Label {
@@ -42,6 +43,23 @@ Rectangle {
 				radius: settings.avatarCircles ? height/2 : 3
 			}
 		}
+
+	}
+
+	Rectangle {
+		anchors.bottom: avatar.bottom
+		anchors.right: avatar.right
+
+		height: avatar.height / 6
+		width: height
+		radius: settings.avatarCircles ? height / 2 : height / 4
+		color: switch (timelineManager.userPresence(userid)) {
+			case "online": return "#00cc66"
+			case "unavailable": return "#ff9933"
+			case "offline": return "#a82353"
+			default: "transparent"
+		}
 	}
+
 	color: colors.base
 }