mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 17:59:43 +02:00
1a7de70c0b
Add image overlay opacity support and related UI/settings, plus robust config migration and error handling. Key changes: - UI: image overlay now uses QGraphicsOpacityEffect, hides when disabled, and updates opacity on state changes (src/interface/dialogs/image.py). - New NotificationPopup dialog for user alerts (src/interface/dialogs/notificationpopup.py). - Settings dialog: added Image Opacity control, adjusted labels, persist/rollback behavior on cancel, and include opacity when saving (src/interface/dialogs/settings.py). - State: added properties for image_opacity and image_enabled with change notifications; renamed image_width setter param for clarity (src/utils/data/state.py). - Config: switch from config.yml to config.ini, implement one-time migration, typed read/write of values, validation/error handling, automatic backups of corrupted files and user notification (src/utils/config/config.py). - Settings save: accept and persist image_opacity (src/utils/config/settings.py). - Startup: initialize QApplication earlier and pass app to run_gui (src/main.py). - Minor: removed an extra blank line in log handler and small import cleanups. These changes enable adjustable overlay transparency, improve config reliability, and surface errors to users while preserving/backuping old configs.
17 lines
514 B
Python
17 lines
514 B
Python
from PySide6.QtWidgets import QMessageBox
|
|
import qdarktheme
|
|
|
|
class NotificationPopup(QMessageBox):
|
|
def __init__(self, title, text, infotext=None, parent=None):
|
|
super().__init__(parent)
|
|
|
|
qdarktheme.setup_theme("auto")
|
|
|
|
self.setIcon(QMessageBox.Icon.Information)
|
|
self.setWindowTitle(title)
|
|
self.setText(text)
|
|
|
|
if infotext is not None:
|
|
self.setInformativeText(infotext)
|
|
|
|
self.setStandardButtons(QMessageBox.StandardButton.Ok) |