Skip to content

Commit

Permalink
10.2.0 (52148)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 14, 2023
1 parent 982367f commit d4aa41e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
13 changes: 8 additions & 5 deletions Interface/SharedXML/ModelSceneControlFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,22 @@ end
function ModelSceneControlButtonMixin:OnEnter()
self:GetParent():SetAlpha(1);
if ( GetCVar("UberTooltips") == "1" ) then
local tooltip = GetAppropriateTooltip();
local uiParent = GetAppropriateTopLevelParent();
GameTooltip_SetDefaultAnchor(GameTooltip, uiParent);
GameTooltip_SetTitle(GameTooltip, self.tooltip);
GameTooltip_SetDefaultAnchor(tooltip, uiParent);
GameTooltip_SetTitle(tooltip, self.tooltip);
if ( self.tooltipText ) then
GameTooltip_AddBodyLine(GameTooltip, self.tooltipText);
GameTooltip_AddBodyLine(tooltip, self.tooltipText);
end
GameTooltip:Show();
tooltip:Show();
end
end

function ModelSceneControlButtonMixin:OnLeave()
self:GetParent():SetAlpha(0.5);
GameTooltip:Hide();

local tooltip = GetAppropriateTooltip();
tooltip:Hide();
end

--------------------------------------------------
Expand Down
10 changes: 7 additions & 3 deletions Interface/SharedXML/SharedUIPanelTemplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1772,9 +1772,9 @@ local function getNumColumnsAndStride(numSelections, maxStride)
elseif numSelections > MAX_POPOUT_ENTRIES_FOR_2_COLUMNS then
numColumns, stride = 3, math.ceil(numSelections / 3);
elseif numSelections > MAX_POPOUT_ENTRIES_FOR_1_COLUMN then
numColumns, stride = 2, math.ceil(numSelections / 2);
numColumns, stride = 2, math.ceil(numSelections / 2);
else
numColumns, stride = 1, numSelections;
numColumns, stride = 1, numSelections;
end

if maxStride and stride > maxStride then
Expand All @@ -1785,11 +1785,15 @@ local function getNumColumnsAndStride(numSelections, maxStride)
return numColumns, stride;
end

local MIN_STRIDE = 1;

function SelectionPopoutButtonMixin:GetMaxPopoutStride()
local maxPopoutHeight = self.parent.GetMaxPopoutHeight and self.parent:GetMaxPopoutHeight() or nil;
if maxPopoutHeight then
local selectionHeight = 20;
return math.floor(maxPopoutHeight / selectionHeight);

-- Calculate the max stride, and clamp it to be at least one (to avoid div by zero errors).
return math.max(MIN_STRIDE, math.floor(maxPopoutHeight / selectionHeight));
end
end

Expand Down

0 comments on commit d4aa41e

Please sign in to comment.