diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-19 00:03:47 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-19 00:03:47 +1100 |
| commit | cc589cec95de1b6db19a8ce3cac1ede2e6d19b9f (patch) | |
| tree | 0250830c1e93f81e2f0bab773367a5f032446e1d /src | |
| parent | bar: better datetime for vertical mode (diff) | |
| download | caelestia-shell-cc589cec95de1b6db19a8ce3cac1ede2e6d19b9f.tar.gz caelestia-shell-cc589cec95de1b6db19a8ce3cac1ede2e6d19b9f.tar.bz2 caelestia-shell-cc589cec95de1b6db19a8ce3cac1ede2e6d19b9f.zip | |
notifpopups: more compact + better styles
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets/notification.tsx | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/widgets/notification.tsx b/src/widgets/notification.tsx index 3def064..99ab71c 100644 --- a/src/widgets/notification.tsx +++ b/src/widgets/notification.tsx @@ -84,17 +84,34 @@ export default class Notification extends Widget.Box { {notification.image && <Image icon={notification.image} />} <box vertical> <label className="summary" xalign={0} label={notification.summary} truncate /> - <label className="body" xalign={0} label={notification.body} wrap useMarkup /> + {notification.body && ( + <label + className="body" + xalign={0} + label={popup ? notification.body.split("\n")[0] : notification.body} + wrap + useMarkup + lines={popup ? 1 : -1} + truncate={popup} + /> + )} </box> </box> - <box className="actions"> - <button hexpand cursor="pointer" onClicked={() => notification.dismiss()} label="Close" /> - {notification.actions.map(a => ( - <button hexpand cursor="pointer" onClicked={() => notification.invoke(a.id)}> - {notification.actionIcons ? <icon icon={a.label} /> : a.label} - </button> - ))} - </box> + {!popup && ( + <box className="actions"> + <button + hexpand + cursor="pointer" + onClicked={() => notification.dismiss()} + label="Close" + /> + {notification.actions.map(a => ( + <button hexpand cursor="pointer" onClicked={() => notification.invoke(a.id)}> + {notification.actionIcons ? <icon icon={a.label} /> : a.label} + </button> + ))} + </box> + )} </box> </box> </revealer> |