Skip to content

Commit

Permalink
Merge pull request #16 from missionpinball/0.50_and_all_data
Browse files Browse the repository at this point in the history
0.50 and all data
  • Loading branch information
jabdoa2 authored Apr 19, 2017
2 parents b9cfa79 + 4cf4f13 commit c2d3e7a
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 c2d3e7a

Please sign in to comment.