framework update
This commit is contained in:
+26
-5
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 364
|
||||
local dversion = 366
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary (major, minor)
|
||||
|
||||
@@ -1484,6 +1484,24 @@ end
|
||||
height = abs ((height or parent:GetHeight()) - abs (y_offset) + 20)
|
||||
height = height*-1
|
||||
|
||||
--normalize format types
|
||||
for index, widgetTable in ipairs(menu) do
|
||||
if (widgetTable.type == "space") then
|
||||
widgetTable.type = "blank"
|
||||
elseif (widgetTable.type == "dropdown") then
|
||||
widgetTable.type = "select"
|
||||
elseif (widgetTable.type == "switch") then
|
||||
widgetTable.type = "toggle"
|
||||
elseif (widgetTable.type == "slider") then
|
||||
widgetTable.type = "range"
|
||||
elseif (widgetTable.type == "button") then
|
||||
widgetTable.type = "execute"
|
||||
end
|
||||
end
|
||||
|
||||
--catch some options added in the hash part of the menu table
|
||||
local useBoxFirstOnAllWidgets = menu.always_boxfirst
|
||||
|
||||
for index, widget_table in ipairs(menu) do
|
||||
if (not widget_table.hidden) then
|
||||
|
||||
@@ -1611,7 +1629,7 @@ end
|
||||
switch:ClearAllPoints()
|
||||
switch.hasLabel:ClearAllPoints()
|
||||
|
||||
if (widget_table.boxfirst) then
|
||||
if (widget_table.boxfirst or useBoxFirstOnAllWidgets) then
|
||||
switch:SetPoint (cur_x, cur_y)
|
||||
switch.hasLabel:SetPoint ("left", switch, "right", 2)
|
||||
else
|
||||
@@ -1720,7 +1738,7 @@ end
|
||||
label.text = widget_table.name .. (use_two_points and ": " or "")
|
||||
label:SetTemplate(widget_table.text_template or text_template)
|
||||
|
||||
if (widget_table.boxfirst) then
|
||||
if (widget_table.boxfirst or useBoxFirstOnAllWidgets) then
|
||||
label:SetPoint("left", colorpick, "right", 2)
|
||||
colorpick:SetPoint(cur_x, cur_y)
|
||||
extraPaddingY = 1
|
||||
@@ -1895,6 +1913,9 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
--catch some options added in the hash part of the menu table
|
||||
local useBoxFirstOnAllWidgets = menu.always_boxfirst
|
||||
|
||||
for index, widget_table in ipairs (menu) do
|
||||
if (not widget_table.hidden) then
|
||||
|
||||
@@ -1996,7 +2017,7 @@ end
|
||||
end
|
||||
|
||||
local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12)
|
||||
if (widget_table.boxfirst) then
|
||||
if (widget_table.boxfirst or useBoxFirstOnAllWidgets) then
|
||||
switch:SetPoint (cur_x, cur_y)
|
||||
label:SetPoint ("left", switch, "right", 2)
|
||||
|
||||
@@ -2100,7 +2121,7 @@ end
|
||||
end
|
||||
|
||||
local label = DF:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name .. (use_two_points and ": " or ""), "GameFontNormal", widget_table.text_template or text_template or 12)
|
||||
if (widget_table.boxfirst) then
|
||||
if (widget_table.boxfirst or useBoxFirstOnAllWidgets) then
|
||||
label:SetPoint("left", colorpick, "right", 2)
|
||||
colorpick:SetPoint(cur_x, cur_y)
|
||||
extraPaddingY = 1
|
||||
|
||||
@@ -3952,6 +3952,7 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta
|
||||
|
||||
local title = DF:CreateLabel (f, frame.title, 16, "silver")
|
||||
title:SetPoint ("topleft", mainTitle, "bottomleft", 0, 0)
|
||||
f.titleText = title
|
||||
|
||||
local tabButton = DF:CreateButton (mainFrame, DF.TabContainerFunctions.SelectIndex, buttonWidth, buttonHeight, frame.title, i, nil, nil, nil, "$parentTabButton" .. frame.name, false, button_tab_template)
|
||||
PixelUtil.SetSize (tabButton, buttonWidth, buttonHeight)
|
||||
|
||||
+11
-4
@@ -352,10 +352,17 @@ DF:Mixin(ImageMetaFunctions, DF.SetPointMixin)
|
||||
if (texture) then
|
||||
if (type(texture) == "table") then
|
||||
if (texture.gradient) then
|
||||
ImageObject.image:SetColorTexture(1, 1, 1, 1)
|
||||
local fromColor = DF:FormatColor("tablemembers", texture.fromColor)
|
||||
local toColor = DF:FormatColor("tablemembers", texture.toColor)
|
||||
ImageObject.image:SetGradient(texture.gradient, fromColor, toColor)
|
||||
if (DF.IsDragonflight()) then
|
||||
ImageObject.image:SetColorTexture(1, 1, 1, 1)
|
||||
local fromColor = DF:FormatColor("tablemembers", texture.fromColor)
|
||||
local toColor = DF:FormatColor("tablemembers", texture.toColor)
|
||||
ImageObject.image:SetGradient(texture.gradient, fromColor, toColor)
|
||||
else
|
||||
local fromR, fromG, fromB, fromA = DF:ParseColors(texture.fromColor)
|
||||
local toR, toG, toB, toA = DF:ParseColors(texture.toColor)
|
||||
ImageObject.image:SetColorTexture(1, 1, 1, 1)
|
||||
ImageObject.image:SetGradientAlpha(texture.gradient, fromR, fromG, fromB, fromA, toR, toG, toB, toA)
|
||||
end
|
||||
else
|
||||
local r, g, b, a = DF:ParseColors(texture)
|
||||
ImageObject.image:SetColorTexture(r, g, b, a)
|
||||
|
||||
Reference in New Issue
Block a user