Try to preserve the old position properly during the migration to the new system.

This commit is contained in:
Hendrik Leppkes
2009-02-21 14:14:53 +01:00
parent 6f5086adc8
commit e9071dc3d0
3 changed files with 16 additions and 2 deletions
+14
View File
@@ -220,6 +220,10 @@ function Bar:UpgradeConfig()
pos.relPoint = nil
end
end
if version < 3 then
-- Size adjustment is done in first SetSize
self.needSizeFix = true
end
self.config.version = Bartender4.CONFIG_VERSION
end
@@ -256,6 +260,16 @@ end
function Bar:SetSize(width, height)
self.overlay:SetWidth(width)
self.overlay:SetHeight(height or width)
if self.needSizeFix then
self:SetWidth(width)
self:SetHeight(height or width)
local x, y = self:GetLeft(), self:GetTop()
self:ClearSetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", x, y)
self:SetWidth(1)
self:SetHeight(1)
self:SavePosition()
self.needSizeFix = nil
end
end
function Bar:GetConfigAlpha()
+1 -1
View File
@@ -20,7 +20,7 @@ local defaults = {
}
}
Bartender4.CONFIG_VERSION = 2
Bartender4.CONFIG_VERSION = 3
function Bartender4:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("Bartender4DB", defaults)
+1 -1
View File
@@ -155,8 +155,8 @@ function ButtonBar:UpdateButtonLayout()
self:SetSize((self.button_width + hpad) * ButtonPerRow - pad + 8, (self.button_height + vpad) * Rows - pad + 8)
local anchor = self:GetAnchor()
-- anchor button 1
local anchor = self:GetAnchor()
buttons[1]:ClearSetPoint(anchor, self, anchor, 5 - (self.hpad_offset or 0), -3 - (self.vpad_offset or 0))
local h1 = (self.config.position.growHorizontal == "RIGHT") and "LEFT" or "RIGHT"