diff --git a/devices/wim/config/ags/config.js b/devices/wim/config/ags/config.js index f596eaa9..48267d9d 100644 --- a/devices/wim/config/ags/config.js +++ b/devices/wim/config/ags/config.js @@ -1,22 +1,22 @@ -import App from 'resource:///com/github/Aylur/ags/app.js'; +import App from 'resource:///com/github/Aylur/ags/app.js'; import { exec } from 'resource:///com/github/Aylur/ags/utils.js'; -import Setup from './js/setup.js'; +import Setup from './js/setup.js'; import AppLauncher from './js/applauncher/main.js'; -import Bar from './js/bar/main.js'; -import BgFade from './js/misc/background-fade.js'; -import Calendar from './js/date.js'; -import Corners from './js/corners/main.js'; -import NotifCenter from './js/notifications/center.js'; -import NotifPopups from './js/notifications/popup.js'; -import OSD from './js/osd/main.js'; -import OSK from './js/on-screen-keyboard/main.js'; -import Overview from './js/overview/main.js'; -import Powermenu from './js/powermenu.js'; -import QSettings from './js/quick-settings/main.js'; +import Bar from './js/bar/main.js'; +import BgFade from './js/misc/background-fade.js'; +import Calendar from './js/date.js'; +import Corners from './js/corners/main.js'; +import { NotifPopups, NotifCenter } from './js/notifications/main.js'; +import OSD from './js/osd/main.js'; +import OSK from './js/on-screen-keyboard/main.js'; +import Overview from './js/overview/main.js'; +import Powermenu from './js/powermenu.js'; +import QSettings from './js/quick-settings/main.js'; + +const scss = `${App.configDir }/scss/main.scss`; +const css = `${App.configDir }/style.css`; -const scss = App.configDir + '/scss/main.scss'; -const css = App.configDir + '/style.css'; exec(`sassc ${scss} ${css}`); Setup(); diff --git a/devices/wim/config/ags/js/bar/buttons/notif-button.js b/devices/wim/config/ags/js/bar/buttons/notif-button.js index 4446a02c..abe14fdc 100644 --- a/devices/wim/config/ags/js/bar/buttons/notif-button.js +++ b/devices/wim/config/ags/js/bar/buttons/notif-button.js @@ -3,12 +3,8 @@ import Notifications from 'resource:///com/github/Aylur/ags/service/notification import { Box, Icon, Label } from 'resource:///com/github/Aylur/ags/widget.js'; -import Separator from '../../misc/separator.js'; import EventBox from '../../misc/cursorbox.js'; -const L_PADDING = 28; -const R_PADDING = 8; - export default () => EventBox({ className: 'toggle-off', @@ -26,9 +22,8 @@ export default () => EventBox({ vertical: false, children: [ - Separator(L_PADDING), - Icon({ + hpack: 'center', connections: [[Notifications, (self) => { if (Notifications.dnd) { self.icon = 'notification-disabled-symbolic'; @@ -41,9 +36,6 @@ export default () => EventBox({ } }]], }), - - Separator(R_PADDING), - Label({ binds: [['label', Notifications, 'notifications', (n) => String(n.length)]], diff --git a/devices/wim/config/ags/js/notifications/center.js b/devices/wim/config/ags/js/notifications/center.js index 51609784..d3a7a9e6 100644 --- a/devices/wim/config/ags/js/notifications/center.js +++ b/devices/wim/config/ags/js/notifications/center.js @@ -3,7 +3,6 @@ import Notifications from 'resource:///com/github/Aylur/ags/service/notification import { Button, Label, Box, Icon, Scrollable, Revealer } from 'resource:///com/github/Aylur/ags/widget.js'; import { Notification, HasNotifs } from './base.js'; -import PopupWindow from '../misc/popup.js'; import EventBox from '../misc/cursorbox.js'; @@ -100,7 +99,7 @@ const Placeholder = () => Revealer({ }), }); -const NotificationCenterWidget = () => Box({ +export default () => Box({ className: 'notification-center', vertical: true, children: [ @@ -124,13 +123,3 @@ const NotificationCenterWidget = () => Box({ }), ], }); - -const TOP_MARGIN = 6; -const RIGHT_MARGIN = 60; - -export default () => PopupWindow({ - name: 'notification-center', - anchor: ['top', 'right'], - margins: [TOP_MARGIN, RIGHT_MARGIN, 0, 0], - child: NotificationCenterWidget(), -}); diff --git a/devices/wim/config/ags/js/notifications/main.js b/devices/wim/config/ags/js/notifications/main.js new file mode 100644 index 00000000..64e5fc58 --- /dev/null +++ b/devices/wim/config/ags/js/notifications/main.js @@ -0,0 +1,26 @@ +import PopUpsWidget from './popup.js'; +import NotifCenterWidget from './center.js'; + +import PopupWindow from '../misc/popup.js'; + +export const NotifPopups = () => PopupWindow({ + name: 'notifications', + anchor: ['top', 'left'], + visible: true, + transition: 'none', + closeOnUnfocus: 'stay', + + child: PopUpsWidget(), +}); + + +const TOP_MARGIN = 6; +const RIGHT_MARGIN = 60; + +export const NotifCenter = () => PopupWindow({ + name: 'notification-center', + anchor: ['top', 'right'], + margins: [TOP_MARGIN, RIGHT_MARGIN, 0, 0], + + child: NotifCenterWidget(), +}); diff --git a/devices/wim/config/ags/js/notifications/popup.js b/devices/wim/config/ags/js/notifications/popup.js index 92ca3d93..2baaebe2 100644 --- a/devices/wim/config/ags/js/notifications/popup.js +++ b/devices/wim/config/ags/js/notifications/popup.js @@ -6,7 +6,6 @@ import { interval } from 'resource:///com/github/Aylur/ags/utils.js'; import GLib from 'gi://GLib'; import { Notification } from './base.js'; -import PopupWindow from '../misc/popup.js'; const DELAY = 2000; @@ -55,20 +54,12 @@ const handleDismiss = (box, id, force = false) => { } }; -export default () => PopupWindow({ - name: 'notifications', - anchor: ['top', 'left'], - visible: true, - transition: 'none', - closeOnUnfocus: 'stay', +export default () => Box({ + vertical: true, - child: Box({ - vertical: true, - - connections: [ - [Notifications, (s, id) => addPopup(s, id), 'notified'], - [Notifications, (s, id) => handleDismiss(s, id), 'dismissed'], - [Notifications, (s, id) => handleDismiss(s, id, true), 'closed'], - ], - }), + connections: [ + [Notifications, (s, id) => addPopup(s, id), 'notified'], + [Notifications, (s, id) => handleDismiss(s, id), 'dismissed'], + [Notifications, (s, id) => handleDismiss(s, id, true), 'closed'], + ], });