From 54259716c4290cbf15de8e343ea9e568a7e0b154 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 20 Feb 2024 05:37:36 -0600 Subject: [PATCH] Fixes to indent in menus --- DiesalLibs/DiesalGUI-2.0/Objects/DropDown.lua | 4 ++-- DiesalLibs/DiesalGUI-2.0/Objects/DropDownItem.lua | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/DiesalLibs/DiesalGUI-2.0/Objects/DropDown.lua b/DiesalLibs/DiesalGUI-2.0/Objects/DropDown.lua index b9a14f1..e20867d 100644 --- a/DiesalLibs/DiesalGUI-2.0/Objects/DropDown.lua +++ b/DiesalLibs/DiesalGUI-2.0/Objects/DropDown.lua @@ -146,6 +146,7 @@ local methods = { clickable = item.clickable, indent = item.indent or 0, }, true) + dropdownItem.text:SetPoint("TOPLEFT", 12 + (item.indent * 6), -2) if item.indent and item.indent > 0 then local leftOffset = -6 + (-6 * item.indent) dropdownItem:UpdateStyle("frame-lineV", { @@ -257,8 +258,7 @@ local methods = { for _, key in ipairs(keyTable) do if dropdownItem.settings.key == key then dropdownItem:SetSelected(true) - dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItem.settings.value) or - dropdownItem.settings.value + dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItem.settings.value) or dropdownItem.settings.value selectionTable[#selectionTable + 1] = dropdownItem.settings.key end end diff --git a/DiesalLibs/DiesalGUI-2.0/Objects/DropDownItem.lua b/DiesalLibs/DiesalGUI-2.0/Objects/DropDownItem.lua index 4fb196e..0ce8cdb 100644 --- a/DiesalLibs/DiesalGUI-2.0/Objects/DropDownItem.lua +++ b/DiesalLibs/DiesalGUI-2.0/Objects/DropDownItem.lua @@ -65,8 +65,8 @@ local methods = { end, ---@param self Diesal.GUI.Object.DropDown.Item ["SetText"] = function(self, text) - local indentText = self.settings.indent == 0 and "" or (" " .. (" "):rep(self.settings.indent) .. " ") - self.text:SetText(indentText .. text) + local indentText = (self.settings.indent == 0 and "" or ((" "):rep(self.settings.indent + 3))) .. text + self.text:SetText(text) end, ---@param self Diesal.GUI.Object.DropDown.Item ["OnClick"] = function(self) @@ -85,8 +85,7 @@ local methods = { self:SetSelected(not settings.selected) for i = 1, #dropdownItems do if dropdownItems[i].settings.selected then - dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItems[i].settings.value) or - dropdownItems[i].settings.value + dropdownText = dropdownText and format("%s, %s", dropdownText, dropdownItems[i].settings.value) or dropdownItems[i].settings.value selectionTable[#selectionTable + 1] = dropdownItems[i].settings.key end end