fix FontChooserDialog in xhtml popup menu.(fonts in html broken now)
This commit is contained in:
parent
0ad8449864
commit
09962db66a
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue