Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 3
0
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
Exemplo n.º 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
Exemplo n.º 5
0
    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())