Add widget shake animation for invalid input
Introduce a shake animation to visually indicate invalid inputs and wire it into validation/error flows. Changes: import QPoint; add animate_widget_shake(QWidget) implementation that uses QPropertyAnimation on widget.pos with keyframes; call the animation when URL/path/format validations fail and replace some direct status_label updates with set_status_message_animated. Updated files: ytsage/gui/ytsage_gui_main.py and ytsage/gui/ytsage_gui_analysis.py.
This commit is contained in:
@@ -271,12 +271,16 @@ class AnalysisMixin:
|
||||
url = self.url_input.text().strip()
|
||||
if not url:
|
||||
self.signals.update_status.emit(_("main_ui.invalid_url_or_enter"))
|
||||
if hasattr(self, "animate_widget_shake"):
|
||||
self.animate_widget_shake(self.url_input)
|
||||
return
|
||||
|
||||
# Validate URL before processing
|
||||
is_valid, error_message = validate_video_url(url)
|
||||
if not is_valid:
|
||||
QMessageBox.warning(self, _("main_ui.error_title"), error_message)
|
||||
if hasattr(self, "animate_widget_shake"):
|
||||
self.animate_widget_shake(self.url_input)
|
||||
return
|
||||
|
||||
# Cancel any existing analysis thread
|
||||
|
||||
Reference in New Issue
Block a user