mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
fix: qdarktheme setup on some notification popups
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user