From 075c7e34aa0fbdc07c86965ab5a2ae79b92d3fd3 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 10 Oct 2024 00:13:37 +0000 Subject: core: reverse constructor props order to make stack shown property behave as expected --- 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 73fe3b6..8f49409 100644 --- a/core/lua/astal/widget.lua +++ b/core/lua/astal/widget.lua @@ -206,10 +206,6 @@ 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) @@ -227,6 +223,10 @@ 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