diff options
author | Aylur <[email protected]> | 2024-10-09 21:02:24 +0200 |
---|---|---|
committer | Aylur <[email protected]> | 2024-10-09 21:02:24 +0200 |
commit | 0def6d7e9fd8b66220171ee228f0e845ed6edb57 (patch) | |
tree | 0a57f651c45ef0a6d407b2815806ba413c448b01 /core/lua | |
parent | eb41193d47d2c54168f6e0a7732a6307e7486338 (diff) |
core(gjs, lua): widget constructor set props before children
Diffstat (limited to 'core/lua')
-rw-r--r-- | core/lua/astal/widget.lua | 8 |
1 files changed, 4 insertions, 4 deletions
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 |