From 0def6d7e9fd8b66220171ee228f0e845ed6edb57 Mon Sep 17 00:00:00 2001 From: Aylur Date: Wed, 9 Oct 2024 21:02:24 +0200 Subject: core(gjs, lua): widget constructor set props before children --- core/lua/astal/widget.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/lua/astal/widget.lua') diff --git a/core/lua/astal/widget.lua b/core/lua/astal/widget.lua index 8f49409..73fe3b6 100644 --- a/core/lua/astal/widget.lua +++ b/core/lua/astal/widget.lua @@ -206,6 +206,10 @@ local function astalify(ctor) -- construct, attach bindings, add children local widget = ctor() + for prop, value in pairs(props) do + widget[prop] = value + end + if getmetatable(children) == Binding then set_children(widget, children:get()) widget.on_destroy = children:subscribe(function(v) @@ -223,10 +227,6 @@ local function astalify(ctor) end) end - for prop, value in pairs(props) do - widget[prop] = value - end - if type(setup) == "function" then setup(widget) end -- cgit v1.2.3