diff --git a/mpfmonitor/core/mpfmon.py b/mpfmonitor/core/mpfmon.py index 86d0576..3adfce8 100644 --- a/mpfmonitor/core/mpfmon.py +++ b/mpfmonitor/core/mpfmon.py @@ -324,9 +324,10 @@ def paint(self, painter, view, index): return if index.column() == 0: - super().paint(painter, view, index) return + text += " " + str(index.model().itemFromIndex(index).data()) + painter.save() painter.setRenderHint(QPainter.Antialiasing, True) @@ -439,8 +440,8 @@ def boundingRect(self): return QRectF(self.device_size / -2, self.device_size / -2, self.device_size, self.device_size) - def paint(self, painter, option, widget): - if self.device_type == 'led': + def paint(self, painter, option, widget=None): + if self.device_type == 'light': color = self.widget.data()['color'] painter.setRenderHint(QPainter.Antialiasing, True) @@ -463,15 +464,6 @@ def paint(self, painter, option, widget): painter.drawRect(self.device_size / -2, self.device_size / -2, self.device_size, self.device_size) - elif self.device_type == 'light': - color = [self.widget.data()['brightness']] * 3 - - painter.setRenderHint(QPainter.Antialiasing, True) - painter.setPen(QPen(Qt.white, 3, Qt.SolidLine)) - painter.setBrush(QBrush(QColor(*color), Qt.SolidPattern)) - painter.drawEllipse(self.device_size / -2, self.device_size / -2, - self.device_size, self.device_size) - def notify(self, source): if source == self.widget: self.update()