Beispiel #1
0
    def paint(self, painter, option, widget=None):
        brush = self.brush()

        if self.__hover:
            brush = QBrush(brush.color().darker(110))

        painter.setBrush(brush)
        painter.setPen(self.pen())
        painter.drawEllipse(self.rect())
Beispiel #2
0
    def paint(self, painter, option, widget=None):
        brush = self.brush()

        if self.__hover:
            brush = QBrush(brush.color().darker(110))

        painter.setBrush(brush)
        painter.setPen(self.pen())
        painter.drawEllipse(self.rect())
def brush_darker(brush: QBrush, factor: bool) -> QBrush:
    """Return a copy of the brush darkened by factor.
    """
    grad = brush.gradient()
    if grad:
        return QBrush(gradient_darker(grad, factor))
    else:
        brush = QBrush(brush)
        brush.setColor(brush.color().darker(factor))
        return brush
Beispiel #4
0
def brush_darker(brush, factor):
    """Return a copy of the brush darkened by factor.
    """
    grad = brush.gradient()
    if grad:
        return QBrush(gradient_darker(grad, factor))
    else:
        brush = QBrush(brush)
        brush.setColor(brush.color().darker(factor))
        return brush
    def paint(self, painter, option, widget=None):
        # type: (QPainter, QStyleOptionGraphicsItem, Optional[QWidget]) -> None
        brush = self.brush()

        if self.__hover:
            brush = QBrush(brush.color().darker(110))

        painter.setBrush(brush)
        painter.setPen(self.pen())
        painter.drawEllipse(self.rect())