def _default_cb(self, button): assert self._brush_to_edit logger.debug("Set preview of %r to a procedural default", self._brush_to_edit) preview = drawutils.render_brush_preview_pixbuf( self._brush_to_edit.get_brushinfo(), ) self._set_preview_pixbuf(preview) self.mode_changed(False)
def _default_cb(self, button): assert self._brush_to_edit logger.debug("Set preview of %r to a procedural default", self._brush_to_edit) preview = drawutils.render_brush_preview_pixbuf( self._brush_to_edit.get_brushinfo() ) self._set_preview_pixbuf(preview) self.mode_changed(False)
def get_preview(self): """Gets a preview image for the brush For persistent brushes, this loads the disk preview; otherwise a fairly slow automated brush preview is used. The results are cached in RAM. """ if self._preview is None and self.name: self._load_preview() if self._preview is None: brushinfo = self.get_brushinfo() self._preview = drawutils.render_brush_preview_pixbuf(brushinfo) return self._preview