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

27 lines
683 B
TypeScript
Raw Permalink Normal View History

2025-01-01 13:38:44 -05:00
import { register } from 'astal';
import { Gtk } from 'astal/gtk4';
2025-01-01 13:38:44 -05:00
import astalify, { type AstalifyProps, type ConstructProps } from '../astalify';
2025-01-01 13:38:44 -05:00
type EntrySignals = Record<`on${string}`, unknown[]> & {
onActivate: []
onNotifyText: []
};
export type EntryProps = ConstructProps<
2025-01-13 10:51:02 -05:00
EntryClass,
Gtk.Entry.ConstructorProps & AstalifyProps,
2025-01-01 13:38:44 -05:00
EntrySignals
>;
@register({ GTypeName: 'Entry' })
2025-01-13 10:51:02 -05:00
export class EntryClass extends astalify(Gtk.Entry) {
constructor({ cssName = 'entry', ...props }: EntryProps = {}) {
super({ cssName, ...props });
2025-01-13 10:51:02 -05:00
}
2025-01-01 13:38:44 -05:00
getChildren() { return []; }
}
2025-01-13 10:51:02 -05:00
export const Entry = (props?: EntryProps) => new EntryClass(props);