def __init__(self):
        MShape.__init__(self)
        self.max_width = 100
        self.max_height = 100
        self.width = 100
        self.height = 100
        self.__color = MColors.PRIMARY_COLOR
        self.__pen = QPen(self.__color, 0)
        self.__painter = QPainter()
        # self.__reveal = MCircularReveal()
        # self.__reveal.duration = 1000
        # self.__reveal.add_target(self)

        self.radio = MRadioButton()
        self.add_layout_item(self.radio, 0, 0)

        self.__ripple = MRipple()
        self.add_layout_item(self.__ripple, 0, 0)
        self.margin_left = 10
        self.margin_top = 15
        self.setLayout(self.layout)
        self.__scale = MFade()
        path = QPainterPath()
        path.addEllipse(0, 0, 100, 100)
        self.clip = path
        newpath = QPainterPath()
        newpath.addEllipse(20, 20, 100, 100)
        self.nonepath = newpath
        self.__scale.add_target(self)
        self.__bounding_rect = QRect(self.margin_left, self.margin_top, self.width, self.height)
Beispiel #2
0
    def __init__(self):
        MShape.__init__(self)

        self.__text = QLabel()
        self.__text.setText("Button")
        self.__text.setAlignment(Qt.AlignCenter)
        self.__style = MButtonStyle.Raised
        self.__color = QColor("#EEE")
        self.__should_stick = False
        self.__blur = 2
        self.__color_anim = None
        self.__elev_anim = None
        self.__blur_anim = None
        self.__brush = QBrush(self.__color)
        self.__pen = QPen(self.__color)
        self.__shadow = QGraphicsDropShadowEffect()
        self.__shadow.setBlurRadius(self.blur)
        self.__animationSet = QParallelAnimationGroup()
        self.elevation = 1
        self.__shadow.setOffset(self.elevation)
        self.add_layout_item(self.__text, 0, 0)
        self.setLayout(self.layout)
        self.max_width = self.__text.fontMetrics().width(self.__text.text())
        self.max_height = self.__text.fontMetrics().height()
        self.width = self.max_width
        self.height = self.max_height
        self.margin_left = 5
        self.margin_top = 5
        self.setFixedSize(self.width + self.margin_left * 2, self.height + self.margin_top * 2)
        self.__painter = QPainter()
        self.__bounding_rect = QRect(self.x, self.y,
                                     self.width + self.margin_left * 2, self.height + self.margin_top * 2)
 def __init__(self):
     MShape.__init__(self)
     self.max_height = 200
     self.max_width = 200
     self.height = 200
     self.width = 200
     self.opacity = 0
     self.__brush = QBrush(QColor("#00796B"))
     self.__pen = QPen(QColor(0, 0, 0, 0))
Beispiel #4
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 100
     self.max_height = 100
     self.width = 0
     self.height = 0
     self.__painter = QPainter()
     self.__color = QColor(0, 0, 0, 100)
     self.__pen = QPen(QColor(0, 0, 0, 0), 2)
     self.__max_size = 100
Beispiel #5
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 20
     self.max_height = 20
     self.width = 20
     self.height = 20
     self.__color = QColor("#5A5A5A")
     self.__pen = QPen(self.__color, 2)
     self.__painter = QPainter()
     self.__bounding_rect = QRect(self.x + self.margin_left, self.y + self.margin_top,
                                  self.width, self.height)
Beispiel #6
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 16
     self.max_height = 16
     self.width = 16
     self.height = 16
     self.margin_top = 4
     self.margin_left = 4
     self.__color = MColors.PRIMARY_COLOR
     self.__pen = QPen(self.__color, 2)
     self.__bounding_rect = QRect(self.x + self.margin_left, self.y + self.margin_top,
                                  self.width, self.height)
Beispiel #7
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 20
     self.max_height = 20
     self.width = 20
     self.height = 20
     self.margin_x = 4
     self.margin_y = 4
     self.__color = QColor("#5A5A5A")
     self.__pen = QPen(self.__color, 2)
     self.__bounding_rect = QRect(self.x() + self.margin_x / 2, self.y() + self.margin_y / 2,
                                  self.width - self.margin_x, self.height - self.margin_y)
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 20
     self.max_height = 20
     self.width = 20
     self.height = 20
     self.margin_x = 12
     self.margin_y = 12
     self.__pen = QPen(MColors.PRIMARY_COLOR, 0)
     self.__color = MColors.PRIMARY_COLOR
     self.__bounding_rect = QRect(self.x() + self.margin_x / 2, self.y() + self.margin_y / 2,
                                  self.width - self.margin_x, self.height - self.margin_y)
Beispiel #9
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 8
     self.max_height = 8
     self.width = 8
     self.height = 8
     self.margin_top = 8
     self.margin_left = 8
     self.__pen = QPen(QColor(0, 0, 0, 0), 0)
     self.__color = MColors.PRIMARY_COLOR
     self.__bounding_rect = QRect(self.x + self.margin_left, self.y + self.margin_top,
                                  self.width, self.height)
     self.hide_initially()
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 100
     self.max_height = 100
     self.width = 100
     self.height = 100
     self.__color = MColors.PRIMARY_COLOR
     self.__pen = QPen(self.__color, 0)
     self.__painter = QPainter()
     self.__reveal = MCircularReveal()
     self.__reveal.duration = 1000
     self.__reveal.add_target(self)
     self.margin_start = 10
     self.margin_top = 15
     self.__bounding_rect = QRect(self.margin_start, self.margin_top, self.width, self.height)
Beispiel #11
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 30
     self.max_height = 30
     self.width = 30
     self.height = 30
     self.setFixedSize(self.width, self.height)
     self.innerCircle = InnerCircle()
     self.outerRing = OuterRing()
     self.add_layout_item(self.outerRing, 0, 0)
     self.add_layout_item(self.innerCircle, 0, 0)
     self.setLayout(self.layout)
     self.__checked = False
     self.__bounding_rect = QRect(self.x + self.margin_left / 2, self.y + self.margin_top / 2,
                                  self.width - self.margin_left, self.height - self.margin_top)
Beispiel #12
0
    def __init__(self):
        MShape.__init__(self)

        self.max_height = 20
        self.max_width = 20
        self.width = self.max_width
        self.height = self.max_height
        self.setFixedSize(self.width, self.height)
        self.__border = CheckboxBorder()
        self.__area = None
        self.add_layout_item(self.__border, 0, 0)
        self.__reveal = MCircularReveal()
        self.__reveal.duration = 300
        self.__fade = MFadeOut()
        self.__fade.duration = 200
        self.setLayout(self.layout)
        self.__checked = False
Beispiel #13
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 20
     self.max_height = 20
     self.width = 20
     self.height = 20
     self.margin_x = 4
     self.margin_y = 4
     self.__color = MColors.PRIMARY_COLOR
     self.__pen = QPen(self.__color, 2)
     self.__white_color = QColor("#FFF")
     self.__check_pen = QPen(self.__white_color, 2, c=Qt.SquareCap, j=Qt.MiterJoin)
     self.__check_path = QPainterPath()
     self.__check_path.moveTo(5, 10)
     self.__check_path.lineTo(9, 14)
     self.__check_path.moveTo(9, 14)
     self.__check_path.lineTo(15, 6)
     self.__bounding_rect = QRect(self.x() + self.margin_x / 2, self.y() + self.margin_y / 2,
                                  self.width - self.margin_x, self.height - self.margin_y)
Beispiel #14
0
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 20
     self.max_height = 20
     self.width = 20
     self.height = 20
     self.__color = MColors.PRIMARY_COLOR
     self.__pen = QPen(self.__color, 2)
     self.__white_color = QColor("#FFF")
     self.__check_pen = QPen(self.__white_color, 2, c=Qt.SquareCap, j=Qt.MiterJoin)
     self.__check_path = QPainterPath()
     self.__check_path.moveTo(5, 10)
     self.__check_path.lineTo(9, 14)
     self.__check_path.moveTo(9, 14)
     self.__check_path.lineTo(15, 6)
     self.__painter = QPainter()
     self.__bounding_rect = QRect(self.x + self.margin_left, self.y + self.margin_top,
                                  self.width, self.height)
     self.hide_initially()
    def __init__(self):
        MShape.__init__(self)

        self.max_height = 20
        self.max_width = 20
        self.width = self.max_width
        self.height = self.max_height
        self.setFixedSize(self.width, self.height)
        self.innerCircle = None
        self.outerRing = OuterRing()
        self.add_layout_item(self.outerRing, 0, 0)
        self.setLayout(self.layout)
        self.__checked = False
        self.__reveal = MCircularReveal()
        self.__reveal.duration = 300
        self.__fade = MFadeOut()
        self.__fade.duration = 200
        self.__bounding_rect = QRect(self.x() + self.margin_x / 2, self.y() + self.margin_y / 2,
                                     self.width - self.margin_x, self.height - self.margin_y)
 def __init__(self):
     MShape.__init__(self)
     self.max_width = 100
     self.max_height = 100
     self.width = 100
     self.height = 100
     self.__color = MColors.PRIMARY_COLOR
     self.__pen = QPen(self.__color, 0)
     self.__painter = QPainter()
     # self.__reveal = MCircularReveal()
     # self.__reveal.duration = 1000
     # self.__reveal.add_target(self)
     self.__ripple = MRipple()
     self.add_layout_item(self.__ripple, 0, 0)
     self.margin_left = 10
     self.margin_top = 15
     self.setLayout(self.layout)
     self.__scale = MFade()
     self.__scale.add_target(self)
     self.__bounding_rect = QRect(self.margin_left, self.margin_top, self.width, self.height)
    def __init__(self):
        MShape.__init__(self)
        self.max_width = 100
        self.max_height = 100
        self.width = 100
        self.height = 100
        self.__color = MColors.PRIMARY_COLOR
        self.__pen = QPen(self.__color, 0)
        self.__painter = QPainter()

        self.__ripple = MRipple()
        self.add_layout_item(self.__ripple, 0, 0)
        self.margin_left = 10
        self.margin_top = 15
        self.setLayout(self.layout)
        self.__scale = MFade()
        path = QPainterPath()
        path.addRect(0, 0, 100, 100)
        self.clip = path
        self.__scale.add_target(self)
        self.__bounding_rect = QRect(self.margin_left, self.margin_top, self.width, self.height)
def apply_transform(val: float, shape: MShape) -> None:
    shape.x = val
    shape.repaint()
Beispiel #19
0
 def __init__(self):
     MShape.__init__(self)
     self.__ripple = MRippleShape()
     self.add_layout_item(self.__ripple, 0, 0)
     self.setLayout(self.layout)
 def __init__(self):
     MShape.__init__(self)
     self.__checked = False