- Added comprehensive state management with conditional states, priority-based resolution, and property overrides

- Added responsive.lua with fluent builder API (:when()/:apply()/:otherwise()) for creating responsive layouts that react to parent size or custom conditions
- All elements now use getResolved() to check active states, enabling multiple responsive rules to coexist
This commit is contained in:
Robert Jelic
2025-11-04 22:40:37 +01:00
parent 083a3b0b7b
commit 2ca7ad1e4c
37 changed files with 1050 additions and 740 deletions

View File

@@ -44,10 +44,10 @@ end
--- @param y number
--- @return boolean handled
function Breadcrumb:mouse_click(button, x, y)
if not self.get("clickable") then return false end
if not self.getResolved("clickable") then return false end
if VisualElement.mouse_click(self, button, x, y) then
local path = self.get("path")
local separator = self.get("separator")
local path = self.getResolved("path")
local separator = self.getResolved("separator")
local cursorX = 1
for i, segment in ipairs(path) do
@@ -81,11 +81,11 @@ end
--- @shortDescription Renders the breadcrumb trail
--- @protected
function Breadcrumb:render()
local path = self.get("path")
local separator = self.get("separator")
local fg = self.get("foreground")
local clickable = self.get("clickable")
local width = self.get("width")
local path = self.getResolved("path")
local separator = self.getResolved("separator")
local fg = self.getResolved("foreground")
local clickable = self.getResolved("clickable")
local width = self.getResolved("width")
local fullText = ""
for i, segment in ipairs(path) do
@@ -95,8 +95,8 @@ function Breadcrumb:render()
end
end
if self.get("autoSize") then
self.set("width", #fullText)
if self.getResolved("autoSize") then
self.getResolved("width", #fullText)
else
if #fullText > width then
local ellipsis = "... > "