fix FontChooserDialog in xhtml popup menu.(fonts in html broken now)

This commit is contained in:
Denis Fomin 2013-01-10 00:13:41 +04:00
parent 0ad8449864
commit 09962db66a
2 changed files with 6 additions and 7 deletions

View File

@ -1103,9 +1103,8 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
color_dialog.show_all()
def on_font_menuitem_activale(self, widget):
font_dialog = Gtk.FontSelectionDialog('Select a font')
font_dialog.connect('response', self.msg_textview.font_set,
font_dialog.fontsel)
font_dialog = Gtk.FontChooserDialog(None, self.parent_win.window)
font_dialog.connect('response', self.msg_textview.font_set)
font_dialog.show_all()
def on_actions_button_clicked(self, widget):

View File

@ -174,15 +174,15 @@ class MessageTextView(Gtk.TextView):
_buffer.apply_tag_by_name(tag_name, start, finish)
def font_set(self, widget, response, font):
if response == -6:
def font_set(self, widget, response):
if response == -6 or response == -4:
widget.destroy()
return
_buffer = self.get_buffer()
font = font.get_font_name()
font_desc = Pango.FontDescription(font)
font = widget.get_font()
font_desc = widget.get_font_desc()
family = font_desc.get_family()
size = font_desc.get_size()
size = size / Pango.SCALE