This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
checkbox.py
41 lines (30 loc) · 1.68 KB
/
checkbox.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from .checkable import *
class QMaterialCheckBox(QMaterialCheckable):
def __init__(self, parent: QWidget = None, **kwargs):
QMaterialCheckable.__init__(self, parent=parent, **kwargs)
self.checkedState.assignProperty(self.m_checkedIcon, "_iconSize", 24)
self.uncheckedState.assignProperty(self.m_checkedIcon, "_iconSize", 0)
animation = QPropertyAnimation(self.m_checkedIcon, b"_iconSize", self)
animation.setDuration(300)
self.uncheckedTransition.addAnimation(animation)
animation = QPropertyAnimation(self.m_checkedIcon, b"_iconSize", self)
animation.setDuration(1300)
self.checkedTransition.addAnimation(animation)
animation = QPropertyAnimation(self.m_checkedIcon, b"_opacity", self)
animation.setDuration(440)
self.checkedTransition.addAnimation(animation)
animation = QPropertyAnimation(self.m_checkedIcon, b"_opacity", self)
animation.setDuration(440)
self.uncheckedTransition.addAnimation(animation)
animation = QPropertyAnimation(self.m_uncheckedIcon, b"_opacity", self)
animation.setDuration(440)
self.checkedTransition.addAnimation(animation)
animation = QPropertyAnimation(self.m_uncheckedIcon, b"_opacity", self)
animation.setDuration(440)
self.uncheckedTransition.addAnimation(animation)
animation = QPropertyAnimation(self.m_uncheckedIcon, b"_color", self)
animation.setDuration(440)
self.checkedTransition.addAnimation(animation)
animation = QPropertyAnimation(self.m_uncheckedIcon, b"_color", self)
animation.setDuration(440)
self.uncheckedTransition.addAnimation(animation)