ck 11 months ago
commit c3f1938ce0
  1. 4
      DiesalGUI-2.0/Objects/DropDown.lua
  2. 7
      DiesalGUI-2.0/Objects/DropDownItem.lua
  3. BIN
      DiesalStyle-2.0/Media/Fonts/MaterialSymbolsRounded.ttf

@ -146,6 +146,7 @@ local methods = {
clickable = item.clickable, clickable = item.clickable,
indent = item.indent or 0, indent = item.indent or 0,
}, true) }, true)
dropdownItem.text:SetPoint("TOPLEFT", 12 + (item.indent * 6), -2)
if item.indent and item.indent > 0 then if item.indent and item.indent > 0 then
local leftOffset = -6 + (-6 * item.indent) local leftOffset = -6 + (-6 * item.indent)
dropdownItem:UpdateStyle("frame-lineV", { dropdownItem:UpdateStyle("frame-lineV", {
@ -257,8 +258,7 @@ local methods = {
for _, key in ipairs(keyTable) do for _, key in ipairs(keyTable) do
if dropdownItem.settings.key == key then if dropdownItem.settings.key == key then
dropdownItem:SetSelected(true) dropdownItem:SetSelected(true)
dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItem.settings.value) or dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItem.settings.value) or dropdownItem.settings.value
dropdownItem.settings.value
selectionTable[#selectionTable + 1] = dropdownItem.settings.key selectionTable[#selectionTable + 1] = dropdownItem.settings.key
end end
end end

@ -65,8 +65,8 @@ local methods = {
end, end,
---@param self Diesal.GUI.Object.DropDown.Item ---@param self Diesal.GUI.Object.DropDown.Item
["SetText"] = function(self, text) ["SetText"] = function(self, text)
local indentText = self.settings.indent == 0 and "" or (" " .. (" "):rep(self.settings.indent) .. " ") local indentText = (self.settings.indent == 0 and "" or ((" "):rep(self.settings.indent + 3))) .. text
self.text:SetText(indentText .. text) self.text:SetText(text)
end, end,
---@param self Diesal.GUI.Object.DropDown.Item ---@param self Diesal.GUI.Object.DropDown.Item
["OnClick"] = function(self) ["OnClick"] = function(self)
@ -85,8 +85,7 @@ local methods = {
self:SetSelected(not settings.selected) self:SetSelected(not settings.selected)
for i = 1, #dropdownItems do for i = 1, #dropdownItems do
if dropdownItems[i].settings.selected then if dropdownItems[i].settings.selected then
dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItems[i].settings.value) or dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItems[i].settings.value) or dropdownItems[i].settings.value
dropdownItems[i].settings.value
selectionTable[#selectionTable + 1] = dropdownItems[i].settings.key selectionTable[#selectionTable + 1] = dropdownItems[i].settings.key
end end
end end

Loading…
Cancel
Save