better sizing, margin and padding
This commit is contained in:
@@ -243,6 +243,8 @@ end
|
|||||||
---@field textColor Color
|
---@field textColor Color
|
||||||
---@field textAlign TextAlign
|
---@field textAlign TextAlign
|
||||||
---@field gap number
|
---@field gap number
|
||||||
|
---@field px number
|
||||||
|
---@field py number
|
||||||
---@field positioning Positioning -- default: ABSOLUTE
|
---@field positioning Positioning -- default: ABSOLUTE
|
||||||
---@field flexDirection FlexDirection -- default: horizontal
|
---@field flexDirection FlexDirection -- default: horizontal
|
||||||
---@field justifyContent JustifyContent -- default: start
|
---@field justifyContent JustifyContent -- default: start
|
||||||
@@ -263,6 +265,8 @@ Window.__index = Window
|
|||||||
---@field borderColor Color? -- default: black? -- default: none
|
---@field borderColor Color? -- default: black? -- default: none
|
||||||
---@field background Color? --default: transparent
|
---@field background Color? --default: transparent
|
||||||
---@field gap number? -- default: 10
|
---@field gap number? -- default: 10
|
||||||
|
---@field px number? -- default: 0
|
||||||
|
---@field py number? -- default: 0
|
||||||
---@field text string? -- default: nil
|
---@field text string? -- default: nil
|
||||||
---@field titleColor Color? -- default: black
|
---@field titleColor Color? -- default: black
|
||||||
---@field textAlign TextAlign?
|
---@field textAlign TextAlign?
|
||||||
@@ -314,6 +318,8 @@ function Window.new(props)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.gap = props.gap or 10
|
self.gap = props.gap or 10
|
||||||
|
self.px = props.px or 0
|
||||||
|
self.py = props.py or 0
|
||||||
self.text = props.text
|
self.text = props.text
|
||||||
|
|
||||||
self.textColor = props.textColor
|
self.textColor = props.textColor
|
||||||
@@ -371,11 +377,8 @@ function Window:layoutChildren()
|
|||||||
if self.positioning == Positioning.ABSOLUTE then
|
if self.positioning == Positioning.ABSOLUTE then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
Logger:debug("width before: " .. self.width)
|
|
||||||
self:calculateAutoWidth()
|
self:calculateAutoWidth()
|
||||||
Logger:debug("width after: " .. self.width)
|
|
||||||
|
|
||||||
-- Calculate total size of children
|
|
||||||
local totalSize = 0
|
local totalSize = 0
|
||||||
local childCount = #self.children
|
local childCount = #self.children
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user