⚡ ags(notifications): better icon-getting method
This commit is contained in:
@@ -3,6 +3,7 @@ import AstalNotifd from "gi://AstalNotifd";
|
|||||||
import { Separator } from "./Separator";
|
import { Separator } from "./Separator";
|
||||||
import { HistoryNotification, Notifications } from "../scripts/notifications";
|
import { HistoryNotification, Notifications } from "../scripts/notifications";
|
||||||
import { GLib } from "astal";
|
import { GLib } from "astal";
|
||||||
|
import { getAppIcon } from "../scripts/apps";
|
||||||
|
|
||||||
export function getUrgencyString(notif: AstalNotifd.Notification) {
|
export function getUrgencyString(notif: AstalNotifd.Notification) {
|
||||||
switch(notif.urgency) {
|
switch(notif.urgency) {
|
||||||
@@ -77,14 +78,10 @@ export function NotificationWidget(notification: AstalNotifd.Notification|number
|
|||||||
children: [
|
children: [
|
||||||
new Widget.Icon({
|
new Widget.Icon({
|
||||||
className: "icon app-icon",
|
className: "icon app-icon",
|
||||||
icon: (notification instanceof AstalNotifd.Notification) && Astal.Icon.lookup_icon(notification.appIcon) ?
|
icon: notification.appIcon && Astal.Icon.lookup_icon(notification.appIcon) ?
|
||||||
notification.appIcon
|
notification.appIcon
|
||||||
: (Astal.Icon.lookup_icon(notification.appName.toLowerCase()) ?
|
: getAppIcon(notification.appName),
|
||||||
notification.appName.toLowerCase()
|
setup: (self) => self.set_visible(Boolean(self.get_icon())),
|
||||||
: "image-missing"
|
|
||||||
),
|
|
||||||
setup: (_) => _.get_icon() === "image-missing" &&
|
|
||||||
_.set_visible(false),
|
|
||||||
halign: Gtk.Align.START,
|
halign: Gtk.Align.START,
|
||||||
css: "font-size: 16px;"
|
css: "font-size: 16px;"
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user