def on_font_selected(self, dummy_listbox, listbox_row):
'''
Signal handler for selecting a font
:param dummy_listbox: The list box used to select a font
:type dummy_listbox: Gtk.ListBox object
:param listbox_row: A row containing a font name
:type listbox_row: Gtk.ListBoxRow object
'''
font = listbox_row.get_child().get_text().split(' ')[0]
if _ARGS.debug:
sys.stdout.write(
'on_font_selected() font = %s\n' %repr(font))
if font == '':
font = 'emoji'
if font != self._font and font == 'emoji':
self._fallback = True
self._fallback_check_button.set_active(True)
else:
self._fallback = False
self._fallback_check_button.set_active(False)
if GTK_VERSION >= (3, 22, 0):
self._font_popover.popdown()
self._font_popover.hide()
self._font = font
self._font_button.set_label(self._font)
self._save_options()
self._busy_start()
GLib.idle_add(self._change_flowbox_font)
评论列表
文章目录