mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
E:Point, E:Size, E:Width, E:Height, & cleanup
This commit is contained in:
@@ -35,34 +35,31 @@ local function SkinScrollBar(frame, thumbTrim)
|
||||
if not _G[frame:GetName().."ScrollUpButton"].icon then
|
||||
S:HandleNextPrevButton(_G[frame:GetName().."ScrollUpButton"])
|
||||
S:SquareButton_SetIcon(_G[frame:GetName().."ScrollUpButton"], "UP")
|
||||
_G[frame:GetName().."ScrollUpButton"]:SetWidth(_G[frame:GetName().."ScrollUpButton"]:GetWidth() + 7)
|
||||
_G[frame:GetName().."ScrollUpButton"]:SetHeight(_G[frame:GetName().."ScrollUpButton"]:GetHeight() + 7)
|
||||
E:Size(_G[frame:GetName().."ScrollUpButton"], _G[frame:GetName().."ScrollUpButton"]:GetWidth() + 7, _G[frame:GetName().."ScrollUpButton"]:GetHeight() + 7)
|
||||
end
|
||||
|
||||
E:StripTextures(_G[frame:GetName().."ScrollDownButton"])
|
||||
if not _G[frame:GetName().."ScrollDownButton"].icon then
|
||||
S:HandleNextPrevButton(_G[frame:GetName().."ScrollDownButton"])
|
||||
S:SquareButton_SetIcon(_G[frame:GetName().."ScrollDownButton"], "DOWN")
|
||||
_G[frame:GetName().."ScrollDownButton"]:SetWidth(_G[frame:GetName().."ScrollDownButton"]:GetWidth() + 7)
|
||||
_G[frame:GetName().."ScrollDownButton"]:SetHeight(_G[frame:GetName().."ScrollDownButton"]:GetHeight() + 7)
|
||||
E:Size(_G[frame:GetName().."ScrollDownButton"], _G[frame:GetName().."ScrollDownButton"]:GetWidth() + 7, _G[frame:GetName().."ScrollDownButton"]:GetHeight() + 7)
|
||||
end
|
||||
|
||||
if not frame.trackbg then
|
||||
frame.trackbg = CreateFrame("Frame", nil, frame)
|
||||
frame.trackbg:SetPoint("TOPLEFT", _G[frame:GetName().."ScrollUpButton"], "BOTTOMLEFT", 0, -1)
|
||||
frame.trackbg:SetPoint("BOTTOMRIGHT", _G[frame:GetName().."ScrollDownButton"], "TOPRIGHT", 0, 1)
|
||||
E:Point(frame.trackbg, "TOPLEFT", _G[frame:GetName().."ScrollUpButton"], "BOTTOMLEFT", 0, -1)
|
||||
E:Point(frame.trackbg, "BOTTOMRIGHT", _G[frame:GetName().."ScrollDownButton"], "TOPRIGHT", 0, 1)
|
||||
E:SetTemplate(frame.trackbg, "Transparent")
|
||||
end
|
||||
|
||||
if frame:GetThumbTexture() then
|
||||
if not thumbTrim then thumbTrim = 3 end
|
||||
frame:GetThumbTexture():SetTexture(nil)
|
||||
frame:GetThumbTexture():SetHeight(24)
|
||||
E:Height(frame:GetThumbTexture(), 24)
|
||||
if not frame.thumbbg then
|
||||
frame.thumbbg = CreateFrame("Frame", nil, frame)
|
||||
frame.thumbbg:SetPoint("TOPLEFT", frame:GetThumbTexture(), "TOPLEFT", 2, -thumbTrim)
|
||||
frame.thumbbg:SetPoint("TOPLEFT", frame:GetThumbTexture(), "TOPLEFT", 2, -thumbTrim)
|
||||
frame.thumbbg:SetPoint("BOTTOMRIGHT", frame:GetThumbTexture(), "BOTTOMRIGHT", -2, thumbTrim)
|
||||
E:Point(frame.thumbbg, "TOPLEFT", frame:GetThumbTexture(), "TOPLEFT", 2, -thumbTrim)
|
||||
E:Point(frame.thumbbg, "BOTTOMRIGHT", frame:GetThumbTexture(), "BOTTOMRIGHT", -2, thumbTrim)
|
||||
E:SetTemplate(frame.thumbbg, "Default", true, true)
|
||||
frame.thumbbg:SetBackdropColor(0.3, 0.3, 0.3)
|
||||
if frame.trackbg then
|
||||
@@ -124,10 +121,10 @@ function S:SkinAce3()
|
||||
|
||||
SkinButton(widget.button)
|
||||
SkinScrollBar(widget.scrollBar)
|
||||
widget.scrollBar:SetPoint("RIGHT", frame, "RIGHT", 0 -4)
|
||||
widget.scrollBG:SetPoint("TOPRIGHT", widget.scrollBar, "TOPLEFT", -2, 19)
|
||||
widget.scrollBG:SetPoint("BOTTOMLEFT", widget.button, "TOPLEFT")
|
||||
widget.scrollFrame:SetPoint("BOTTOMRIGHT", widget.scrollBG, "BOTTOMRIGHT", -4, 8)
|
||||
E:Point(widget.scrollBar, "RIGHT", frame, "RIGHT", 0 -4)
|
||||
E:Point(widget.scrollBG, "TOPRIGHT", widget.scrollBar, "TOPLEFT", -2, 19)
|
||||
E:Point(widget.scrollBG, "BOTTOMLEFT", widget.button, "TOPLEFT")
|
||||
E:Point(widget.scrollFrame, "BOTTOMRIGHT", widget.scrollBG, "BOTTOMRIGHT", -4, 8)
|
||||
elseif TYPE == "CheckBox" then
|
||||
E:Kill(widget.checkbg)
|
||||
E:Kill(widget.highlight)
|
||||
@@ -135,8 +132,8 @@ function S:SkinAce3()
|
||||
if not widget.skinnedCheckBG then
|
||||
widget.skinnedCheckBG = CreateFrame("Frame", nil, widget.frame)
|
||||
E:SetTemplate(widget.skinnedCheckBG, "Default")
|
||||
widget.skinnedCheckBG:SetPoint("TOPLEFT", widget.checkbg, "TOPLEFT", 4, -4)
|
||||
widget.skinnedCheckBG:SetPoint("BOTTOMRIGHT", widget.checkbg, "BOTTOMRIGHT", -4, 4)
|
||||
E:Point(widget.skinnedCheckBG, "TOPLEFT", widget.checkbg, "TOPLEFT", 4, -4)
|
||||
E:Point(widget.skinnedCheckBG, "BOTTOMRIGHT", widget.checkbg, "BOTTOMRIGHT", -4, 4)
|
||||
end
|
||||
|
||||
widget.check:SetParent(widget.skinnedCheckBG)
|
||||
@@ -147,14 +144,14 @@ function S:SkinAce3()
|
||||
E:StripTextures(frame)
|
||||
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint("RIGHT", frame, "RIGHT", -20, 0)
|
||||
E:Point(button, "RIGHT", frame, "RIGHT", -20, 0)
|
||||
|
||||
S:HandleNextPrevButton(button, true)
|
||||
|
||||
if not frame.backdrop then
|
||||
E:CreateBackdrop(frame, "Default")
|
||||
frame.backdrop:SetPoint("TOPLEFT", 20, -2)
|
||||
frame.backdrop:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
|
||||
E:Point(frame.backdrop, "TOPLEFT", 20, -2)
|
||||
E:Point(frame.backdrop, "BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
|
||||
end
|
||||
button:SetParent(frame.backdrop)
|
||||
text:SetParent(frame.backdrop)
|
||||
@@ -164,15 +161,13 @@ function S:SkinAce3()
|
||||
E:SetTemplate(dropdown.frame, "Default", true)
|
||||
if dropdown.slider then
|
||||
E:SetTemplate(dropdown.slider, "Default")
|
||||
dropdown.slider:SetPoint("TOPRIGHT", dropdown.frame, "TOPRIGHT", -10, -10)
|
||||
dropdown.slider:SetPoint("BOTTOMRIGHT", dropdown.frame, "BOTTOMRIGHT", -10, 10)
|
||||
E:Point(dropdown.slider, "TOPRIGHT", dropdown.frame, "TOPRIGHT", -10, -10)
|
||||
E:Point(dropdown.slider, "BOTTOMRIGHT", dropdown.frame, "BOTTOMRIGHT", -10, 10)
|
||||
|
||||
if dropdown.slider:GetThumbTexture() then
|
||||
dropdown.slider:SetThumbTexture(E["media"].blankTex)
|
||||
dropdown.slider:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
|
||||
-- dropdown.slider:GetThumbTexture():Size(10, 12)
|
||||
dropdown.slider:GetThumbTexture():SetWidth(10)
|
||||
dropdown.slider:GetThumbTexture():SetHeight(12)
|
||||
E:Size(dropdown.slider:GetThumbTexture(), 10, 12)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -185,29 +180,29 @@ function S:SkinAce3()
|
||||
|
||||
S:HandleNextPrevButton(button, true)
|
||||
frame.text:ClearAllPoints()
|
||||
frame.text:SetPoint("RIGHT", button, "LEFT", -2, 0)
|
||||
E:Point(frame.text, "RIGHT", button, "LEFT", -2, 0)
|
||||
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint("RIGHT", frame, "RIGHT", -10, -6)
|
||||
E:Point(button, "RIGHT", frame, "RIGHT", -10, -6)
|
||||
|
||||
if not frame.backdrop then
|
||||
E:CreateBackdrop(frame, "Default")
|
||||
if TYPE == "LSM30_Font" then
|
||||
frame.backdrop:SetPoint("TOPLEFT", 20, -17)
|
||||
E:Point(frame.backdrop, "TOPLEFT", 20, -17)
|
||||
elseif TYPE == "LSM30_Sound" then
|
||||
frame.backdrop:SetPoint("TOPLEFT", 20, -17)
|
||||
E:Point(frame.backdrop, "TOPLEFT", 20, -17)
|
||||
widget.soundbutton:SetParent(frame.backdrop)
|
||||
widget.soundbutton:ClearAllPoints()
|
||||
widget.soundbutton:SetPoint("LEFT", frame.backdrop, "LEFT", 2, 0)
|
||||
E:Point(widget.soundbutton, "LEFT", frame.backdrop, "LEFT", 2, 0)
|
||||
elseif TYPE == "LSM30_Statusbar" then
|
||||
frame.backdrop:SetPoint("TOPLEFT", 20, -17)
|
||||
E:Point(frame.backdrop, "TOPLEFT", 20, -17)
|
||||
widget.bar:SetParent(frame.backdrop)
|
||||
E:SetInside(widget.bar)
|
||||
elseif TYPE == "LSM30_Border" or TYPE == "LSM30_Background" then
|
||||
frame.backdrop:SetPoint("TOPLEFT", 42, -16)
|
||||
E:Point(frame.backdrop, "TOPLEFT", 42, -16)
|
||||
end
|
||||
|
||||
frame.backdrop:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
|
||||
E:Point(frame.backdrop, "BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
|
||||
end
|
||||
button:SetParent(frame.backdrop)
|
||||
text:SetParent(frame.backdrop)
|
||||
@@ -217,23 +212,21 @@ function S:SkinAce3()
|
||||
E:SetTemplate(dropdown, "Default", true)
|
||||
if dropdown.slider then
|
||||
E:SetTemplate(dropdown.slider, "Transparent")
|
||||
dropdown.slider:SetPoint("TOPRIGHT", dropdown, "TOPRIGHT", -10, -10)
|
||||
dropdown.slider:SetPoint("BOTTOMRIGHT", dropdown, "BOTTOMRIGHT", -10, 10)
|
||||
E:Point(dropdown.slider, "TOPRIGHT", dropdown, "TOPRIGHT", -10, -10)
|
||||
E:Point(dropdown.slider, "BOTTOMRIGHT", dropdown, "BOTTOMRIGHT", -10, 10)
|
||||
|
||||
if dropdown.slider:GetThumbTexture() then
|
||||
dropdown.slider:SetThumbTexture(E["media"].blankTex)
|
||||
dropdown.slider:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
|
||||
-- dropdown.slider:GetThumbTexture():Size(10, 12)
|
||||
dropdown.slider:GetThumbTexture():SetWidth(10)
|
||||
dropdown.slider:GetThumbTexture():SetHeight(12)
|
||||
E:Size(dropdown.slider:GetThumbTexture(), 10, 12)
|
||||
end
|
||||
end
|
||||
|
||||
if TYPE == "LSM30_Sound" then
|
||||
local frame = this.obj.frame
|
||||
local width = frame:GetWidth()
|
||||
dropdown:SetPoint("TOPLEFT", frame, "BOTTOMLEFT")
|
||||
dropdown:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 30, 0)
|
||||
E:Point(dropdown, "TOPLEFT", frame, "BOTTOMLEFT")
|
||||
E:Point(dropdown, "TOPRIGHT", frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 30, 0)
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -243,10 +236,10 @@ function S:SkinAce3()
|
||||
E:Kill(_G[frame:GetName().."Left"])
|
||||
E:Kill(_G[frame:GetName().."Middle"])
|
||||
E:Kill(_G[frame:GetName().."Right"])
|
||||
frame:SetHeight(17)
|
||||
E:Height(frame, 17)
|
||||
E:CreateBackdrop(frame, "Default")
|
||||
frame.backdrop:SetPoint("TOPLEFT", -2, 0)
|
||||
frame.backdrop:SetPoint("BOTTOMRIGHT", 2, 0)
|
||||
E:Point(frame.backdrop, "TOPLEFT", -2, 0)
|
||||
E:Point(frame.backdrop, "BOTTOMRIGHT", 2, 0)
|
||||
frame.backdrop:SetParent(widget.frame)
|
||||
frame:SetParent(frame.backdrop)
|
||||
SkinButton(button)
|
||||
@@ -275,10 +268,10 @@ function S:SkinAce3()
|
||||
msgframe:SetToplevel(true)
|
||||
|
||||
msg:ClearAllPoints()
|
||||
msg:SetPoint("LEFT", 10, 0)
|
||||
msg:SetPoint("RIGHT", -10, 0)
|
||||
E:Point(msg, "LEFT", 10, 0)
|
||||
E:Point(msg, "RIGHT", -10, 0)
|
||||
msg:SetJustifyV("MIDDLE")
|
||||
msg:SetWidth(msg:GetWidth() + 10)
|
||||
E:Width(msg, msg:GetWidth() + 10)
|
||||
elseif TYPE == "Slider" then
|
||||
local frame = widget.slider
|
||||
local editbox = widget.editbox
|
||||
@@ -288,19 +281,17 @@ function S:SkinAce3()
|
||||
|
||||
E:StripTextures(frame)
|
||||
E:SetTemplate(frame, "Default")
|
||||
frame:SetHeight(HEIGHT)
|
||||
E:Height(frame, HEIGHT)
|
||||
frame:SetThumbTexture(E["media"].blankTex)
|
||||
frame:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
|
||||
-- frame:GetThumbTexture():Size(HEIGHT-2,HEIGHT+2)
|
||||
frame:GetThumbTexture():SetWidth(HEIGHT-2)
|
||||
frame:GetThumbTexture():SetHeight(HEIGHT+2)
|
||||
E:Size(frame:GetThumbTexture(), HEIGHT-2, HEIGHT+2)
|
||||
|
||||
E:SetTemplate(editbox, "Default")
|
||||
editbox:SetHeight(15)
|
||||
editbox:SetPoint("TOP", frame, "BOTTOM", 0, -1)
|
||||
E:Height(editbox, 15)
|
||||
E:Point(editbox, "TOP", frame, "BOTTOM", 0, -1)
|
||||
|
||||
lowtext:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", 2, -2)
|
||||
hightext:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", -2, -2)
|
||||
E:Point(lowtext, "TOPLEFT", frame, "BOTTOMLEFT", 2, -2)
|
||||
E:Point(hightext, "TOPRIGHT", frame, "BOTTOMRIGHT", -2, -2)
|
||||
|
||||
--[[elseif TYPE == "ColorPicker" then
|
||||
local frame = widget.frame
|
||||
@@ -352,7 +343,7 @@ function S:SkinAce3()
|
||||
|
||||
if widget.treeframe then
|
||||
E:SetTemplate(widget.treeframe, "Transparent")
|
||||
frame:SetPoint("TOPLEFT", widget.treeframe, "TOPRIGHT", 1, 0)
|
||||
E:Point(frame, "TOPLEFT", widget.treeframe, "TOPRIGHT", 1, 0)
|
||||
|
||||
local oldCreateButton = widget.CreateButton
|
||||
widget.CreateButton = function(self)
|
||||
@@ -362,7 +353,7 @@ function S:SkinAce3()
|
||||
button.toggle.SetPushedTexture = E.noop
|
||||
button.toggleText = button.toggle:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(button.toggleText, nil, 19)
|
||||
button.toggleText:SetPoint("CENTER", 0, 0)
|
||||
E:Point(button.toggleText, "CENTER", 0, 0)
|
||||
button.toggleText:SetText("+")
|
||||
return button
|
||||
end
|
||||
@@ -395,8 +386,8 @@ function S:SkinAce3()
|
||||
tab.backdrop = CreateFrame("Frame", nil, tab)
|
||||
E:SetTemplate(tab.backdrop, "Transparent")
|
||||
tab.backdrop:SetFrameLevel(tab:GetFrameLevel() - 1)
|
||||
tab.backdrop:SetPoint("TOPLEFT", 10, -3)
|
||||
tab.backdrop:SetPoint("BOTTOMRIGHT", -10, 0)
|
||||
E:Point(tab.backdrop, "TOPLEFT", 10, -3)
|
||||
E:Point(tab.backdrop, "BOTTOMRIGHT", -10, 0)
|
||||
return tab
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user