more ButtonFacade integration
This commit is contained in:
@@ -171,6 +171,11 @@ function ActionBar:UpdateButtons(numbuttons)
|
||||
end
|
||||
end
|
||||
|
||||
function ActionBar:SkinChanged(...)
|
||||
ButtonBar.SkinChanged(self, ...)
|
||||
self:ForAll("Update")
|
||||
end
|
||||
|
||||
|
||||
--[[===================================================================================
|
||||
ActionBar Config Interface
|
||||
|
||||
@@ -80,10 +80,6 @@ function BT4ActionBars:OnEnable()
|
||||
end
|
||||
end
|
||||
|
||||
if LBF then
|
||||
LBF:RegisterSkinCallback("Bartender4", self.UpdateSkin, self)
|
||||
end
|
||||
|
||||
first = nil
|
||||
end
|
||||
|
||||
@@ -139,13 +135,6 @@ function BT4ActionBars:ApplyConfig()
|
||||
end
|
||||
end
|
||||
|
||||
function BT4ActionBars:UpdateSkin(SkinID, Gloss, Backdrop, Group, Button)
|
||||
local id = tonumber(Group)
|
||||
if id and self.actionbars[id] then
|
||||
self.actionbars[id]:ForAll("Update")
|
||||
end
|
||||
end
|
||||
|
||||
-- we do not allow to disable the actionbars module
|
||||
function BT4ActionBars:ToggleModule()
|
||||
return
|
||||
|
||||
@@ -46,6 +46,7 @@ function Bartender4.Button:Create(id, parent)
|
||||
button.Proxy:SetPushedTexture("")
|
||||
button.Proxy:SetHighlightTexture("")
|
||||
button.Proxy:SetCheckedTexture("")
|
||||
button.Proxy:Show()
|
||||
|
||||
local NormalTexture = button.Proxy:GetNormalTexture()
|
||||
NormalTexture:SetWidth(66)
|
||||
@@ -411,6 +412,7 @@ function Button:SetTooltip()
|
||||
end
|
||||
|
||||
function Button:ShowButton()
|
||||
if self.Proxy:IsShown() then return end
|
||||
self.pushedTexture:SetTexture(self.textureCache.pushed)
|
||||
self.highlightTexture:SetTexture(self.textureCache.highlight)
|
||||
|
||||
|
||||
@@ -9,6 +9,11 @@ local ButtonBar_MT = {__index = ButtonBar}
|
||||
local defaults = Bartender4:Merge({
|
||||
padding = 2,
|
||||
rows = 1,
|
||||
skin = {
|
||||
ID = "DreamLayout",
|
||||
Backdrop = true,
|
||||
Gloss = false,
|
||||
},
|
||||
}, Bartender4.Bar.defaults)
|
||||
|
||||
Bartender4.ButtonBar = {}
|
||||
@@ -22,11 +27,24 @@ function Bartender4.ButtonBar:Create(id, template, config)
|
||||
|
||||
if LBF then
|
||||
bar.LBFGroup = LBF:Group("Bartender4", tostring(id))
|
||||
bar.LBFGroup.SkinID = config.skin.ID or "Blizzard"
|
||||
bar.LBFGroup.Backdrop = config.skin.Backdrop
|
||||
bar.LBFGroup.Gloss = config.skin.Gloss
|
||||
|
||||
LBF:RegisterSkinCallback("Bartender4", self.SkinChanged, self)
|
||||
end
|
||||
|
||||
return bar
|
||||
end
|
||||
|
||||
local barregistry = Bartender4.Bar.barregistry
|
||||
function Bartender4.ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Group, Button)
|
||||
local bar = barregistry[tostring(Group)]
|
||||
if not bar then return end
|
||||
|
||||
bar:SkinChanged(SkinID, Gloss, Backdrop, Button)
|
||||
end
|
||||
|
||||
--[[===================================================================================
|
||||
Bar Options
|
||||
===================================================================================]]--
|
||||
@@ -166,6 +184,12 @@ function ButtonBar:UpdateButtonLayout()
|
||||
end
|
||||
end
|
||||
|
||||
function ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Button)
|
||||
self.config.skin.ID = SkinID
|
||||
self.config.skin.Gloss = Gloss
|
||||
self.config.skin.Backdrop = Backdrop
|
||||
end
|
||||
|
||||
--[[===================================================================================
|
||||
Utility function
|
||||
===================================================================================]]--
|
||||
|
||||
Reference in New Issue
Block a user