| 21 | |
| 22 | |
| 23 | class CoverLabel(QLabel, Ui_CoverLabel): |
| 24 | |
| 25 | def __init__(self, *args, **kwargs): |
| 26 | super(CoverLabel, self).__init__(*args, **kwargs) |
| 27 | self.setupUi(self) |
| 28 | |
| 29 | def init(self, cover_path, play_url, play_count): |
| 30 | self.cover_path = cover_path |
| 31 | self.play_url = play_url |
| 32 | self.setPixmap(QPixmap(cover_path)) |
| 33 | self.labelHeadset.setPixmap(QPixmap('Data/Svg_icon_headset_sm.svg')) |
| 34 | self.labelPlay.setPixmap(QPixmap('Data/Svg_icon_play_sm.svg')) |
| 35 | self.labelCount.setStyleSheet('color: #999999;') |
| 36 | self.labelCount.setText(play_count) |
| 37 | |
| 38 | def setCoverPath(self, path): |
| 39 | self.cover_path = path |
| 40 | |
| 41 | def mouseReleaseEvent(self, event): |
| 42 | super(CoverLabel, self).mouseReleaseEvent(event) |
| 43 | webbrowser.open_new_tab(self.play_url) |