From c9e93e82194a405ebc13f41a95fc878054b312da Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 6 Jun 2018 20:20:08 -0500 Subject: [PATCH] Added Gap setting between upper and lower text Partial merge of pull request #1 from lrds (https://github.com/parnic/ice-hud/pull/1). Removed the localization change because loc is managed on the wowace side. --- IceBarElement.lua | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/IceBarElement.lua b/IceBarElement.lua index db6ef86..8babf5b 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -171,6 +171,7 @@ function IceBarElement.prototype:GetDefaultSettings() settings["rotateBar"] = false settings["markers"] = {} settings["bAllowExpand"] = true + settings["textVerticalGap"] = 0 return settings end @@ -724,6 +725,26 @@ do order = 11.3, }, + textVerticalGap = { + type = 'range', + name = L["Text Vertical Gap"], + desc = L["Gap between Upper and Lower text vertically"], + min = 0, + max = 10, + step = 1, + get = function() + return self.moduleSettings.textVerticalGap + end, + set = function(info, v) + self.moduleSettings.textVerticalGap = v + self:Redraw() + end, + disabled = function() + return not self.moduleSettings.enabled + end, + order = 11.4, + }, + textHeader = { type = 'header', name = L["Upper Text"], @@ -1116,8 +1137,13 @@ function IceBarElement.prototype:CreateTexts() offy = self.moduleSettings.textVerticalOffset end + local offgap = 0 + if self.moduleSettings.textVerticalGap ~= nil then + offgap = self.moduleSettings.textVerticalGap + end + self.frame.bottomUpperText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, offy) - self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, offy - 14) + self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, offy - (14 + offgap)) if (self.moduleSettings.textVisible["upper"]) then self.frame.bottomUpperText:Show()