summaryrefslogtreecommitdiff
path: root/core/lua
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-10-09 21:02:24 +0200
committerAylur <[email protected]>2024-10-09 21:02:24 +0200
commit0def6d7e9fd8b66220171ee228f0e845ed6edb57 (patch)
tree0a57f651c45ef0a6d407b2815806ba413c448b01 /core/lua
parenteb41193d47d2c54168f6e0a7732a6307e7486338 (diff)
core(gjs, lua): widget constructor set props before children
Diffstat (limited to 'core/lua')
-rw-r--r--core/lua/astal/widget.lua8
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