make indicators (more likely to work with) multimonitor

This commit is contained in:
end-4 2024-01-24 22:57:31 +07:00
parent 5f7aaff125
commit 1cb1b94ad2
3 changed files with 5 additions and 37 deletions

View file

@ -16,7 +16,7 @@ const ColorBox = ({
]
})
const colorschemeContent = Box({
const ColorschemeContent = () => Box({
className: 'osd-colorscheme spacing-v-5',
vertical: true,
hpack: 'center',
@ -44,7 +44,7 @@ const colorschemeContent = Box({
export default () => Widget.Revealer({
transition: 'slide_down',
transitionDuration: 200,
child: colorschemeContent,
child: ColorschemeContent(),
setup: (self) => self.hook(showColorScheme, (revealer) => {
revealer.revealChild = showColorScheme.value;
}),

View file

@ -1,7 +1,7 @@
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import Indicator from '../../services/indicator.js';
import IndicatorValues from './indicatorvalues.js';
// import MusicControls from './musiccontrols.js';
import MusicControls from './musiccontrols.js';
import ColorScheme from './colorscheme.js';
import NotificationPopups from './notificationpopups.js';
@ -23,7 +23,7 @@ export default (monitor = 0) => Widget.Window({
css: 'min-height: 2px;',
children: [
IndicatorValues(),
// MusicControls(),
MusicControls(),
NotificationPopups(),
ColorScheme(),
]

View file

@ -4,37 +4,7 @@ import Notifications from 'resource:///com/github/Aylur/ags/service/notification
const { Box } = Widget;
import Notification from '../../lib/notification.js';
const PopupNotification = (notifObject) => Widget.Box({
homogeneous: true,
children: [
Widget.EventBox({
onHoverLost: () => {
notifObject.dismiss();
},
child: Widget.Revealer({
revealChild: true,
child: Widget.Box({
children: [Notification({
notifObject: notifObject,
isPopup: true,
props: { hpack: 'fill' },
})],
}),
})
})
]
})
const naiveNotifPopupList = Widget.Box({
vertical: true,
className: 'spacing-v-5',
setup: (self) => self.hook(Notifications, (box) => {
box.children = Notifications.popups.reverse()
.map(notifItem => PopupNotification(notifItem));
}),
})
const notifPopupList = Box({
export default () => Box({
vertical: true,
className: 'osd-notifs spacing-v-5-revealer',
attribute: {
@ -72,5 +42,3 @@ const notifPopupList = Box({
.hook(Notifications, (box, id) => box.attribute.dismiss(box, id, true), 'closed')
,
});
export default () => notifPopupList;