Ejemplo n.º 1
0
 def _change_pen(self):
     pen = QPen(self._pen)
     if self._in_subset and self._selected:
         color = QColor(self._pen.color())
         color.setAlpha(255)
         pen.setWidth(4)
         pen.setColor(color)
     elif not self._in_subset and self._selected:
         color = QColor(self._pen.color())
         color.setAlpha(255)
         pen.setColor(color)
     elif self._in_subset and not self._selected:
         pen.setWidth(4)
     self.setPen(pen)
     self.setSymbolPen(pen)
Ejemplo n.º 2
0
    def _change_pen(self):
        pen = QPen(self._pen)
        color = QColor(Qt.black) if self._selected and self.master.has_subset \
            else QColor(self._pen.color())

        if self._in_subset or self._selected:
            width = LinePlotStyle.SELECTED_LINE_WIDTH
            alpha = LinePlotStyle.SELECTED_LINE_ALPHA
        else:
            width = LinePlotStyle.UNSELECTED_LINE_WIDTH
            alpha = LinePlotStyle.UNSELECTED_LINE_ALPHA_WITH_SELECTION \
                if self.master.has_subset or self.master.has_selection else \
                LinePlotStyle.UNSELECTED_LINE_ALPHA

        pen.setWidth(width)
        color.setAlpha(alpha)
        pen.setColor(color)
        self.setPen(pen)
Ejemplo n.º 3
0
    def paint(self, painter, option, _widget=None):
        painter.save()
        path = self.path()
        brush = QBrush(self.brush())
        pen = QPen(self.pen())

        if option.state & QStyle.State_Selected:
            pen.setColor(Qt.red)
            brush.setStyle(Qt.DiagCrossPattern)
            brush.setColor(QColor(40, 40, 40, 100))

        elif option.state & QStyle.State_MouseOver:
            pen.setColor(Qt.blue)

        if option.state & QStyle.State_MouseOver:
            brush.setColor(QColor(100, 100, 100, 100))
            if brush.style() == Qt.NoBrush:
                # Make sure the highlight is actually visible.
                brush.setStyle(Qt.SolidPattern)

        painter.setPen(pen)
        painter.setBrush(brush)
        painter.drawPath(path)
        painter.restore()
Ejemplo n.º 4
0
    def paint(self, painter, option, widget=None):
        painter.save()
        path = self.path()
        brush = QBrush(self.brush())
        pen = QPen(self.pen())

        if option.state & QStyle.State_Selected:
            pen.setColor(Qt.red)
            brush.setStyle(Qt.DiagCrossPattern)
            brush.setColor(QColor(40, 40, 40, 100))

        elif option.state & QStyle.State_MouseOver:
            pen.setColor(Qt.blue)

        if option.state & QStyle.State_MouseOver:
            brush.setColor(QColor(100, 100, 100, 100))
            if brush.style() == Qt.NoBrush:
                # Make sure the highlight is actually visible.
                brush.setStyle(Qt.SolidPattern)

        painter.setPen(pen)
        painter.setBrush(brush)
        painter.drawPath(path)
        painter.restore()
Ejemplo n.º 5
0
 def _change_pen(self):
     pen = QPen(self._pen)
     if self._in_subset and self._selected:
         color = QColor(self._pen.color())
         color.setAlpha(255)
         pen.setWidth(4)
         pen.setColor(color)
     elif not self._in_subset and self._selected:
         color = QColor(self._pen.color())
         color.setAlpha(255)
         pen.setColor(color)
     elif self._in_subset and not self._selected:
         color = QColor(self._pen.color())
         color.setAlpha(LinePlotColors.LIGHT_ALPHA)
         pen.setWidth(4)
         pen.setColor(color)
     else:
         color = QColor(self._pen.color())
         color.setAlpha(LinePlotColors.LIGHT_ALPHA)
         pen.setColor(color)
     self.setPen(pen)