Commit 67e7d7f7 authored by Dicson's avatar Dicson

fix change font in html, wrong import

parent a5027f84
......@@ -1102,7 +1102,8 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
def on_font_menuitem_activale(self, widget):
font_dialog = Gtk.FontChooserDialog(None, self.parent_win.window)
font_dialog.connect('response', self.msg_textview.font_set)
start, finish = self.msg_textview.get_active_iters()
font_dialog.connect('response', self.msg_textview.font_set, start, finish)
font_dialog.show_all()
def on_actions_button_clicked(self, widget):
......
......@@ -45,7 +45,7 @@ if gajim.HAVE_PYCRYPTO:
from Crypto.PublicKey import RSA
from common import dh
from . import secrets
import secrets
XmlDsig = 'http://www.w3.org/2000/09/xmldsig#'
......
......@@ -147,7 +147,6 @@ class MessageTextView(Gtk.TextView):
_buffer.remove_all_tags(start, finish)
def color_set(self, widget, response):
print (response)
if response == -6 or response == -4:
widget.destroy()
return
......@@ -174,13 +173,11 @@ class MessageTextView(Gtk.TextView):
_buffer.apply_tag_by_name(tag_name, start, finish)
def font_set(self, widget, response):
def font_set(self, widget, response, start, finish):
if response == -6 or response == -4:
widget.destroy()
return
_buffer = self.get_buffer()
font = widget.get_font()
font_desc = widget.get_font_desc()
family = font_desc.get_family()
......@@ -191,6 +188,8 @@ class MessageTextView(Gtk.TextView):
widget.destroy()
_buffer = self.get_buffer()
tag_name = 'font' + font
if not tag_name in self.fonts_tags:
tagFont = _buffer.create_tag(tag_name)
......@@ -201,8 +200,6 @@ class MessageTextView(Gtk.TextView):
self.end_tags[tag_name] = '</span>'
self.fonts_tags.append(tag_name)
start, finish = self.get_active_iters()
for tag in self.fonts_tags:
_buffer.remove_tag_by_name(tag, start, finish)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment