Skip to content

Commit 084c882

Browse files
authored
Merge pull request #14 from Idriss975/main
Add undropSymbol property + implement both self.dropSymbol & self.undropSymbol
2 parents 52bef2a + 234151d commit 084c882

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/elements/DropDown.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ DropDown.defineProperty(DropDown, "dropdownHeight", {default = 5, type = "number
6363
DropDown.defineProperty(DropDown, "selectedText", {default = "", type = "string"})
6464
---@property dropSymbol string "\31" Indicator for dropdown state
6565
DropDown.defineProperty(DropDown, "dropSymbol", {default = "\31", type = "string"})
66+
---@property undropSymbol string "\31" Indicator for dropdown state
67+
DropDown.defineProperty(DropDown, "undropSymbol", {default = "\17", type = "string"})
6668

6769
--- Creates a new DropDown instance
6870
--- @shortDescription Creates a new DropDown instance
@@ -204,7 +206,7 @@ function DropDown:render()
204206
self.set("height", actualHeight)
205207
end
206208

207-
self:blit(1, 1, text .. string.rep(" ", width - #text - 1) .. (isOpen and "\31" or "\17"),
209+
self:blit(1, 1, text .. string.rep(" ", width - #text - 1) .. (isOpen and self.getResolved("dropSymbol") or self.getResolved("undropSymbol")),
208210
string.rep(tHex[self.getResolved("foreground")], width),
209211
string.rep(tHex[self.getResolved("background")], width))
210212
end

0 commit comments

Comments
 (0)