From d05b124609ca56c99ff9ef32aa2e5217bcde295e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 1 Apr 2025 13:36:23 +1100 Subject: feat: thumbnailer utility Fix large images in notifications being slow GTK css background image is really slow for scaling for some reason, so thumbnail --- src/widgets/notification.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/widgets/notification.tsx') diff --git a/src/widgets/notification.tsx b/src/widgets/notification.tsx index b2a10be..0dfd368 100644 --- a/src/widgets/notification.tsx +++ b/src/widgets/notification.tsx @@ -1,4 +1,5 @@ import { desktopEntrySubs } from "@/utils/icons"; +import Thumbnailer from "@/utils/thumbnailer"; import { setupCustomTooltip } from "@/utils/widgets"; import { bind, GLib, register, timeout, Variable } from "astal"; import { Astal, Gtk, Widget } from "astal/gtk3"; @@ -58,9 +59,11 @@ const Image = ({ compact, icon }: { compact?: boolean; icon: string }) => { + Thumbnailer.thumbnail(icon) + .then(p => (self.css = `background-image: url("${p}");`)) + .catch(console.error) + } /> ); if (Astal.Icon.lookup_icon(icon)) -- cgit v1.2.3-freya