mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
23 lines
782 B
Python
23 lines
782 B
Python
from PySide6.QtWidgets import QMessageBox
|
|
from utils.data.state import state
|
|
import qdarktheme
|
|
|
|
class NotificationPopup(QMessageBox):
|
|
def __init__(self, title, text, infotext=None, parent=None, darkmode=True):
|
|
super().__init__(parent)
|
|
|
|
if darkmode is True:
|
|
custom_colors = {}
|
|
if state.accent_color:
|
|
custom_colors["primary"] = state.accent_color
|
|
qdarktheme.setup_theme("auto", custom_colors=custom_colors if custom_colors else None)
|
|
|
|
self.setIcon(QMessageBox.Icon.Information)
|
|
self.setWindowTitle(title)
|
|
self.setText(text)
|
|
|
|
if infotext is not None:
|
|
self.setInformativeText(infotext)
|
|
|
|
self.setStandardButtons(QMessageBox.StandardButton.Ok)
|