mirror of
https://github.com/RedDeadDepresso/KKAFIO.git
synced 2025-12-22 09:20:02 +00:00
32 lines
788 B
Python
32 lines
788 B
Python
from PySide6.QtCore import Qt
|
|
from qfluentwidgets import InfoBar, InfoBarPosition
|
|
|
|
|
|
class Notification:
|
|
|
|
mainWindow = None
|
|
|
|
def success(self, title: str, content: str = ''):
|
|
InfoBar.success(
|
|
title=title,
|
|
content=content,
|
|
orient=Qt.Horizontal,
|
|
isClosable=True,
|
|
position=InfoBarPosition.TOP_RIGHT,
|
|
duration=2000,
|
|
parent=self.mainWindow
|
|
)
|
|
|
|
def error(self, title: str, content: str = ''):
|
|
InfoBar.error(
|
|
title=title,
|
|
content=content,
|
|
orient=Qt.Horizontal,
|
|
isClosable=True,
|
|
position=InfoBarPosition.TOP_RIGHT,
|
|
duration=2000,
|
|
parent=self.mainWindow
|
|
)
|
|
|
|
|
|
notification = Notification() |