more ButtonFacade integration

This commit is contained in:
Hendrik Leppkes
2008-04-12 11:07:42 +00:00
parent 9de4526d6c
commit a889dd57c1
4 changed files with 31 additions and 11 deletions
+5
View File
@@ -171,6 +171,11 @@ function ActionBar:UpdateButtons(numbuttons)
end
end
function ActionBar:SkinChanged(...)
ButtonBar.SkinChanged(self, ...)
self:ForAll("Update")
end
--[[===================================================================================
ActionBar Config Interface
-11
View File
@@ -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
+2
View File
@@ -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)
+24
View File
@@ -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
===================================================================================]]--