nixos-configs/modules/ags/gtk4/widget/subclasses/box.ts

26 lines
616 B
TypeScript
Raw Normal View History

2025-01-01 02:55:15 -05:00
/* eslint-disable @typescript-eslint/no-explicit-any */
import { register } from 'astal';
import { Astal, type ConstructProps } from 'astal/gtk4';
import astalify, { filter } from './astalify';
export type BoxProps = ConstructProps<
Box,
Astal.Box.ConstructorProps & { css: string }
>;
@register({ GTypeName: 'Box' })
export class Box extends astalify(Astal.Box) {
constructor(props?: BoxProps) { super(props as any); }
getChildren(self: Box) {
return self.get_children();
}
setChildren(self: Box, children: any[]) {
return self.set_children(filter(children));
}
}