Example #1
0
 def particle_brush(self, index: int):
     brush = QBrush()
     brush.setStyle(Qt.SolidPattern)
     colors = self.settings.list_value(default_settings.particle_color)
     colors = [QColor(c) for c in colors]
     brush.setColor(colors[index % len(colors)])
     return brush
Example #2
0
 def mark_brush(self, index: int):
     if self.settings.boolean_value(
             default_settings.same_mark_color_with_particle):
         return self.particle_brush(index)
     else:
         brush = QBrush()
         colors = self.settings.list_value(default_settings.mark_color)
         colors = [QColor(c) for c in colors]
         brush.setStyle(Qt.SolidPattern)
         brush.setColor(colors[index % len(colors)])
         return brush
Example #3
0
    def drawGameBox(self, painter):
        """
        Draw game box for the widget

        """
        brush = QBrush(Qt.SolidPattern)
        brush.setColor(QColor(255, 0, 0))
        painter.setBrush(brush)

        rect = self.contentsRect()
        painter.drawLine(0, 0, rect.width() - 1, 0)

        painter.drawLine(rect.width() - 1, 0,
                         rect.width() - 1,
                         rect.height() - 1)

        painter.drawLine(rect.width() - 1, rect.height() - 1, 0, rect.height())

        painter.drawLine(0, rect.height() - 1, 0, 0)