Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a CreateGradient function.

Use this in plugins to create the gradient background used on text
fields (when ReskinInput cannot be used).
  • Loading branch information...
commit a83686b68782c178b55ed39a00f43dd0a44ebcd0 1 parent ee32ab2
Haleth authored
Showing with 13 additions and 15 deletions.
  1. +13 −15 FreeUI/scripts/theme.lua
View
28 FreeUI/scripts/theme.lua
@@ -8,6 +8,16 @@ end
local r, g, b = unpack(C.class)
+local function CreateGradient(f)
+ local tex = f:CreateTexture(nil, "BACKGROUND")
+ tex:SetPoint("TOPLEFT")
+ tex:SetPoint("BOTTOMRIGHT")
+ tex:SetTexture(C.media.backdrop)
+ tex:SetGradientAlpha("VERTICAL", 0, 0, 0, .3, .35, .35, .35, .35)
+end
+
+F.CreateGradient = CreateGradient
+
local function StartGlow(f)
f:SetBackdropColor(r, g, b, .1)
f:SetBackdropBorderColor(r, g, b)
@@ -41,11 +51,7 @@ local function Reskin(f, noGlow)
F.CreateBD(f, 0)
- local tex = f:CreateTexture(nil, "BACKGROUND")
- tex:SetPoint("TOPLEFT")
- tex:SetPoint("BOTTOMRIGHT")
- tex:SetTexture(C.media.backdrop)
- tex:SetGradientAlpha("VERTICAL", 0, 0, 0, .3, .35, .35, .35, .35)
+ CreateGradient(f)
if not noGlow then
f.glow = CreateFrame("Frame", nil, f)
@@ -204,11 +210,7 @@ local function ReskinClose(f, a1, p, a2, x, y)
F.CreateBD(f, 0)
- local tex = f:CreateTexture(nil, "BACKGROUND")
- tex:SetPoint("TOPLEFT")
- tex:SetPoint("BOTTOMRIGHT")
- tex:SetTexture(C.media.backdrop)
- tex:SetGradientAlpha("VERTICAL", 0, 0, 0, .3, .35, .35, .35, .35)
+ CreateGradient(f)
local text = f:CreateFontString(nil, "OVERLAY")
text:SetFont(C.media.font2, 14, "THINOUTLINE")
@@ -229,11 +231,7 @@ local function ReskinInput(f, height, width)
_G[frame.."Right"]:Hide()
F.CreateBD(f, 0)
- local tex = f:CreateTexture(nil, "BACKGROUND")
- tex:SetPoint("TOPLEFT")
- tex:SetPoint("BOTTOMRIGHT")
- tex:SetTexture(C.media.backdrop)
- tex:SetGradientAlpha("VERTICAL", 0, 0, 0, .3, .35, .35, .35, .35)
+ CreateGradient(f)
if height then f:SetHeight(height) end
if width then f:SetWidth(width) end
Please sign in to comment.
Something went wrong with that request. Please try again.