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


Commits:
c56dce99 by wurstsalat at 2021-03-28T16:45:41+02:00
ConversationTextview: Fix vertical size allocation

- - - - -
8b27e0c3 by wurstsalat at 2021-03-28T16:50:00+02:00
ConversationView: Remove additional nickname characters

- - - - -


2 changed files:

- gajim/gtk/conversation_textview.py
- gajim/gtk/conversation_view.py


Changes:

=====================================
gajim/gtk/conversation_textview.py
=====================================
@@ -15,6 +15,7 @@
 import logging
 from urllib.parse import quote
 
+from gi.repository import GLib
 from gi.repository import GObject
 from gi.repository import Gtk
 from gi.repository import Pango
@@ -210,6 +211,11 @@ def print_text(self, text, other_text_tags=None, 
kind=None, graphics=True,
         self.parse_formatting(
             text, text_tags, graphics=graphics, 
additional_data=additional_data)
 
+        # Queue a widget resize after the Textview has been populated.
+        # This prevents for example large allocations of vertial space (blank
+        # space after the text) for messages containing many line breaks.
+        GLib.idle_add(self.queue_resize)
+
     def parse_formatting(self, text, text_tags, graphics=True,
                          additional_data=None):
         '''


=====================================
gajim/gtk/conversation_view.py
=====================================
@@ -556,16 +556,12 @@ def create_name_widget(name: str, kind: str,
         label.set_selectable(True)
         label.get_style_context().add_class('conversation-nickname')
 
-        # TODO: Maybe set default for 'after_nickname' to empty string
-        before_name = from_one_line(app.settings.get('before_nickname'))
-        after_name = from_one_line(app.settings.get('after_nickname'))
-        new_name = f'{before_name}{GLib.markup_escape_text(name)}{after_name}'
-
+        name = GLib.markup_escape_text(name)
         if is_groupchat:
             rgba = Gdk.RGBA(*text_to_color(name))
             nick_color = convert_rgba_to_hex(rgba)
             label.set_markup(
-                f'<span foreground="{nick_color}">{new_name}</span>')
+                f'<span foreground="{nick_color}">{name}</span>')
         else:
             if kind in ('incoming', 'incoming_queue'):
                 label.get_style_context().add_class(
@@ -573,7 +569,7 @@ def create_name_widget(name: str, kind: str,
             elif kind == 'outgoing':
                 label.get_style_context().add_class(
                     'gajim-outgoing-nickname')
-            label.set_markup(new_name)
+            label.set_markup(name)
         return label
 
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/e7e9c7934f7a5c1d61e13eed2f0464dda0e4ca53...8b27e0c37d88f45269ca8f950d6991dadd30bfb9

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/e7e9c7934f7a5c1d61e13eed2f0464dda0e4ca53...8b27e0c37d88f45269ca8f950d6991dadd30bfb9
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to