Skip to content

Commit

Permalink
lights for 0.50. show all data for device
Browse files Browse the repository at this point in the history
  • Loading branch information
jabdoa2 committed Apr 19, 2017
1 parent b9cfa79 commit 4cf4f13
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions mpfmonitor/core/mpfmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 4cf4f13

Please sign in to comment.