예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
    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
예제 #4
0
    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