-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add weird animation on start stop button
- Loading branch information
fe-art
committed
Sep 10, 2024
1 parent
44d5e7b
commit c0e6552
Showing
2 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from PyQt6.QtCore import QEasingCurve, QPropertyAnimation, Qt | ||
from PyQt6.QtWidgets import QGraphicsDropShadowEffect | ||
|
||
|
||
def start_play_button_animation(self): | ||
self.glow_effect = QGraphicsDropShadowEffect(self) | ||
self.glow_effect.setBlurRadius(10) # Initial blur radius for the glow effect | ||
self.glow_effect.setColor(Qt.GlobalColor.cyan) | ||
self.glow_effect.setOffset(0, 0) # Center the shadow to create the glow effect | ||
self.start_stop_button.setGraphicsEffect(self.glow_effect) | ||
|
||
_start_glow_animation(self) | ||
|
||
|
||
def _start_glow_animation(self): | ||
"""Create a glow effect animation.""" | ||
self.glow_animation = QPropertyAnimation(self.glow_effect, b"blurRadius") | ||
self.glow_animation.setStartValue(0) | ||
self.glow_animation.setEndValue(25) | ||
self.glow_animation.setDuration(2000) | ||
self.glow_animation.setEasingCurve(QEasingCurve.Type.SineCurve) | ||
self.glow_animation.setLoopCount(-1) | ||
self.glow_animation.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters