9 |
9 |
10 # |
10 # |
11 # Code was inspired by qupzilla web browser |
11 # Code was inspired by qupzilla web browser |
12 # |
12 # |
13 |
13 |
|
14 import enum |
|
15 |
14 from PyQt6.QtCore import QPoint, QTimeLine, pyqtSlot |
16 from PyQt6.QtCore import QPoint, QTimeLine, pyqtSlot |
15 from PyQt6.QtWidgets import QWidget |
17 from PyQt6.QtWidgets import QWidget |
16 |
18 |
|
19 |
|
20 class EricAnimationDirection(enum.Enum): |
|
21 """ |
|
22 Class defining the animation directions. |
|
23 """ |
|
24 Down = 0 |
|
25 Up = 1 |
17 |
26 |
18 class EricAnimatedWidget(QWidget): |
27 class EricAnimatedWidget(QWidget): |
19 """ |
28 """ |
20 Class implementing an animated widget. |
29 Class implementing an animated widget. |
21 """ |
30 """ |
22 |
31 |
23 # TODO: change this to an enum |
32 def __init__( |
24 DirectionDown = 0 |
33 self, direction=EricAnimationDirection.Down, duration=300, parent=None |
25 DirectionUp = 1 |
34 ): |
26 |
|
27 def __init__(self, direction=DirectionDown, duration=300, parent=None): |
|
28 """ |
35 """ |
29 Constructor |
36 Constructor |
30 |
37 |
31 @param direction direction of the animation |
38 @param direction direction of the animation |
32 @type int (one of DirectionDown or DirectionUp) |
39 @type EricAnimationDirection |
33 @param duration duration of the animation |
40 @param duration duration of the animation |
34 @type int |
41 @type int |
35 @param parent reference to the parent widget |
42 @param parent reference to the parent widget |
36 @type QWidget |
43 @type QWidget |
37 """ |
44 """ |