From 1cff6a34323283018d2669c6c38a79c6f7e20ae8 Mon Sep 17 00:00:00 2001
From: lovetox <philipp@hoerist.com>
Date: Wed, 27 May 2020 22:23:49 +0200
Subject: [PATCH] Change look of DND status

---
 gajim/gtk/avatar.py | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/gajim/gtk/avatar.py b/gajim/gtk/avatar.py
index 8c4faec9f1..5f7b172a2e 100644
--- a/gajim/gtk/avatar.py
+++ b/gajim/gtk/avatar.py
@@ -97,22 +97,35 @@ def add_status_to_avatar(surface, show):
     width = width / scale
     height = height / scale
 
-    clip_size = width / 6.5
+    clip_radius = width / 5.5
+    center_x = width - clip_radius
+    center_y = height - clip_radius
+
     context.set_source_rgb(255, 255, 255)
     context.set_operator(cairo.Operator.CLEAR)
-    context.arc(width - clip_size, height - clip_size, clip_size, 0, 2 * pi)
+    context.arc(center_x, center_y, clip_radius, 0, 2 * pi)
     context.fill()
 
     css_color = get_css_show_class(show)
     color = convert_rgb_string_to_float(
         app.css_config.get_value(css_color, StyleAttr.COLOR))
-    show_size = width / 6.5
-    show_radius = show_size * 0.80
+
+    show_radius = clip_radius * 0.75
+
     context.set_source_rgb(*color)
     context.set_operator(cairo.Operator.OVER)
-    context.arc(width - show_size, height - show_size, show_radius, 0, 2 * pi)
+    context.arc(center_x, center_y, show_radius, 0, 2 * pi)
     context.fill()
 
+    if show == 'dnd':
+        line_length = clip_radius / 2
+        context.move_to(center_x - line_length, center_y)
+        context.line_to(center_x + line_length, center_y)
+
+        context.set_source_rgb(255, 255, 255)
+        context.set_line_width(clip_radius / 4)
+        context.stroke()
+
     return context.get_target()
 
 
-- 
GitLab