feat(wim ags overview): force consistent open anim

This commit is contained in:
matt1432 2023-11-28 00:51:28 -05:00
parent 17e96320fc
commit b7724c46d2
2 changed files with 44 additions and 34 deletions

View file

@ -94,7 +94,7 @@ const Client = (client, active, clients, box) => {
child: Icon({ child: Icon({
className: `window ${active}`, className: `window ${active}`,
css: `${IconStyle(client) }font-size: 10px;`, css: `${IconStyle(client)} font-size: 10px;`,
icon: client.class, icon: client.class,
}), }),
}), }),

View file

@ -9,15 +9,10 @@ import { Highlighter, updateCurrentWorkspace } from './current-workspace.js';
import { updateClients } from './clients.js'; import { updateClients } from './clients.js';
const update = (box, highlight) => {
getWorkspaces(box);
updateWorkspaces(box);
updateClients(box);
updateCurrentWorkspace(box, highlight);
};
// TODO: have a 'page' for each monitor, arrows on both sides to loop through // TODO: have a 'page' for each monitor, arrows on both sides to loop through
export default () => { export const Overview = () => {
const highlighter = Highlighter(); const highlighter = Highlighter();
const mainBox = Box({ const mainBox = Box({
@ -50,7 +45,7 @@ export default () => {
return; return;
} }
update(self, highlighter); self.update();
}]], }]],
properties: [ properties: [
@ -58,12 +53,14 @@ export default () => {
], ],
}); });
const window = PopupWindow({ mainBox.update = () => {
name: 'overview', getWorkspaces(mainBox);
closeOnUnfocus: 'none', updateWorkspaces(mainBox);
onOpen: () => update(mainBox, highlighter), updateClients(mainBox);
updateCurrentWorkspace(mainBox, highlighter);
};
child: Overlay({ const widget = Overlay({
overlays: [highlighter, mainBox], overlays: [highlighter, mainBox],
child: Box({ child: Box({
@ -84,8 +81,21 @@ export default () => {
`); `);
} }
}]], }]],
}), });
widget.getChild = () => mainBox;
return widget;
};
export default () => {
const window = PopupWindow({
name: 'overview',
closeOnUnfocus: 'none',
onOpen: () => {
window.setChild(Overview());
window.getChild().getChild().update();
},
}); });
return window; return window;