Esempio n. 1
0
 def update_cover(self, pmap=None, cdata=None):
     if pmap is None:
         pmap = QPixmap()
         pmap.loadFromData(cdata)
     if pmap.isNull():
         return
     if pmap.hasAlphaChannel():
         pmap = QPixmap.fromImage(blend_image(image_from_x(pmap)))
     self.pixmap = pmap
     self.do_layout()
     self.update()
     self.update_tooltip(getattr(self.parent(), 'current_path', ''))
     if not config['disable_animations']:
         self.animation.start()
     id_ = self.data.get('id', None)
     if id_ is not None:
         self.cover_changed.emit(id_, cdata or pixmap_to_data(pmap))
Esempio n. 2
0
 def update_cover(self, pmap=None, cdata=None):
     if pmap is None:
         pmap = QPixmap()
         pmap.loadFromData(cdata)
     if pmap.isNull():
         return
     if pmap.hasAlphaChannel():
         pmap = QPixmap.fromImage(blend_image(image_from_x(pmap)))
     self.pixmap = pmap
     self.do_layout()
     self.update()
     self.update_tooltip(getattr(self.parent(), 'current_path', ''))
     if not config['disable_animations']:
         self.animation.start()
     id_ = self.data.get('id', None)
     if id_ is not None:
         self.cover_changed.emit(id_, cdata or pixmap_to_data(pmap))