Added options to adjust the vertical and horizontal growth direction

This commit is contained in:
Hendrik Leppkes
2009-02-21 14:58:17 +01:00
parent 4529c41327
commit a1189dbad8
3 changed files with 48 additions and 3 deletions
+7 -3
View File
@@ -147,9 +147,7 @@ function Bartender4.Bar:Create(id, config, name)
overlay:SetScript("OnClick", barOnClick)
overlay:SetFrameLevel(bar:GetFrameLevel() + 10)
overlay:ClearAllPoints()
local anchor = bar:GetAnchor()
overlay:SetPoint(anchor, bar, anchor)
bar:AnchorOverlay()
overlay:Hide()
bar.elapsed = 0
@@ -200,6 +198,12 @@ function Bar:GetAnchor()
return ((self.config.position.growVertical == "DOWN") and "TOP" or "BOTTOM") .. ((self.config.position.growHorizontal == "RIGHT") and "LEFT" or "RIGHT")
end
function Bar:AnchorOverlay()
self.overlay:ClearAllPoints()
local anchor = self:GetAnchor()
self.overlay:SetPoint(anchor, self, anchor)
end
function Bar:UpgradeConfig()
local version = self.config.version or 1
if version < 2 then
+21
View File
@@ -119,6 +119,27 @@ function ButtonBar:GetHideHotkey()
return self.config.hidehotkey
end
function ButtonBar:SetHGrowth(value)
self.config.position.growHorizontal = value
self:AnchorOverlay()
self:UpdateButtonLayout()
end
function ButtonBar:GetHGrowth()
return self.config.position.growHorizontal
end
function ButtonBar:SetVGrowth(value)
self.config.position.growVertical = value
self:AnchorOverlay()
self:UpdateButtonLayout()
end
function ButtonBar:GetVGrowth()
return self.config.position.growVertical
end
ButtonBar.ClickThroughSupport = true
function ButtonBar:SetClickThrough(click)
if click ~= nil then
+20
View File
@@ -19,6 +19,8 @@ do
zoom = "Zoom",
macrotext = "HideMacroText",
hotkey = "HideHotkey",
vgrowth = "VGrowth",
hgrowth = "HGrowth",
}
-- retrieves a valid bar object from the barregistry table
@@ -80,6 +82,24 @@ function ButtonBar:GetOptionObject()
set = optSetter,
get = optGetter,
},
vgrowth = {
order = 75,
name = L["Vertical Growth"],
desc = L["Vertical growth direction for this bar."],
type = "select",
values = {UP = L["Up"], DOWN = L["Down"]},
set = optSetter,
get = optGetter,
},
hgrowth = {
order = 76,
name = L["Horizontal Growth"],
desc = L["Horizontal growth direction for this bar."],
type = "select",
values = {LEFT = L["Left"], RIGHT = L["Right"]},
set = optSetter,
get = optGetter,
},
hidedesc = {
order = 80,
name = L["Button Look"],