Philipp Hörist pushed to branch master at gajim / gajim

Commits:
f7d9c167 by Philipp Hörist at 2018-03-25T01:39:16+01:00
MessageTextView: Remove placeholder on paste

Fixes #8975

- - - - -


1 changed file:

- gajim/message_textview.py


Changes:

=====================================
gajim/message_textview.py
=====================================
--- a/gajim/message_textview.py
+++ b/gajim/message_textview.py
@@ -88,7 +88,8 @@ class MessageTextView(Gtk.TextView):
         self.begin_tags['strike'] = '<span style="text-decoration: 
line-through;">'
         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-out-event', self._on_focus_out)
 
@@ -139,7 +140,13 @@ class MessageTextView(Gtk.TextView):
     def remove_placeholder(self):
         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()
         mark = buffer_.get_insert()
         iter_ = buffer_.get_iter_at_mark(mark)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/f7d9c167359b22a1d8a0c129eaeb35f3a4aaba0c

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/f7d9c167359b22a1d8a0c129eaeb35f3a4aaba0c
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