Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwurstsalat <mailtrash@posteo.de>2022-09-26 12:31:41 +0300
committerwurstsalat <mailtrash@posteo.de>2022-09-26 12:31:41 +0300
commitedc53ee1689f81e40933964bf93f030b64abf0c5 (patch)
tree33114fe0b28b4ca8062a3ce4eb49a866d00ea72c
parentbeee4cbe4ae8ebdb1896463b59872ad0cb604f15 (diff)
imprv: Windows: Ellipsize body text in notifications
-rw-r--r--gajim/gtk/notification.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gajim/gtk/notification.py b/gajim/gtk/notification.py
index 44d731447..531c10095 100644
--- a/gajim/gtk/notification.py
+++ b/gajim/gtk/notification.py
@@ -30,8 +30,9 @@ from typing import Any
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 @@ class PopupNotification(Gtk.Window):
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)