13 from PyQt6.QtCore import Qt, QTimer, QPoint |
13 from PyQt6.QtCore import Qt, QTimer, QPoint |
14 from PyQt6.QtWidgets import QFrame, QWidget, QVBoxLayout |
14 from PyQt6.QtWidgets import QFrame, QWidget, QVBoxLayout |
15 |
15 |
16 from .Ui_NotificationFrame import Ui_NotificationFrame |
16 from .Ui_NotificationFrame import Ui_NotificationFrame |
17 |
17 |
18 import Globals |
18 from eric7 import Globals, Preferences |
19 import Preferences |
19 from eric7.EricGui import EricPixmapCache |
20 import UI.PixmapCache |
|
21 |
20 |
22 |
21 |
23 class NotificationTypes(enum.Enum): |
22 class NotificationTypes(enum.Enum): |
24 """ |
23 """ |
25 Class implementing the notification types. |
24 Class implementing the notification types. |
84 @type NotificationTypes |
83 @type NotificationTypes |
85 @return icon for the notification kind |
84 @return icon for the notification kind |
86 @rtype QPixmap |
85 @rtype QPixmap |
87 """ |
86 """ |
88 if kind == NotificationTypes.CRITICAL: |
87 if kind == NotificationTypes.CRITICAL: |
89 return UI.PixmapCache.getPixmap("notificationCritical48") |
88 return EricPixmapCache.getPixmap("notificationCritical48") |
90 elif kind == NotificationTypes.WARNING: # __NO-TASK__ |
89 elif kind == NotificationTypes.WARNING: # __NO-TASK__ |
91 return UI.PixmapCache.getPixmap("notificationWarning48") |
90 return EricPixmapCache.getPixmap("notificationWarning48") |
92 elif kind == NotificationTypes.INFORMATION: |
91 elif kind == NotificationTypes.INFORMATION: |
93 return UI.PixmapCache.getPixmap("notificationInformation48") |
92 return EricPixmapCache.getPixmap("notificationInformation48") |
94 else: |
93 else: |
95 return UI.PixmapCache.getPixmap("notification48") |
94 return EricPixmapCache.getPixmap("notification48") |
96 |
95 |
97 @classmethod |
96 @classmethod |
98 def getStyleSheet(cls, kind): |
97 def getStyleSheet(cls, kind): |
99 """ |
98 """ |
100 Class method to get a style sheet for specific notification kind. |
99 Class method to get a style sheet for specific notification kind. |