bar: fix multimonitor (?)

This commit is contained in:
end-4
2024-04-03 17:09:56 +07:00
parent c415fd18ad
commit 21cdcba7c1
4 changed files with 64 additions and 62 deletions
+21 -20
View File
@@ -9,27 +9,28 @@ import Indicator from '../../../services/indicator.js';
import { StatusIcons } from '../../.commonwidgets/statusicons.js';
import { Tray } from "./tray.js";
const SeparatorDot = () => Widget.Revealer({
transition: 'slide_left',
revealChild: false,
attribute: {
'count': SystemTray.items.length,
'update': (self, diff) => {
self.attribute.count += diff;
self.revealChild = (self.attribute.count > 0);
}
},
child: Widget.Box({
vpack: 'center',
className: 'separator-circle',
}),
setup: (self) => self
.hook(SystemTray, (self) => self.attribute.update(self, 1), 'added')
.hook(SystemTray, (self) => self.attribute.update(self, -1), 'removed')
,
});
export default () => {
const barTray = Tray();
const separatorDot = Widget.Revealer({
transition: 'slide_left',
revealChild: false,
attribute: {
'count': SystemTray.items.length,
'update': (self, diff) => {
self.attribute.count += diff;
self.revealChild = (self.attribute.count > 0);
}
},
child: Widget.Box({
vpack: 'center',
className: 'separator-circle',
}),
setup: (self) => self
.hook(SystemTray, (self) => self.attribute.update(self, 1), 'added')
.hook(SystemTray, (self) => self.attribute.update(self, -1), 'removed')
,
});
const barStatusIcons = StatusIcons({
className: 'bar-statusicons',
setup: (self) => self.hook(App, (self, currentName, visible) => {
@@ -53,7 +54,7 @@ export default () => {
const emptyArea = SpaceRightDefaultClicks(Widget.Box({ hexpand: true, }));
const indicatorArea = SpaceRightDefaultClicks(Widget.Box({
children: [
separatorDot,
SeparatorDot(),
barStatusIcons
],
}));