Fixed Show Grid option

This commit is contained in:
Hendrik Leppkes
2008-11-09 16:06:49 +01:00
parent ff11807e39
commit 2f5605a396
+29
View File
@@ -119,9 +119,14 @@ function Bartender4.Button:Create(id, parent)
group:AddButton(button)
end
if button.parent.config.showgrid then
button:ShowGrid()
end
--self:UpdateAction(true)
button:UpdateHotkeys()
button:UpdateUsable()
button:UpdateGrid()
button:ToggleButtonElements()
return button
@@ -417,6 +422,30 @@ function Button:SetTooltip()
end
end
function Button:UpdateGrid()
if self:GetAttribute("showgrid") > 0 then
ActionButton_ShowGrid(self)
else
ActionButton_HideGrid(self)
end
end
function Button:ShowGrid()
if not self.gridShown then
self.gridShown = true
self:SetAttribute("showgrid", self:GetAttribute("showgrid") + 1)
self:UpdateGrid()
end
end
function Button:HideGrid()
if self.gridShown then
self.gridShown = nil
self:SetAttribute("showgrid", max(0, self:GetAttribute("showgrid") - 1))
self:UpdateGrid()
end
end
function Button:ClearSetPoint(...)
self:ClearAllPoints()
self:SetPoint(...)