remove useless param

This commit is contained in:
casglistro
2024-04-18 03:07:20 +08:00
parent 291d3c026d
commit 6fd605a6cd
+5 -6
View File
@@ -117,15 +117,14 @@ const AppButton = ({ icon, ...rest }) => Widget.Revealer({
}) })
}); });
const Taskbar = (monitor) => Widget.Box({ const Taskbar = () => Widget.Box({
className: 'dock-apps', className: 'dock-apps',
attribute: { attribute: {
monitor: monitor,
'map': new Map(), 'map': new Map(),
'clientSortFunc': (a, b) => { 'clientSortFunc': (a, b) => {
return a.attribute.workspace > b.attribute.workspace; return a.attribute.workspace > b.attribute.workspace;
}, },
'update': (box, monitor) => { 'update': (box) => {
for (let i = 0; i < Hyprland.clients.length; i++) { for (let i = 0; i < Hyprland.clients.length; i++) {
const client = Hyprland.clients[i]; const client = Hyprland.clients[i];
if (client["pid"] == -1) return; if (client["pid"] == -1) return;
@@ -152,7 +151,7 @@ const Taskbar = (monitor) => Widget.Box({
} }
box.children = Array.from(box.attribute.map.values()); box.children = Array.from(box.attribute.map.values());
}, },
'add': (box, address, monitor) => { 'add': (box, address) => {
if (!address) { // First active emit is undefined if (!address) { // First active emit is undefined
box.attribute.update(box); box.attribute.update(box);
return; return;
@@ -194,7 +193,7 @@ const Taskbar = (monitor) => Widget.Box({
}, },
}, },
setup: (self) => { setup: (self) => {
self.hook(Hyprland, (box, address) => box.attribute.add(box, address, self.monitor), 'client-added') self.hook(Hyprland, (box, address) => box.attribute.add(box, address), 'client-added')
.hook(Hyprland, (box, address) => box.attribute.remove(box, address, self.monitor), 'client-removed') .hook(Hyprland, (box, address) => box.attribute.remove(box, address, self.monitor), 'client-removed')
Utils.timeout(100, () => self.attribute.update(self)); Utils.timeout(100, () => self.attribute.update(self));
}, },
@@ -243,7 +242,7 @@ export default (monitor = 0) => {
children: [ children: [
PinnedApps(), PinnedApps(),
DockSeparator(), DockSeparator(),
Taskbar(monitor), Taskbar(),
PinButton(), PinButton(),
] ]
}) })