summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-23 16:48:26 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-23 16:48:26 +1100
commitdda2fad2649fac8d46663e97aeab91991df67a5a (patch)
tree161cc6f8c9e83c6b3203038c93df12cad6a667f2
parentnotifpopups: border for critical urgency (diff)
downloadcaelestia-shell-dda2fad2649fac8d46663e97aeab91991df67a5a.tar.gz
caelestia-shell-dda2fad2649fac8d46663e97aeab91991df67a5a.tar.bz2
caelestia-shell-dda2fad2649fac8d46663e97aeab91991df67a5a.zip
notifpopups: shrink image
-rw-r--r--scss/widgets.scss7
-rw-r--r--src/widgets/notification.tsx9
2 files changed, 11 insertions, 5 deletions
diff --git a/scss/widgets.scss b/scss/widgets.scss
index 1bf2349..0e2807c 100644
--- a/scss/widgets.scss
+++ b/scss/widgets.scss
@@ -42,9 +42,14 @@ label.icon {
background-size: cover;
background-position: center;
+ margin-top: lib.s(3);
min-width: lib.s(64);
min-height: lib.s(64);
- margin-top: lib.s(3);
+
+ &.small {
+ min-width: lib.s(48);
+ min-height: lib.s(48);
+ }
}
.summary {
diff --git a/src/widgets/notification.tsx b/src/widgets/notification.tsx
index 10f2076..d076861 100644
--- a/src/widgets/notification.tsx
+++ b/src/widgets/notification.tsx
@@ -51,18 +51,19 @@ const AppIcon = ({ appIcon, desktopEntry }: { appIcon: string; desktopEntry: str
return icon ? <icon className="app-icon" icon={icon} /> : null;
};
-const Image = ({ icon }: { icon: string }) => {
+const Image = ({ popup, icon }: { popup?: boolean; icon: string }) => {
if (GLib.file_test(icon, GLib.FileTest.EXISTS))
return (
<box
valign={Gtk.Align.START}
- className="image"
+ className={`image ${popup ? "small" : ""}`}
css={`
background-image: url("${icon}");
`}
/>
);
- if (Astal.Icon.lookup_icon(icon)) return <icon valign={Gtk.Align.START} className="image" icon={icon} />;
+ if (Astal.Icon.lookup_icon(icon))
+ return <icon valign={Gtk.Align.START} className={`image ${popup ? "small" : ""}`} icon={icon} />;
return null;
};
@@ -93,7 +94,7 @@ export default class Notification extends Widget.Box {
</box>
<box hexpand className="separator" />
<box className="content">
- {notification.image && <Image icon={notification.image} />}
+ {notification.image && <Image popup={popup} icon={notification.image} />}
<box vertical>
<label className="summary" xalign={0} label={notification.summary} truncate />
{notification.body && (