From 1b9672560dcd354d16e5f1b1f335c41cc30a7336 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 28 Oct 2013 19:24:11 +0100 Subject: [PATCH] =?UTF-8?q?use=20=E2=9C=93=20and=20=E2=9C=96=20instead=20o?= =?UTF-8?q?f=20gtk-yes=20/=20gtk-no=20icons=20for=20XEP-184=20marks.=20Fix?= =?UTF-8?q?es=20#7445,=20see=20#7476?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/conversation_textview.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index d2d833408..1492a1742 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -175,8 +175,6 @@ class ConversationTextview(GObject.GObject): FOCUS_OUT_LINE_PIXBUF = gtkgui_helpers.get_icon_pixmap( 'gajim-muc_separator') - XEP0184_WARNING_PIXBUF = gtkgui_helpers.get_icon_pixmap('gtk-no') - XEP0184_RECEIVED_PIXBUF = gtkgui_helpers.get_icon_pixmap('gtk-yes') MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap('gtk-spell-check') # smooth scroll constants @@ -315,6 +313,10 @@ class ConversationTextview(GObject.GObject): self.displaymarking_tags = {} tag = buffer_.create_tag('xep0184-warning') + tag.set_property('foreground', 'red') + + tag = buffer_.create_tag('xep0184-received') + tag.set_property('foreground', 'green') # One mark at the begining then 2 marks between each lines size = gajim.config.get('max_conversation_lines') @@ -516,18 +518,7 @@ class ConversationTextview(GObject.GObject): return False end_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_]) - buffer_.insert(end_iter, ' ') - anchor = buffer_.create_child_anchor(end_iter) - img = TextViewImage(anchor, '') - img.set_from_pixbuf(ConversationTextview.XEP0184_WARNING_PIXBUF) - img.show() - self.tv.add_child_at_anchor(img, anchor) - before_img_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_]) - before_img_iter.forward_char() - post_img_iter = before_img_iter.copy() - post_img_iter.forward_char() - buffer_.apply_tag_by_name('xep0184-warning', before_img_iter, - post_img_iter) + buffer_.insert_with_tags_by_name(end_iter, ' ✖', 'xep0184-warning') self.xep0184_shown[id_] = SHOWN return False @@ -554,12 +545,8 @@ class ConversationTextview(GObject.GObject): if gajim.config.get('positive_184_ack'): begin_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_]) - buffer_.insert(begin_iter, ' ') - anchor = buffer_.create_child_anchor(begin_iter) - img = TextViewImage(anchor, '') - img.set_from_pixbuf(ConversationTextview.XEP0184_RECEIVED_PIXBUF) - img.show() - self.tv.add_child_at_anchor(img, anchor) + buffer_.insert_with_tags_by_name(begin_iter, ' ✓', + 'xep0184-received') self.xep0184_shown[id_] = ALREADY_RECEIVED