495 current 2024-04-28 20:50:10 24.05.20240428.30ddacc 6.8.6-zen1 *

This commit is contained in:
zackartz 2024-04-28 20:50:20 -04:00
parent 5549a17e4c
commit d6c181bc5b
No known key found for this signature in database
GPG key ID: 5B53E53A9A514DBA
46 changed files with 1685 additions and 10 deletions

View file

@ -0,0 +1,52 @@
import { App, Widget, Utils } from "../imports.js";
const { Box, Revealer, Window } = Widget;
export default ({
onOpen = () => {},
onClose = () => {},
name,
child,
transition = "slide_up",
transitionDuration = 250,
...props
}) => {
const window = Window({
name,
visible: false,
...props,
child: Box({
css: `min-height: 2px;
min-width: 2px;`,
child: Revealer({
transition,
transitionDuration,
hexpand: true,
vexpand: true,
child: child || Box(),
setup: (self) => {
self.hook(App, (rev, currentName, isOpen) => {
if (currentName === name) {
rev.revealChild = isOpen;
if (isOpen) {
onOpen(window);
} else {
Utils.timeout(transitionDuration, () => {
onClose(window);
});
}
}
});
},
}),
}),
});
window.getChild = () => window.child.children[0].child;
window.setChild = (newChild) => {
window.child.children[0].child = newChild;
window.child.children[0].show_all(); };
return window;
};