panel: add option to autohide

This commit is contained in:
shagu
2017-12-03 20:09:53 +01:00
parent 1b10999ef3
commit 791789231e
3 changed files with 35 additions and 0 deletions
+12
View File
@@ -1262,6 +1262,18 @@ pfUI:RegisterModule("gui", function ()
end
end)
-- >> Autohide
pfUI.gui.tabs.panel.tabs.autohide = pfUI.gui.tabs.panel.tabs:CreateTabChild(T["Autohide"], true)
pfUI.gui.tabs.panel.tabs.autohide:SetScript("OnShow", function()
if not this.setup then
CreateConfig(this, T["Enable Autohide For Left Chat Panel"], C.panel, "hide_leftchat", "checkbox")
CreateConfig(this, T["Enable Autohide For Right Chat Panel"], C.panel, "hide_rightchat", "checkbox")
CreateConfig(this, T["Enable Autohide For Minimap Panel"], C.panel, "hide_minimap", "checkbox")
CreateConfig(this, T["Enable Autohide For Microbar Panel"], C.panel, "hide_microbar", "checkbox")
this.setup = true
end
end)
-- [[ Tooltip ]]
pfUI.gui.tabs.tooltip = pfUI.gui.tabs:CreateTabChild(T["Tooltip"], nil, nil, nil, true)
+18
View File
@@ -704,4 +704,22 @@ pfUI:RegisterModule("panel", function ()
button:Show()
end
end
pfUI.panel.autohide = CreateFrame("Frame", nil, UIParent)
pfUI.panel.autohide:RegisterEvent("PLAYER_ENTERING_WORLD")
pfUI.panel.autohide:SetScript("OnEvent", function()
if C.panel.hide_leftchat == "1" then
CreateAutohide(pfUI.panel.left)
end
if C.panel.hide_rightchat == "1" then
CreateAutohide(pfUI.panel.right)
end
if C.panel.hide_minimap == "1" then
CreateAutohide(pfUI.panel.minimap)
end
if C.panel.hide_microbar == "1" then
CreateAutohide(pfUI.panel.microbutton)
end
end)
end)