Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
edc53ee1 by wurstsalat at 2022-09-26T11:31:41+02:00
imprv: Windows: Ellipsize body text in notifications

- - - - -


1 changed file:

- gajim/gtk/notification.py


Changes:

=====================================
gajim/gtk/notification.py
=====================================
@@ -30,8 +30,9 @@
 from typing import Optional
 from typing import Union
 
-import sys
 import logging
+import sys
+import textwrap
 
 from gi.repository import GLib
 from gi.repository import Gio
@@ -187,7 +188,11 @@ def __init__(self, event: events.Notification, timeout: 
int) -> None:
             icon_name = self._get_icon_name(event)
             self._ui.image.set_from_icon_name(icon_name, Gtk.IconSize.DIALOG)
         self._ui.event_type_label.set_text(event.title)
-        self._ui.event_description_label.set_text(event.text)
+        body = textwrap.fill(event.text,
+                             width=40,
+                             max_lines=3,
+                             placeholder='…')
+        self._ui.event_description_label.set_text(body)
 
         if timeout > 0:
             self._timeout_id = GLib.timeout_add_seconds(timeout, self.destroy)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/edc53ee1689f81e40933964bf93f030b64abf0c5

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/edc53ee1689f81e40933964bf93f030b64abf0c5
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to