Skip to content

Commit

Permalink
Merge pull request #136 from DakJaniels/master
Browse files Browse the repository at this point in the history
anchor constrains fix
  • Loading branch information
sirinsidiator committed Dec 30, 2023
2 parents 404543c + ba9a461 commit 4493609
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -11,3 +11,6 @@ Thumbs.db
/target
/temp
/.history

# vscode
/.vscode
2 changes: 1 addition & 1 deletion LibAddonMenu-2.0/LibAddonMenu-2.0.lua
Expand Up @@ -121,7 +121,7 @@ local function CreateFAQTexture(control)
faqControl.data.tooltipText = FAQ_ICON_TOOTIP_TEMPLATE:format(util.L.WEBSITE, helpUrl)

faqControl:SetMouseEnabled(true)
local function onMouseExitFAQ(ctrl)
local function onMouseExitFAQ(ctrl, ...)
ZO_Options_OnMouseExit(ctrl)
ctrl:SetColor(FAQ_ICON_COLOR:UnpackRGBA())
ctrl:SetAlpha(FAQ_ICON_MOUSE_EXIT_ALPHA)
Expand Down
4 changes: 3 additions & 1 deletion LibAddonMenu-2.0/controls/custom.lua
Expand Up @@ -9,7 +9,7 @@
resetFunc = function(customControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]

local widgetVersion = 8
local widgetVersion = 9
local LAM = LibAddonMenu2
if not LAM:RegisterWidget("custom", widgetVersion) then return end

Expand All @@ -31,8 +31,10 @@ function LAMCreateControl.custom(parent, customData, controlName)

if control.isHalfWidth then --note these restrictions
control:SetDimensionConstraints(width / 2, minHeight, width / 2, maxHeight)
control:SetResizeToFitConstrains(ANCHOR_CONSTRAINS_Y)
else
control:SetDimensionConstraints(width, minHeight, width, maxHeight)
control:SetResizeToFitConstrains(ANCHOR_CONSTRAINS_Y)
end

control.UpdateValue = UpdateValue
Expand Down
4 changes: 3 additions & 1 deletion LibAddonMenu-2.0/controls/description.lua
Expand Up @@ -13,7 +13,7 @@
} ]]


local widgetVersion = 13
local widgetVersion = 14
local LAM = LibAddonMenu2
if not LAM:RegisterWidget("description", widgetVersion) then return end

Expand Down Expand Up @@ -53,8 +53,10 @@ function LAMCreateControl.description(parent, descriptionData, controlName)

if isHalfWidth then
control:SetDimensionConstraints(width / 2, 0, width / 2, 0)
control:SetResizeToFitConstrains(ANCHOR_CONSTRAINS_Y)
else
control:SetDimensionConstraints(width, 0, width, 0)
control:SetResizeToFitConstrains(ANCHOR_CONSTRAINS_Y)
end

control.desc = wm:CreateControl(nil, control, CT_LABEL)
Expand Down
4 changes: 3 additions & 1 deletion LibAddonMenu-2.0/controls/texture.lua
Expand Up @@ -10,7 +10,7 @@

-- TODO: add texture coords support?

local widgetVersion = 10
local widgetVersion = 11
local LAM = LibAddonMenu2
if not LAM:RegisterWidget("texture", widgetVersion) then return end

Expand All @@ -24,8 +24,10 @@ function LAMCreateControl.texture(parent, textureData, controlName)

if control.isHalfWidth then --note these restrictions
control:SetDimensionConstraints(width / 2, MIN_HEIGHT, width / 2, MIN_HEIGHT * 4)
control:SetResizeToFitConstrains(ANCHOR_CONSTRAINS_Y)
else
control:SetDimensionConstraints(width, MIN_HEIGHT, width, MIN_HEIGHT * 4)
control:SetResizeToFitConstrains(ANCHOR_CONSTRAINS_Y)
end

control.texture = wm:CreateControl(nil, control, CT_TEXTURE)
Expand Down

0 comments on commit 4493609

Please sign in to comment.