Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
5784dfd4
by wurstsalat at 2022-06-02T23:24:34+02:00
6 changed files:
- gajim/gtk/controls/base.py
- gajim/gtk/conversation/message_widget.py
- gajim/gtk/conversation/plain_widget.py
- gajim/gtk/conversation/rows/base.py
- gajim/gtk/conversation/rows/message.py
- gajim/gtk/conversation/view.py
Changes:
| ... | ... | @@ -286,7 +286,6 @@ def __init__(self, widget_name: str, account: str, jid: JID) -> None: |
| 286 | 286 | ('ping-sent', ged.GUI1, self._nec_ping),
|
| 287 | 287 | ('ping-reply', ged.GUI1, self._nec_ping),
|
| 288 | 288 | ('ping-error', ged.GUI1, self._nec_ping),
|
| 289 | - ('style-changed', ged.GUI1, self._style_changed),
|
|
| 290 | 289 | ])
|
| 291 | 290 | |
| 292 | 291 | # This is basically a very nasty hack to surpass the inability
|
| ... | ... | @@ -1321,12 +1320,6 @@ def _on_formatting_menuitem_activate(self, |
| 1321 | 1320 | formatting = menu_item.get_name()
|
| 1322 | 1321 | self.msg_textview.apply_formatting(formatting)
|
| 1323 | 1322 | |
| 1324 | - def _style_changed(self, _event: events.StyleChanged) -> None:
|
|
| 1325 | - self.update_text_tags()
|
|
| 1326 | - |
|
| 1327 | - def update_text_tags(self) -> None:
|
|
| 1328 | - self.conversation_view.update_text_tags()
|
|
| 1329 | - |
|
| 1330 | 1323 | def set_control_active(self, state: bool) -> None:
|
| 1331 | 1324 | if not self._chat_loaded:
|
| 1332 | 1325 | self.fetch_n_lines_history(self._scrolled_view, True, 20)
|
| ... | ... | @@ -93,8 +93,3 @@ def add_content(self, content: ContentT) -> None: |
| 93 | 93 | |
| 94 | 94 | def clear(self) -> None:
|
| 95 | 95 | self.foreach(self.remove) |
| 96 | - |
|
| 97 | - def update_text_tags(self, *args: Any) -> None:
|
|
| 98 | - for widget in cast(list[MessageWidget], self.get_children()):
|
|
| 99 | - if not isinstance(widget, CodeWidget):
|
|
| 100 | - widget.update_text_tags() |
| ... | ... | @@ -74,9 +74,6 @@ def add_action_phrase(self, text: str, nickname: str) -> None: |
| 74 | 74 | text = GLib.markup_escape_text(text)
|
| 75 | 75 | self._text_widget.add_action_phrase(text)
|
| 76 | 76 | |
| 77 | - def update_text_tags(self) -> None:
|
|
| 78 | - self._text_widget.update_text_tags()
|
|
| 79 | - |
|
| 80 | 77 | |
| 81 | 78 | class MessageLabel(Gtk.Label):
|
| 82 | 79 | def __init__(self, account: str, selectable: bool) -> None:
|
| ... | ... | @@ -125,9 +122,6 @@ def print_text_with_styling(self, block: PlainBlock) -> None: |
| 125 | 122 | def add_action_phrase(self, text: str) -> None:
|
| 126 | 123 | self.set_markup(f'<i>{text}</i>')
|
| 127 | 124 | |
| 128 | - def update_text_tags(self) -> None:
|
|
| 129 | - pass
|
|
| 130 | - |
|
| 131 | 125 | def _on_activate_link(self, _label: Gtk.Label, uri: str) -> int:
|
| 132 | 126 | open_uri(uri, self._account)
|
| 133 | 127 | return Gdk.EVENT_STOP
|
| ... | ... | @@ -201,14 +195,6 @@ def _create_url_tags(self) -> None: |
| 201 | 195 | underline=Pango.Underline.SINGLE)
|
| 202 | 196 | tag.connect('event', self._on_uri_clicked, tag)
|
| 203 | 197 | |
| 204 | - def update_text_tags(self) -> None:
|
|
| 205 | - tag_table = self.get_buffer().get_tag_table()
|
|
| 206 | - url_color = app.css_config.get_value('.gajim-url', StyleAttr.COLOR)
|
|
| 207 | - for tag_name in URI_TAGS:
|
|
| 208 | - tag = tag_table.lookup(tag_name)
|
|
| 209 | - assert tag is not None
|
|
| 210 | - tag.set_property('foreground', url_color)
|
|
| 211 | - |
|
| 212 | 198 | def clear(self) -> None:
|
| 213 | 199 | buffer_ = self.get_buffer()
|
| 214 | 200 | start, end = buffer_.get_bounds()
|
| ... | ... | @@ -60,9 +60,6 @@ def __init__(self, account: str, widget: Optional[str] = None) -> None: |
| 60 | 60 | def is_merged(self) -> bool:
|
| 61 | 61 | return self._merged
|
| 62 | 62 | |
| 63 | - def update_text_tags(self) -> None:
|
|
| 64 | - pass
|
|
| 65 | - |
|
| 66 | 63 | @staticmethod
|
| 67 | 64 | def create_timestamp_widget(timestamp: datetime) -> Gtk.Label:
|
| 68 | 65 | time_format = from_one_line(app.settings.get('chat_timestamp_format'))
|
| ... | ... | @@ -229,10 +229,6 @@ def __init__(self, |
| 229 | 229 | |
| 230 | 230 | self.show_all()
|
| 231 | 231 | |
| 232 | - def update_text_tags(self) -> None:
|
|
| 233 | - if isinstance(self._message_widget, MessageWidget):
|
|
| 234 | - self._message_widget.update_text_tags()
|
|
| 235 | - |
|
| 236 | 232 | def _check_for_highlight(self, text: str) -> None:
|
| 237 | 233 | assert isinstance(self._contact, GroupchatContact)
|
| 238 | 234 | if self._contact.nickname is None:
|
| ... | ... | @@ -485,11 +485,6 @@ def update_avatars(self) -> None: |
| 485 | 485 | if isinstance(row, MessageRow):
|
| 486 | 486 | row.update_avatar()
|
| 487 | 487 | |
| 488 | - def update_text_tags(self) -> None:
|
|
| 489 | - for row in cast(list[BaseRow], self.get_children()):
|
|
| 490 | - if isinstance(row, MessageRow):
|
|
| 491 | - row.update_text_tags()
|
|
| 492 | - |
|
| 493 | 488 | def scroll_to_end(self, force: bool = False) -> None:
|
| 494 | 489 | if self.autoscroll or force:
|
| 495 | 490 | GLib.idle_add(self.emit, 'scroll-to-end')
|