Fixed Show Grid option
This commit is contained in:
@@ -119,9 +119,14 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
group:AddButton(button)
|
group:AddButton(button)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if button.parent.config.showgrid then
|
||||||
|
button:ShowGrid()
|
||||||
|
end
|
||||||
|
|
||||||
--self:UpdateAction(true)
|
--self:UpdateAction(true)
|
||||||
button:UpdateHotkeys()
|
button:UpdateHotkeys()
|
||||||
button:UpdateUsable()
|
button:UpdateUsable()
|
||||||
|
button:UpdateGrid()
|
||||||
button:ToggleButtonElements()
|
button:ToggleButtonElements()
|
||||||
|
|
||||||
return button
|
return button
|
||||||
@@ -417,6 +422,30 @@ function Button:SetTooltip()
|
|||||||
end
|
end
|
||||||
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(...)
|
function Button:ClearSetPoint(...)
|
||||||
self:ClearAllPoints()
|
self:ClearAllPoints()
|
||||||
self:SetPoint(...)
|
self:SetPoint(...)
|
||||||
|
|||||||
Reference in New Issue
Block a user