Skip to content
Snippets Groups Projects
Commit f7d9c167 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

MessageTextView: Remove placeholder on paste

Fixes #8975
parent 6bd6294a
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,8 @@ class MessageTextView(Gtk.TextView): ...@@ -88,7 +88,8 @@ class MessageTextView(Gtk.TextView):
self.begin_tags['strike'] = '<span style="text-decoration: line-through;">' self.begin_tags['strike'] = '<span style="text-decoration: line-through;">'
self.end_tags['strike'] = '</span>' self.end_tags['strike'] = '</span>'
self.connect_after('paste-clipboard', self.after_paste_clipboard) self.connect('paste-clipboard', self._paste_clipboard)
self.connect_after('paste-clipboard', self._after_paste_clipboard)
self.connect('focus-in-event', self._on_focus_in) self.connect('focus-in-event', self._on_focus_in)
self.connect('focus-out-event', self._on_focus_out) self.connect('focus-out-event', self._on_focus_out)
...@@ -139,7 +140,13 @@ class MessageTextView(Gtk.TextView): ...@@ -139,7 +140,13 @@ class MessageTextView(Gtk.TextView):
def remove_placeholder(self): def remove_placeholder(self):
self._on_focus_in() self._on_focus_in()
def after_paste_clipboard(self, textview): @staticmethod
def _paste_clipboard(textview):
if textview.is_placeholder():
textview.get_buffer().set_text('')
@staticmethod
def _after_paste_clipboard(textview):
buffer_ = textview.get_buffer() buffer_ = textview.get_buffer()
mark = buffer_.get_insert() mark = buffer_.get_insert()
iter_ = buffer_.get_iter_at_mark(mark) iter_ = buffer_.get_iter_at_mark(mark)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment