fix: qdarktheme setup on some notification popups

This commit is contained in:
2026-04-10 18:47:21 +02:00
parent 8d5b76e054
commit 761158746f
2 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -13,7 +13,10 @@ class UIBridge(QObject):
ui_bridge = UIBridge()
def show_megadb_notification():
notification_popup = NotificationPopup("Opened MegaDB link in browser", "Beware of malicious Ads. Make sure to have an adblocker installed.\n" '<br><a href="https://ublockorigin.com">Visit uBlock Origin</a>')
notification_popup = NotificationPopup(title="Opened MegaDB link in browser",
text="Beware of malicious Ads. Make sure to have an adblocker installed.\n" '<br><a href="https://ublockorigin.com">Visit uBlock Origin</a>',
darkmode=False if state.window_transparency else True
)
notification_popup.setTextFormat(Qt.TextFormat.RichText)
notification_popup.setTextInteractionFlags(Qt.TextInteractionFlag.TextBrowserInteraction)
notification_popup.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
+5 -1
View File
@@ -1,9 +1,13 @@
from PySide6.QtWidgets import QMessageBox
import qdarktheme
class NotificationPopup(QMessageBox):
def __init__(self, title, text, infotext=None, parent=None):
def __init__(self, title, text, infotext=None, parent=None, darkmode=True):
super().__init__(parent)
if darkmode is True:
qdarktheme.setup_theme("auto")
self.setIcon(QMessageBox.Icon.Information)
self.setWindowTitle(title)
self.setText(text)