Added Default notification icon
This commit is contained in:
1 parent
f5997996a9
commit
d13a79059d
2 files changed
+6
-2
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
from fabric.utils import get_relative_path
|
||||||
from gi.repository import Gdk, GdkPixbuf, GLib, Gtk # type: ignore
|
from gi.repository import Gdk, GdkPixbuf, GLib, Gtk # type: ignore
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
@@ -103,7 +104,7 @@ class NotificationWidget(Box):
|
|||||||
if "file://" in notification.app_icon
|
if "file://" in notification.app_icon
|
||||||
else Image(
|
else Image(
|
||||||
name="notification-icon",
|
name="notification-icon",
|
||||||
icon_name="dialog-information-symbolic" or notification.app_icon,
|
icon_name="notifications" or notification.app_icon,
|
||||||
icon_size=24,
|
icon_size=24,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -208,8 +209,11 @@ class NotificationWidget(Box):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def get_pixbuf(self, icon_path, width, height):
|
def get_pixbuf(self, icon_path, width, height):
|
||||||
if icon_path.startswith("file://"):
|
if icon_path.startswith("file://") and os.path.exists(icon_path):
|
||||||
icon_path = icon_path[7:]
|
icon_path = icon_path[7:]
|
||||||
|
else:
|
||||||
|
icon_path = get_relative_path("../../config/assets/icons/notification.png")
|
||||||
|
logger.warning(f"Invalid icon path: {icon_path}")
|
||||||
|
|
||||||
if not os.path.exists(icon_path):
|
if not os.path.exists(icon_path):
|
||||||
logger.warning(f"Icon path does not exist: {icon_path}")
|
logger.warning(f"Icon path does not exist: {icon_path}")
|
||||||
|
|||||||
Reference in new issue
Block a user