diff options
Diffstat (limited to 'src/message.py')
-rw-r--r-- | src/message.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/message.py b/src/message.py index 7a14483..db50829 100644 --- a/src/message.py +++ b/src/message.py @@ -65,14 +65,22 @@ class WeegtkMessage(Gtk.Box): else: self.avatar.set_text(data["username"]) + if data["type"] == "message_append": + self.avatar.set_visible(False) + self.username.set_visible(False) + first = True + padding_size = self.avatar.get_size() + self.avatar.get_margin_start() + self.avatar.get_margin_end() + # TODO messages no longer should be a list, and there should only be one message per entry + # Remove this for loop and make sure chat only sets message contents as a single string for message in data["text"]: margin = 5 if not first else 0 first = False markuped = self.parse_message(message) msg = Gtk.Label(label=markuped, selectable=True, wrap=True, wrap_mode=Pango.WrapMode.WORD_CHAR, xalign=0, - margin_top=margin, use_markup=True) + margin_top=margin, use_markup=True, + margin_start= padding_size if data["type"] == "message_append" else 0) self.message_list.append(msg) |