Compare commits
No commits in common. "8f992718cb4f3b0ac52e80cef70f49ee68140420" and "bb7a001eb8080ad99606a83ffd14ea86fe71a61c" have entirely different histories.
8f992718cb
...
bb7a001eb8
2 changed files with 16 additions and 33 deletions
|
@ -54,10 +54,7 @@ const NotificationIcon = ({ appEntry, appIcon, image }) => {
|
|||
export default ({ id, summary, body, actions, urgency, time, command = i => {}, ...icon }) => Draggable({
|
||||
maxOffset: 200,
|
||||
command: () => command(id),
|
||||
properties: [
|
||||
['hovered', false],
|
||||
['id', id],
|
||||
],
|
||||
properties: [['hovered', false]],
|
||||
onHover: w => {
|
||||
if (!w._hovered) {
|
||||
w._hovered = true;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const { Notifications } = ags.Service;
|
||||
const { Button, Label, Box, Icon, Scrollable, Window, Revealer } = ags.Widget;
|
||||
const { timeout } = ags.Utils;
|
||||
|
||||
import Notification from './base.js';
|
||||
import { EventBox } from '../misc/cursorbox.js'
|
||||
|
@ -34,35 +33,22 @@ const Header = () => Box({
|
|||
const NotificationList = () => Box({
|
||||
vertical: true,
|
||||
vexpand: true,
|
||||
connections: [
|
||||
[Notifications, (box, id) => {
|
||||
if (box.children.length == 0) {
|
||||
box.children = Notifications.notifications
|
||||
.reverse()
|
||||
.map(n => Notification({ ...n, command: i => Notifications.close(i), }));
|
||||
}
|
||||
else if (id) {
|
||||
box.add(Notification({
|
||||
...Notifications.getNotification(id),
|
||||
command: i => Notifications.close(i),
|
||||
}));
|
||||
box.show_all();
|
||||
}
|
||||
connections: [[Notifications, (box, id) => {
|
||||
if (box.children.length == 0) {
|
||||
box.children = Notifications.notifications
|
||||
.reverse()
|
||||
.map(n => Notification({ ...n, command: i => Notifications.close(i), }));
|
||||
}
|
||||
else if (id) {
|
||||
box.add(Notification({
|
||||
...Notifications.getNotification(id),
|
||||
command: i => Notifications.close(i),
|
||||
}));
|
||||
box.show_all();
|
||||
}
|
||||
|
||||
box.visible = Notifications.notifications.length > 0;
|
||||
}, 'notified'],
|
||||
|
||||
[Notifications, (box, id) => {
|
||||
box.visible = Notifications.notifications.length > 0;
|
||||
for (const ch of box.children) {
|
||||
if (ch._id == id) {
|
||||
ch.child.setStyle(ch.child._rightAnim);
|
||||
timeout(500, () => box.remove(ch));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, 'closed'],
|
||||
],
|
||||
box.visible = Notifications.notifications.length > 0;
|
||||
}, 'notified']],
|
||||
});
|
||||
|
||||
const Placeholder = () => Revealer({
|
||||
|
|
Loading…
Reference in a new issue