Refacto, enum, utils, WIP

This commit is contained in:
2026-03-16 13:47:30 +01:00
parent 5b065dddfc
commit e922825481
8 changed files with 46 additions and 47 deletions

View File

@@ -1,7 +1,7 @@
from PySide6.QtCore import QPropertyAnimation, QEasingCurve
from PySide6.QtWidgets import QGraphicsDropShadowEffect
from constants import GLOW_COLOR, GLOW_BLUR_BASE, GLOW_BLUR_PEAK, GLOW_ANIM_DURATION
from constants import Glow
class GlowAnimator:
@@ -11,15 +11,15 @@ class GlowAnimator:
self._widget = widget
self._effect = QGraphicsDropShadowEffect(widget)
self._effect.setBlurRadius(GLOW_BLUR_BASE)
self._effect.setBlurRadius(Glow.BLUR_BASE.value)
self._effect.setOffset(0, 0)
self._effect.setColor(GLOW_COLOR)
self._effect.setColor(Glow.COLOR.value)
self._anim = QPropertyAnimation(self._effect, b"blurRadius")
self._anim.setDuration(GLOW_ANIM_DURATION)
self._anim.setStartValue(GLOW_BLUR_BASE)
self._anim.setKeyValueAt(0.5, GLOW_BLUR_PEAK)
self._anim.setEndValue(GLOW_BLUR_BASE)
self._anim.setDuration(Glow.ANIM_DURATION.value)
self._anim.setStartValue(Glow.BLUR_BASE.value)
self._anim.setKeyValueAt(0.5, Glow.BLUR_PEAK.value)
self._anim.setEndValue(Glow.BLUR_BASE.value)
self._anim.setEasingCurve(QEasingCurve.InOutQuad)
self._anim.setLoopCount(-1)