-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinfo_bar.py
51 lines (49 loc) · 1.43 KB
/
info_bar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from PyQt5.QtCore import Qt
from qfluentwidgets import InfoBar, InfoBarPosition
def info_bar(MainWindow, title, content, style='o', timeout=5000, closeable=True, position='↑'):
if position == '→':
position = InfoBarPosition.TOP_RIGHT
elif position == '↓':
position = InfoBarPosition.BOTTOM
elif position == '↑':
position = InfoBarPosition.TOP
if style == 'o':
InfoBar.success(
title=title,
content=content,
orient=Qt.Horizontal,
isClosable=closeable,
position=position,
duration=timeout,
parent=MainWindow
)
elif style == 'e':
InfoBar.error(
title=title,
content=content,
orient=Qt.Horizontal,
isClosable=closeable,
position=position,
duration=timeout,
parent=MainWindow
)
elif style == 'w':
InfoBar.warning(
title=title,
content=content,
orient=Qt.Horizontal,
isClosable=closeable,
position=position,
duration=timeout,
parent=MainWindow
)
elif style == 'i':
InfoBar.info(
title=title,
content=content,
orient=Qt.Horizontal,
isClosable=closeable,
position=position,
duration=timeout,
parent=MainWindow
)