Run dialogs with blurred screenshot overlay

Add a safe blurred-overlay flow for modal dialogs by implementing run_dialog_with_blur and _apply_blur_to_pixmap on YTSageApp. The new flow captures a window screenshot, generates a blurred/dimmed pixmap via a QGraphicsScene + QGraphicsBlurEffect, shows it in an overlay QLabel with a fade-in, runs the dialog, and then removes the overlay.

Replace many direct dialog.exec() calls with run_dialog_with_blur(...) across the main GUI (download settings, about, history, playlist selection, custom options, cookie login, ffmpeg check, time range, setup success dialogs, etc.). Also add imports required for pixmap/graphics handling.

Make animate_widget_fade_in usage safer by checking for the method before calling it and falling back to setVisible(True) for format table and thumbnails to avoid QPainter/graphics-effect conflicts. Small comment/cleanup in fade-in/out methods.
This commit is contained in:
oop7
2026-02-01 14:23:32 +02:00
parent 7890a94702
commit 79a85cf707
3 changed files with 103 additions and 16 deletions
+7 -3
View File
@@ -310,7 +310,7 @@ class VideoInfoMixin:
# removed extra logic for mapping to main_windows
merge_checkbox = getattr(self, "merge_subs_checkbox", None)
if dialog.exec(): # If user clicks OK
if self.run_dialog_with_blur(dialog): # If user clicks OK
self.selected_subtitles = dialog.get_selected_subtitles()
logger.info(f"Selected subtitles: {self.selected_subtitles}")
# Update UI to reflect selection
@@ -356,7 +356,7 @@ class VideoInfoMixin:
dialog = SponsorBlockCategoryDialog(dialog_categories, self)
if dialog.exec():
if self.run_dialog_with_blur(dialog):
self.selected_sponsorblock_categories = dialog.get_selected_categories()
logger.info(f"SponsorBlock categories selected: {self.selected_sponsorblock_categories}")
self._update_sponsorblock_display()
@@ -414,7 +414,11 @@ class VideoInfoMixin:
# Fade in the thumbnail
self.thumbnail_label.setVisible(False)
self.thumbnail_label.setPixmap(pixmap)
self.animate_widget_fade_in(self.thumbnail_label)
if hasattr(self, "animate_widget_fade_in"):
self.animate_widget_fade_in(self.thumbnail_label)
else:
self.thumbnail_label.setVisible(True)
except Exception as e:
logger.exception(f"Error processing thumbnail image: {e}")