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()
|
color_dialog.show_all()
|
||||||
|
|
||||||
def on_font_menuitem_activale(self, widget):
|
def on_font_menuitem_activale(self, widget):
|
||||||
font_dialog = Gtk.FontSelectionDialog('Select a font')
|
font_dialog = Gtk.FontChooserDialog(None, self.parent_win.window)
|
||||||
font_dialog.connect('response', self.msg_textview.font_set,
|
font_dialog.connect('response', self.msg_textview.font_set)
|
||||||
font_dialog.fontsel)
|
|
||||||
font_dialog.show_all()
|
font_dialog.show_all()
|
||||||
|
|
||||||
def on_actions_button_clicked(self, widget):
|
def on_actions_button_clicked(self, widget):
|
||||||
|
|
|
@ -174,15 +174,15 @@ class MessageTextView(Gtk.TextView):
|
||||||
|
|
||||||
_buffer.apply_tag_by_name(tag_name, start, finish)
|
_buffer.apply_tag_by_name(tag_name, start, finish)
|
||||||
|
|
||||||
def font_set(self, widget, response, font):
|
def font_set(self, widget, response):
|
||||||
if response == -6:
|
if response == -6 or response == -4:
|
||||||
widget.destroy()
|
widget.destroy()
|
||||||
return
|
return
|
||||||
|
|
||||||
_buffer = self.get_buffer()
|
_buffer = self.get_buffer()
|
||||||
|
|
||||||
font = font.get_font_name()
|
font = widget.get_font()
|
||||||
font_desc = Pango.FontDescription(font)
|
font_desc = widget.get_font_desc()
|
||||||
family = font_desc.get_family()
|
family = font_desc.get_family()
|
||||||
size = font_desc.get_size()
|
size = font_desc.get_size()
|
||||||
size = size / Pango.SCALE
|
size = size / Pango.SCALE
|
||||||
|
|
Loading…
Reference in New Issue