def _set_expanded(self, value): if self.child != None: self.remove(self.child) if value: self.add(self.widget) else: self.add(self.label) self.label.child.set_markup(markup.markuptext(self.get_text(), fancyspaces=False, markupescapes=False)) self.child.show()
def _get_pango_layout(self, widget, text, width, font_description): '''Gets the Pango layout used in the cell in a TreeView widget.''' # We can't use widget.get_pango_context() because we'll end up # overwriting the language and font settings if we don't have a # new one layout = pango.Layout(widget.create_pango_context()) layout.set_font_description(font_description) layout.set_wrap(pango.WRAP_WORD_CHAR) layout.set_width(width * pango.SCALE) #XXX - plurals? text = text or u"" layout.set_markup(markup.markuptext(text)) return layout
def _get_pango_layout(self, widget, text, width, font_description): """Gets the Pango layout used in the cell in a TreeView widget.""" # We can't use widget.get_pango_context() because we'll end up # overwriting the language and font settings if we don't have a # new one layout = pango.Layout(widget.create_pango_context()) layout.set_font_description(font_description) layout.set_wrap(pango.WRAP_WORD_CHAR) layout.set_width(width * pango.SCALE) # XXX - plurals? text = text or u"" layout.set_markup(markup.markuptext(text)) return layout
def on_get_value(self, rowref, column): if column <= 1: unit = self._store[rowref] if column == 0: note_text = unit.getnotes() if not note_text: locations = unit.getlocations() if locations: note_text = unit.getlocations()[0] return markup.markuptext(note_text, fancyspaces=False, markupescapes=False) or None else: return unit else: return self._current_editable == rowref
def _set_expanded(self, value): if self.child != None: self.remove(self.child) if value: self.add(self.widget) else: self.add(self.label) self.label.child.set_markup( markup.markuptext(self.get_text(), fancyspaces=False, markupescapes=False)) self.child.show()
def on_get_value(self, rowref, column): if column <= 1: unit = self._store[rowref] if column == 0: note_text = unit.getnotes() if not note_text: locations = unit.getlocations() if locations: note_text = locations[0] return markup.markuptext( note_text, fancyspaces=False, markupescapes=False) or None else: return unit else: return self._current_editable == rowref
def _get_pango_layout(self, widget, text, width, font_description, diff_text=u""): '''Gets the Pango layout used in the cell in a TreeView widget.''' # We can't use widget.get_pango_context() because we'll end up # overwriting the language and font settings if we don't have a # new one layout = pango.Layout(widget.create_pango_context()) layout.set_font_description(font_description) layout.set_wrap(pango.WRAP_WORD_CHAR) layout.set_width(width * pango.SCALE) #XXX - plurals? layout.set_markup(markup.markuptext(text, diff_text=diff_text)) # This makes no sense, but has the desired effect to align things correctly for # both LTR and RTL languages: if widget.get_direction() == gtk.TEXT_DIR_RTL: layout.set_alignment(pango.ALIGN_RIGHT) return layout