From f294fd8265873eae343d73fe4d83047387e4bf79 Mon Sep 17 00:00:00 2001 From: Aylur Date: Wed, 9 Oct 2024 00:49:15 +0000 Subject: gjs: add gobject decorators --- core/gjs/src/jsx/jsx-runtime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/gjs/src/jsx/jsx-runtime.ts') diff --git a/core/gjs/src/jsx/jsx-runtime.ts b/core/gjs/src/jsx/jsx-runtime.ts index a0aafb6..cffcb76 100644 --- a/core/gjs/src/jsx/jsx-runtime.ts +++ b/core/gjs/src/jsx/jsx-runtime.ts @@ -63,7 +63,7 @@ declare global { box: Widget.BoxProps button: Widget.ButtonProps centerbox: Widget.CenterBoxProps - circularprogress: Widget.CircularProgressProps, + circularprogress: Widget.CircularProgressProps drawingarea: Widget.DrawingAreaProps entry: Widget.EntryProps eventbox: Widget.EventBoxProps -- cgit v1.2.3 From 2fa83eb09047e603835c462ff0d8a04eba016807 Mon Sep 17 00:00:00 2001 From: Aylur Date: Wed, 9 Oct 2024 02:52:02 +0000 Subject: gjs: refactor widgets into classes --- core/gjs/src/jsx/jsx-runtime.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/gjs/src/jsx/jsx-runtime.ts') diff --git a/core/gjs/src/jsx/jsx-runtime.ts b/core/gjs/src/jsx/jsx-runtime.ts index cffcb76..f40dc05 100644 --- a/core/gjs/src/jsx/jsx-runtime.ts +++ b/core/gjs/src/jsx/jsx-runtime.ts @@ -16,14 +16,15 @@ export function jsx( children = children.filter(Boolean) - if (typeof ctor === "string") - return (ctors as any)[ctor](props, children) - if (children.length === 1) props.child = children[0] else if (children.length > 1) props.children = children + if (typeof ctor === "string") { + return new ctors[ctor](props) + } + if (isArrowFunction(ctor)) return ctor(props) -- cgit v1.2.3