def build(self): self.changes_flag = False self.styles = self._get_styles() self.styles_combo = wal.Combolist(self, items=self.styles, onchange=self.on_style_change) self.add(self.styles_combo, 0, wal.LEFT | wal.CENTER, 2) self.add((3, 3)) self.families, self.faces_dict = libpango.get_fonts() self.families_combo = FontChoice(self, onchange=self.on_font_change) self.add(self.families_combo, 0, wal.LEFT | wal.CENTER, 2) self.add((3, 3)) self.faces = self.faces_dict['Sans'] self.faces_combo = wal.Combolist(self, items=self.faces, onchange=self.apply_changes) self.faces_combo.set_active(0) self.add(self.faces_combo, 0, wal.LEFT | wal.CENTER, 2) self.add((3, 3)) self.size_combo = wal.FloatCombobox(self, 12, width=5, digits=2, items=FONT_SIZES, onchange=self.apply_changes) self.add(self.size_combo, 0, wal.LEFT | wal.CENTER, 2) self.pack(wal.VLine(self), fill=True, padding_all=3) self.align = wal.HToggleKeeper(self, ALIGN_MODES, ALIGN_MODE_ICONS, ALIGN_MODE_NAMES, on_change=self.apply_changes, allow_none=False) self.align.set_mode(sk2_const.TEXT_ALIGN_LEFT) self.add(self.align, 0, wal.LEFT | wal.CENTER, 2) self.pack(wal.VLine(self), fill=True, padding_all=3) self.ligature = wal.ImageToggleButton(self, False, icons.PD_LIGATURE, tooltip=_('Use ligatures'), onchange=self.apply_changes) self.add(self.ligature, 0, wal.LEFT | wal.CENTER, 2)
def build(self): self.families, self.faces_dict = libpango.get_fonts() self.families_combo = FontChoice(self, onchange=self.on_font_change) self.add(self.families_combo, 0, LEFT | CENTER, 2) self.add((3, 3)) self.families_combo.set_font_family('Sans') self.faces = self.faces_dict['Sans'] self.faces_combo = wal.Combolist(self, items=self.faces, onchange=self.apply_changes) self.faces_combo.set_active(0) self.add(self.faces_combo, 0, wal.LEFT | wal.CENTER, 2) self.add((3, 3)) self.size_combo = wal.FloatCombobox(self, 12, digits=2, items=FONT_SIZES, onchange=self.apply_changes) self.add(self.size_combo, 0, wal.LEFT | wal.CENTER, 2)