Skip to content

Commit

Permalink
- added styling of tooltips from LibDropDownMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
frozn committed Aug 23, 2024
1 parent 7c0907e commit 6bacc1a
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions TipTac/ttCore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,7 @@ TT_ExtendedConfig.tipsToModify = {

local function addUIDropDownMenuFrames()
for i = last_UIDROPDOWNMENU_MAXLEVELS + 1, UIDROPDOWNMENU_MAXLEVELS do -- see "UIDropDownMenu.lua"
tt:AddModifiedTipExtended("DropDownList" .. i, {
applyAppearance = true,
applyScaling = false, -- #todo: switch applyScaling from "false" to "true", but needed more coding to consider call of SetScale() in ToggleDropDownMenu() in "UIDropDownMenu.lua"
applyAnchor = false
});
tt:AddModifiedTip("DropDownList" .. i);
end

last_UIDROPDOWNMENU_MAXLEVELS = UIDROPDOWNMENU_MAXLEVELS;
Expand All @@ -613,6 +609,32 @@ TT_ExtendedConfig.tipsToModify = {
tt:SetAppearanceToTip(tip);
end);

-- LibDropDownMenu, e.g used by addon Broker_Everything
local LibDropDownMenu = LibStub("LibDropDownMenu");

if (LibDropDownMenu) then
local function addLibDropDownMenuFrame(name)
tt:AddModifiedTip(name);
end

for i = 1, UIDROPDOWNMENU_MAXLEVELS do
addLibDropDownMenuFrame("LibDropDownMenu_List" .. i);
end

-- HOOK: LibDropDownMenu.Create_DropDownList() to add the new frames
hooksecurefunc(LibDropDownMenu, "Create_DropDownList", function(name, parent, opts)
addLibDropDownMenuFrame(name);
end);

-- HOOK: ToggleDropDownMenu() to reapply appearance because e.g. 1-pixel borders sometimes aren't displayed correctly
hooksecurefunc(LibDropDownMenu, "ToggleDropDownMenu", function(level, value, dropDownFrame, anchorName, xOffset, yOffset, menuList, button, autoHideDelay, overrideDisplayMode)
-- reapply appearance to tip
local tip = _G["LibDropDownMenu_List" .. (level or 1)];

tt:SetAppearanceToTip(tip);
end);
end

-- LibQTip-1.0, e.g. used by addon Broker_Location
local LibQTip = LibStub:GetLibrary("LibQTip-1.0", true);

Expand Down Expand Up @@ -712,28 +734,6 @@ TT_ExtendedConfig.tipsToModify = {
end
end

-- LibDropDownMenu, e.g used by addon Broker_Everything
local LibDropDownMenu = LibStub("LibDropDownMenu");

if (LibDropDownMenu) then
local function addLibDropDownMenuFrame(name)
tt:AddModifiedTipExtended(name, {
applyAppearance = true,
applyScaling = false, -- #todo: switch applyScaling from "false" to "true", but needed more coding to consider call of SetScale() in ToggleDropDownMenu() in "LibDropDownMenu.lua"
applyAnchor = false
});
end

for i = 1, UIDROPDOWNMENU_MAXLEVELS do
addLibDropDownMenuFrame("LibDropDownMenu_List" .. i);
end

-- HOOK: LibDropDownMenu.Create_DropDownList() to add the new frames
hooksecurefunc(LibDropDownMenu, "Create_DropDownList", function(name, parent, opts)
addLibDropDownMenuFrame(name);
end);
end

-- LibExtraTip-1, e.g used by addon BiS-Tooltip
local LibExtraTip = LibStub:GetLibrary("LibExtraTip-1", true);

Expand Down

0 comments on commit 6bacc1a

Please sign in to comment.