def select_font(cls, style, callback): '''select font and if available size and style, receives a e3.Message.Style object with the current style the callback receives a new style object with the new selection ''' new_qt_font, result = QtGui.QFontDialog.getFont() if result: estyle = Utils.qfont_to_style(new_qt_font, style.color) callback(estyle)
def _get_e3_style(self): '''Returns the font style in e3 format''' qt_font = self._get_qt_font() e3_color = Utils.qcolor_to_e3_color(self._qt_color) e3_style = Utils.qfont_to_style(qt_font, e3_color) return e3_style