-- Overlay toggle + drag predicate + collapse-exclusive demo. -- Drop into an addon alongside LibEQOL; load after the library. local EditMode = LibStub("LibEQOLEditMode-1.0") local frame = CreateFrame("Frame", "LibEQOLDemoOverlayToggle", UIParent, "BackdropTemplate") frame:SetSize(180, 50) frame:SetBackdrop({ bgFile = "Interface/Buttons/WHITE8X8", edgeFile = "Interface/Buttons/WHITE8X8", edgeSize = 1 }) frame:SetBackdropColor(0, 0.4, 0.7, 0.08) frame:SetBackdropBorderColor(0, 0.4, 0.7, 0.9) frame.Text = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall") frame.Text:SetPoint("CENTER") frame.Text:SetText("Overlay Toggle Demo") local state = { point = "CENTER", x = -80, y = -80, collapseExclusive = true, dragCondition = false, } local function setPos(layout, point, x, y) state.point, state.x, state.y = point, x, y frame:ClearAllPoints() frame:SetPoint(point, UIParent, point, x, y) end EditMode:AddFrame(frame, function(_, layoutName, point, x, y) setPos(layoutName, point, x, y) end, { point = state.point, x = state.x, y = state.y, enableOverlayToggle = true, allowDrag = function() return not state.dragCondition or frame:GetParent() == UIParent end, collapseExclusive = state.collapseExclusive, }) EditMode:AddFrameSettings(frame, { { name = "Collapse exclusives", kind = EditMode.SettingType.Checkbox, get = function() return state.collapseExclusive end, set = function(_, v) state.collapseExclusive = v EditMode:SetFrameCollapseExclusive(frame, v) end, default = true, tooltip = "Expanding one collapsible will collapse the others.", }, { name = "Disable drag when parented", kind = EditMode.SettingType.Checkbox, get = function() return state.dragCondition end, set = function(_, v) state.dragCondition = v if v then EditMode:SetFrameDragEnabled(frame, function() return frame:GetParent() == UIParent end) else EditMode:SetFrameDragEnabled(frame, nil) end end, default = false, tooltip = "Only allow drag/nudge when parent is UIParent.", }, })