Verified Commit ede796d9 authored by Merathilis's avatar Merathilis

Added an option for my Panels to adjust the Width

parent 12a38c6c
......@@ -6,7 +6,7 @@ local function CVars()
E.Options.args.mui.args.modules.args.CombatAlert = {
type = "group",
name = E.NewSign..L["Combat Alert"],
name = L["Combat Alert"],
get = function(info) return E.db.mui.CombatAlert[info[#info]] end,
set = function(info, value) E.db.mui.CombatAlert[info[#info]] = value E:StaticPopup_Show("PRIVATE_RL") end,
args = {
......
......@@ -16,7 +16,7 @@ local function Minimap()
E.Options.args.mui.args.modules.args.minimap = {
type = "group",
name = E.NewSign..L["MiniMap"],
name = L["MiniMap"],
get = function(info) return E.db.mui.maps.minimap[ info[#info] ] end,
set = function(info, value) E.db.mui.maps.minimap[ info[#info] ] = value; E:StaticPopup_Show("PRIVATE_RL"); end,
disabled = function() return not E.private.general.minimap.enable end,
......@@ -42,7 +42,7 @@ local function Minimap()
rectangle = {
order = 3,
type = "toggle",
name = E.NewSign..L["Rectangle Minimap"],
name = L["Rectangle Minimap"],
desc = L["|cffFF0000WARNING:|r If you enable this, you must adjust your Interface manually."],
},
},
......
......@@ -13,11 +13,11 @@ local function PanelTable()
E.Options.args.mui.args.modules.args.panels = {
type = "group",
name = L["Panels"],
name = E.NewSign..L["Panels"],
args = {
header = ACH:Header(MER:cOption(L["Panels"]), 1),
panels = {
order = 2,
order = 1,
type = "group",
name = MER:cOption(L["Panels"]),
guiInline = true,
......@@ -44,75 +44,89 @@ local function PanelTable()
name = MER:cOption(L["Style Panels"]),
guiInline = true,
args = {
topLeftPanel = {
panelSize = {
order = 1,
name = E.NewSign..L["Width"],
type = "range",
min = 50, max = 800, step = 1,
get = function(info) return E.db.mui.panels.panelSize end,
set = function(info, value) E.db.mui.panels.panelSize = value; PN:Resize() end,
},
spacer = {
order = 2,
type = "description",
name = "",
width = "full",
},
topLeftPanel = {
order = 3,
type = "toggle",
name = L["Top Left Panel"],
get = function(info) return E.db.mui.panels.stylePanels.topLeftPanel end,
set = function(info, value) E.db.mui.panels.stylePanels.topLeftPanel = value; PN:UpdatePanels() end,
},
topLeftExtraPanel = {
order = 2,
order = 4,
type = "toggle",
name = L["Top Left Extra Panel"],
get = function(info) return E.db.mui.panels.stylePanels.topLeftExtraPanel end,
set = function(info, value) E.db.mui.panels.stylePanels.topLeftExtraPanel = value; PN:UpdatePanels() end,
disabled = function() return not E.db.mui.panels.stylePanels.topLeftPanel end,
},
spacer = {
order = 3,
spacer1 = {
order = 5,
type = "description",
name = "",
},
topRightPanel = {
order = 4,
order = 6,
type = "toggle",
name = L["Top Right Panel"],
get = function(info) return E.db.mui.panels.stylePanels.topRightPanel end,
set = function(info, value) E.db.mui.panels.stylePanels.topRightPanel = value; PN:UpdatePanels() end,
},
topRightExtraPanel = {
order = 5,
order = 7,
type = "toggle",
name = L["Top Right Extra Panel"],
get = function(info) return E.db.mui.panels.stylePanels.topRightExtraPanel end,
set = function(info, value) E.db.mui.panels.stylePanels.topRightExtraPanel = value; PN:UpdatePanels() end,
disabled = function() return not E.db.mui.panels.stylePanels.topRightPanel end,
},
spacer1 = {
order = 6,
spacer2 = {
order = 8,
type = "description",
name = "",
},
bottomLeftPanel = {
order = 7,
order = 9,
type = "toggle",
name = L["Bottom Left Panel"],
get = function(info) return E.db.mui.panels.stylePanels.bottomLeftPanel end,
set = function(info, value) E.db.mui.panels.stylePanels.bottomLeftPanel = value; PN:UpdatePanels() end,
},
bottomLeftExtraPanel = {
order = 8,
order = 10,
type = "toggle",
name = L["Bottom Left Extra Panel"],
get = function(info) return E.db.mui.panels.stylePanels.bottomLeftExtraPanel end,
set = function(info, value) E.db.mui.panels.stylePanels.bottomLeftExtraPanel = value; PN:UpdatePanels() end,
disabled = function() return not E.db.mui.panels.stylePanels.bottomLeftPanel end,
},
spacer2 = {
order = 9,
spacer3 = {
order = 11,
type = "description",
name = "",
},
bottomRightPanel = {
order = 10,
order = 12,
type = "toggle",
name = L["Bottom Right Panel"],
get = function(info) return E.db.mui.panels.stylePanels.bottomRightPanel end,
set = function(info, value) E.db.mui.panels.stylePanels.bottomRightPanel = value; PN:UpdatePanels() end,
},
bottomRightExtraPanel = {
order = 11,
order = 13,
type = "toggle",
name = L["Bottom Right Extra Panel"],
get = function(info) return E.db.mui.panels.stylePanels.bottomRightExtraPanel end,
......
......@@ -17,6 +17,8 @@ local r, g, b = unpack(E.media.rgbvaluecolor)
-- Style Panels
function module:CreatePanels()
local panelSize = E.db.mui.panels.panelSize or 427
local topPanel = CreateFrame("Frame", "MER_TopPanel", E.UIParent)
topPanel:SetFrameStrata("BACKGROUND")
topPanel:SetPoint("TOP", 0, 3)
......@@ -42,7 +44,7 @@ function module:CreatePanels()
local topLeftStyle = CreateFrame("Frame", "MER_TopLeftStyle", E.UIParent)
topLeftStyle:SetFrameStrata("BACKGROUND")
topLeftStyle:SetFrameLevel(2)
topLeftStyle:SetSize(_G.LeftChatPanel:GetWidth(), 4)
topLeftStyle:SetSize(panelSize, 4)
topLeftStyle:SetPoint("TOPLEFT", E.UIParent, "TOPLEFT", 2, -8)
MERS:SkinPanel(topLeftStyle)
MER_TopLeftStyle = topLeftStyle
......@@ -50,18 +52,19 @@ function module:CreatePanels()
local TopLeftStylePanel = CreateFrame("Frame", "MER_TopLeftExtraStyle", E.UIParent)
TopLeftStylePanel:SetPoint("TOPLEFT", E.UIParent, "TOPLEFT", 2, -14)
MER:CreateGradientFrame(TopLeftStylePanel, _G.LeftChatPanel:GetWidth(), 36, "Horizontal", 0, 0, 0, .5, 0)
MER:CreateGradientFrame(TopLeftStylePanel, panelSize, 36, "Horizontal", 0, 0, 0, .5, 0)
MER_TopLeftExtraStyle = TopLeftStylePanel
TopLeftStylePanel:Hide()
local TopLeftStylePanel1 = CreateFrame("Frame", nil, TopLeftStylePanel)
TopLeftStylePanel1:SetPoint("TOP", TopLeftStylePanel, "BOTTOM")
MER:CreateGradientFrame(TopLeftStylePanel1, _G.LeftChatPanel:GetWidth(), E.mult, "Horizontal", r, g, b, .7, 0)
MER:CreateGradientFrame(TopLeftStylePanel1, panelSize, E.mult, "Horizontal", r, g, b, .7, 0)
MER_TopLeftExtraStyle1 = TopLeftStylePanel1
local bottomLeftSytle = CreateFrame("Frame", "MER_BottomLeftStyle", E.UIParent)
bottomLeftSytle:SetFrameStrata("BACKGROUND")
bottomLeftSytle:SetFrameLevel(2)
bottomLeftSytle:SetSize(_G.LeftChatPanel:GetWidth(), 4)
bottomLeftSytle:SetSize(panelSize, 4)
bottomLeftSytle:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 2, 10)
MERS:SkinPanel(bottomLeftSytle)
MER_BottomLeftStyle = bottomLeftSytle
......@@ -69,18 +72,19 @@ function module:CreatePanels()
local BottomLeftStylePanel = CreateFrame("Frame", "MER_BottomLeftExtraStyle", E.UIParent)
BottomLeftStylePanel:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 2, 16)
MER:CreateGradientFrame(BottomLeftStylePanel, _G.LeftChatPanel:GetWidth(), 28, "Horizontal", 0, 0, 0, .5, 0)
MER:CreateGradientFrame(BottomLeftStylePanel, panelSize, 28, "Horizontal", 0, 0, 0, .5, 0)
MER_BottomLeftExtraStyle = BottomLeftStylePanel
BottomLeftStylePanel:Hide()
local BottomLeftStylePanel1 = CreateFrame("Frame", nil, BottomLeftStylePanel)
BottomLeftStylePanel1:SetPoint("BOTTOM", BottomLeftStylePanel, "TOP")
MER:CreateGradientFrame(BottomLeftStylePanel1, _G.LeftChatPanel:GetWidth(), E.mult, "Horizontal", r, g, b, .7, 0)
MER:CreateGradientFrame(BottomLeftStylePanel1, panelSize, E.mult, "Horizontal", r, g, b, .7, 0)
MER_BottomLeftStylePanel1 = BottomLeftStylePanel1
local topRightStyle = CreateFrame("Frame", "MER_TopRightStyle", E.UIParent)
topRightStyle:SetFrameStrata("BACKGROUND")
topRightStyle:SetFrameLevel(2)
topRightStyle:SetSize(_G.LeftChatPanel:GetWidth(), 4)
topRightStyle:SetSize(panelSize, 4)
topRightStyle:SetPoint("TOPRIGHT", E.UIParent, "TOPRIGHT", -2, -8)
MERS:SkinPanel(topRightStyle)
MER_TopRightStyle = topRightStyle
......@@ -88,18 +92,19 @@ function module:CreatePanels()
local TopRightStylePanel = CreateFrame("Frame", "MER_TopRightExtraStyle", E.UIParent)
TopRightStylePanel:SetPoint("TOPRIGHT", E.UIParent, "TOPRIGHT", -2, -14)
MER:CreateGradientFrame(TopRightStylePanel, _G.LeftChatPanel:GetWidth(), 36, "Horizontal", 0, 0, 0, 0, .5)
MER:CreateGradientFrame(TopRightStylePanel, panelSize, 36, "Horizontal", 0, 0, 0, 0, .5)
MER_TopRightExtraStyle = TopRightStylePanel
TopRightStylePanel:Hide()
local TopRightStylePanel1 = CreateFrame("Frame", nil, TopRightStylePanel)
TopRightStylePanel1:SetPoint("TOP", TopRightStylePanel, "BOTTOM")
MER:CreateGradientFrame(TopRightStylePanel1, _G.LeftChatPanel:GetWidth(), E.mult, "Horizontal", r, g, b, 0, .7)
MER:CreateGradientFrame(TopRightStylePanel1, panelSize, E.mult, "Horizontal", r, g, b, 0, .7)
MER_TopRightStylePanel1 = TopRightStylePanel1
local bottomRightStyle = CreateFrame("Frame", "MER_BottomRightStyle", E.UIParent)
bottomRightStyle:SetFrameStrata("BACKGROUND")
bottomRightStyle:SetFrameLevel(2)
bottomRightStyle:SetSize(_G.LeftChatPanel:GetWidth(), 4)
bottomRightStyle:SetSize(panelSize, 4)
bottomRightStyle:SetPoint("BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -2, 10)
MERS:SkinPanel(bottomRightStyle)
MER_BottomRightStyle = bottomRightStyle
......@@ -107,15 +112,17 @@ function module:CreatePanels()
local BottomRightStylePanel = CreateFrame("Frame", "MER_BottomRightExtraStyle", E.UIParent)
BottomRightStylePanel:SetPoint("BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -2, 16)
MER:CreateGradientFrame(BottomRightStylePanel, _G.LeftChatPanel:GetWidth(), 28, "Horizontal", 0, 0, 0, 0, .5)
MER:CreateGradientFrame(BottomRightStylePanel, panelSize, 28, "Horizontal", 0, 0, 0, 0, .5)
MER_BottomRightExtraStyle = BottomRightStylePanel
BottomRightStylePanel:Hide()
local BottomRightStylePanel1 = CreateFrame("Frame", nil, BottomRightStylePanel)
BottomRightStylePanel1:SetPoint("BOTTOM", BottomRightStylePanel, "TOP")
MER:CreateGradientFrame(BottomRightStylePanel1, _G.LeftChatPanel:GetWidth(), E.mult, "Horizontal", r, g, b, 0, .7)
MER:CreateGradientFrame(BottomRightStylePanel1, panelSize, E.mult, "Horizontal", r, g, b, 0, .7)
MER_BottomRightStylePanel1 = BottomRightStylePanel1
module:UpdatePanels()
module:Resize()
end
function module:UpdatePanels()
......@@ -176,15 +183,37 @@ function module:UpdatePanels()
end
end
function module:Resize()
local panelSize = E.db.mui.panels.panelSize or 427
MER_TopLeftStyle:SetSize(panelSize, 4)
MER_TopLeftExtraStyle:SetSize(panelSize, 36)
MER_TopLeftExtraStyle1:SetSize(panelSize, E.mult)
MER_BottomLeftStyle:SetSize(panelSize, 4)
MER_BottomLeftExtraStyle:SetSize(panelSize, 28)
MER_BottomLeftStylePanel1:SetSize(panelSize, E.mult)
MER_TopRightStyle:SetSize(panelSize, 4)
MER_TopRightExtraStyle:SetSize(panelSize, 36)
MER_TopRightStylePanel1:SetSize(panelSize, E.mult)
MER_BottomRightStyle:SetSize(panelSize, 4)
MER_BottomRightExtraStyle:SetSize(panelSize, 28)
MER_BottomRightStylePanel1:SetSize(panelSize, E.mult)
end
function module:Initialize()
local db = E.db.mui.panels
MER:RegisterDB(self, "panels")
self:CreatePanels()
self:Resize()
function module:ForUpdateAll()
local db = E.db.mui.panels
self:UpdatePanels()
self:Resize()
end
self:ForUpdateAll()
end
......
......@@ -455,6 +455,7 @@ MP.panels = {
bottomRightPanel = true,
bottomRightExtraPanel = true,
},
panelSize = 427,
}
MP.smb = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment