Merge pull request #14 from Idriss975/main

Add undropSymbol property + implement both self.dropSymbol & self.undropSymbol
This commit is contained in:
Robert Jelic
2025-11-05 02:03:31 +01:00
committed by GitHub

View File

@@ -63,6 +63,8 @@ DropDown.defineProperty(DropDown, "dropdownHeight", {default = 5, type = "number
DropDown.defineProperty(DropDown, "selectedText", {default = "", type = "string"})
---@property dropSymbol string "\31" Indicator for dropdown state
DropDown.defineProperty(DropDown, "dropSymbol", {default = "\31", type = "string"})
---@property undropSymbol string "\31" Indicator for dropdown state
DropDown.defineProperty(DropDown, "undropSymbol", {default = "\17", type = "string"})
--- Creates a new DropDown instance
--- @shortDescription Creates a new DropDown instance
@@ -204,7 +206,7 @@ function DropDown:render()
self.set("height", actualHeight)
end
self:blit(1, 1, text .. string.rep(" ", width - #text - 1) .. (isOpen and "\31" or "\17"),
self:blit(1, 1, text .. string.rep(" ", width - #text - 1) .. (isOpen and self.getResolved("dropSymbol") or self.getResolved("undropSymbol")),
string.rep(tHex[self.getResolved("foreground")], width),
string.rep(tHex[self.getResolved("background")], width))
end