Skip to content

Instantly share code, notes, and snippets.

@merlight
Created August 14, 2014 14:19
Show Gist options
  • Save merlight/2abe047b24c1047d49f1 to your computer and use it in GitHub Desktop.
Save merlight/2abe047b24c1047d49f1 to your computer and use it in GitHub Desktop.
AdvancedFilters layout update
local newFilter = self:GetTabFilterInfo(inventoryType, filterTab)
if subfilterRows[newFilter] then
UpdateInventoryAnchors(self, inventoryType, ADV_FILTER_HEIGHT)
else
UpdateInventoryAnchors(self, inventoryType, 0)
end
local function UpdateInventoryAnchors(self, inventoryType, shiftY)
local layoutData = self.appliedLayout
if not layoutData then return end
local inventory = self.inventories[inventoryType]
local backpack = inventory.listView
backpack:SetWidth(layoutData.width)
backpack:ClearAnchors()
backpack:SetAnchor(TOPRIGHT, nil, TOPRIGHT, 0, layoutData.backpackOffsetY + shiftY)
backpack:SetAnchor(BOTTOMRIGHT)
ZO_ScrollList_SetHeight(backpack, backpack:GetHeight())
-- ZO_ScrollList_Commit(backpack) -- not necessary, ChangeFilter will do it later
local displayInventory = self:GetDisplayInventoryTable(inventoryType)
local sortBy = displayInventory.sortHeaders.headerContainer
sortBy:ClearAnchors()
sortBy:SetAnchor(TOPRIGHT, nil, TOPRIGHT, 0, layoutData.sortByOffsetY + shiftY)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment