Added small popup in unlock mode that allows you to disable snapping and lock the bars again without opening the config

This commit is contained in:
Hendrik Leppkes
2008-10-15 14:37:01 +02:00
parent 5b9d669956
commit bbdf0b06f8
2 changed files with 110 additions and 5 deletions
+17 -5
View File
@@ -37,8 +37,12 @@ do
function barOnDragStart(self)
local parent = self:GetParent()
local offset = 8 - (parent.config.padding or 0)
Sticky:StartMoving(parent, snapBars, offset, offset, offset, offset)
if Bartender4.db.profile.snapping then
local offset = 8 - (parent.config.padding or 0)
Sticky:StartMoving(parent, snapBars, offset, offset, offset, offset)
else
parent:StartMoving()
end
self:SetBackdropBorderColor(0, 0, 0, 0)
parent.isMoving = true
end
@@ -46,8 +50,12 @@ do
function barOnDragStop(self)
local parent = self:GetParent()
if parent.isMoving then
local sticky, stickTo = Sticky:StopMoving(parent)
--Bartender4:Print(sticky, stickTo and stickTo:GetName() or nil)
if Bartender4.db.profile.snapping then
local sticky, stickTo = Sticky:StopMoving(parent)
--Bartender4:Print(sticky, stickTo and stickTo:GetName() or nil)
else
parent:StopMovingOrSizing()
end
parent:SavePosition()
end
end
@@ -182,13 +190,17 @@ end
function Bar:Lock()
if self.disabled or not self.unlocked then return end
self.unlocked = nil
barOnDragStop(self.overlay)
self:StopDragging()
self:ApplyVisibilityDriver()
self.overlay:Hide()
end
function Bar:StopDragging()
barOnDragStop(self.overlay)
end
function Bar:LoadPosition()
if not self.config.position then return end
local pos = self.config.position