diff --git a/ButtonBar.lua b/ButtonBar.lua index 92c71dc..4a4a4a0 100644 --- a/ButtonBar.lua +++ b/ButtonBar.lua @@ -139,6 +139,8 @@ end local math_floor = math.floor -- align the buttons and correct the size of the bar overlay frame +ButtonBar.button_width = 36 +ButtonBar.button_height = 36 function ButtonBar:UpdateButtonLayout() local buttons = self.buttons local numbuttons = #buttons @@ -148,10 +150,10 @@ function ButtonBar:UpdateButtonLayout() local ButtonPerRow = math_floor(numbuttons / Rows + 0.5) -- just a precaution Rows = math_floor(numbuttons / ButtonPerRow + 0.5) - self:SetSize((36 + pad) * ButtonPerRow - pad + 8, (36 + pad) * Rows - pad + 8) + self:SetSize((self.button_width + pad) * ButtonPerRow - pad + 8, (self.button_height + pad) * Rows - pad + 8) -- anchor button 1 to the topleft corner of the bar - buttons[1]:ClearSetPoint("TOPLEFT", self, "TOPLEFT", 6, -3) + buttons[1]:ClearSetPoint("TOPLEFT", self, "TOPLEFT", 5, -3) -- and anchor all other buttons relative to our button 1 for i = 2, numbuttons do -- jump into a new row diff --git a/StanceBar.lua b/StanceBar.lua index cddfa90..cef4b62 100644 --- a/StanceBar.lua +++ b/StanceBar.lua @@ -107,6 +107,8 @@ function StanceBar:ApplyConfig(config) self:ForAll("ApplyStyle", self.config.style) end +StanceBar.button_width = 30 +StanceBar.button_height = 30 function StanceBar:UpdateStanceButtons() local buttons = self.buttons or {}