Mercurial > wow > hotcorners
comparison Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @ 11:371e14cd2feb
- major fixes with icons not showing correctly.
author | Tercio |
---|---|
date | Thu, 08 Dec 2016 13:01:40 -0200 |
parents | c31ee4251181 |
children | 3000eccbf1a0 |
comparison
equal
deleted
inserted
replaced
10:6572ed4edaae | 11:371e14cd2feb |
---|---|
1 --[[----------------------------------------------------------------------------- | 1 --[[----------------------------------------------------------------------------- |
2 TreeGroup Container | 2 TreeGroup Container |
3 Container that uses a tree control to switch between groups. | 3 Container that uses a tree control to switch between groups. |
4 -------------------------------------------------------------------------------]] | 4 -------------------------------------------------------------------------------]] |
5 local Type, Version = "TreeGroup", 37 | 5 local Type, Version = "TreeGroup", 40 |
6 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) | 6 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
7 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end | 7 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
8 | |
9 local IsLegion = select(4, GetBuildInfo()) >= 70000 | |
8 | 10 |
9 -- Lua APIs | 11 -- Lua APIs |
10 local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type | 12 local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type |
11 local math_min, math_max, floor = math.min, math.max, floor | 13 local math_min, math_max, floor = math.min, math.max, floor |
12 local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat | 14 local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat |
293 -------------------------------------------------------------------------------]] | 295 -------------------------------------------------------------------------------]] |
294 local methods = { | 296 local methods = { |
295 ["OnAcquire"] = function(self) | 297 ["OnAcquire"] = function(self) |
296 self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE) | 298 self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE) |
297 self:EnableButtonTooltips(true) | 299 self:EnableButtonTooltips(true) |
300 self.frame:SetScript("OnUpdate", FirstFrameUpdate) | |
298 end, | 301 end, |
299 | 302 |
300 ["OnRelease"] = function(self) | 303 ["OnRelease"] = function(self) |
301 self.status = nil | 304 self.status = nil |
302 for k, v in pairs(self.localstatus) do | 305 for k, v in pairs(self.localstatus) do |
332 button:SetScript("OnEnter",Button_OnEnter) | 335 button:SetScript("OnEnter",Button_OnEnter) |
333 button:SetScript("OnLeave",Button_OnLeave) | 336 button:SetScript("OnLeave",Button_OnLeave) |
334 | 337 |
335 button.toggle.button = button | 338 button.toggle.button = button |
336 button.toggle:SetScript("OnClick",Expand_OnClick) | 339 button.toggle:SetScript("OnClick",Expand_OnClick) |
340 | |
341 button.text:SetHeight(14) -- Prevents text wrapping | |
337 | 342 |
338 return button | 343 return button |
339 end, | 344 end, |
340 | 345 |
341 ["SetStatusTable"] = function(self, status) | 346 ["SetStatusTable"] = function(self, status) |
665 scrollbar:SetWidth(16) | 670 scrollbar:SetWidth(16) |
666 scrollbar:SetScript("OnValueChanged", OnScrollValueChanged) | 671 scrollbar:SetScript("OnValueChanged", OnScrollValueChanged) |
667 | 672 |
668 local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND") | 673 local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND") |
669 scrollbg:SetAllPoints(scrollbar) | 674 scrollbg:SetAllPoints(scrollbar) |
670 scrollbg:SetTexture(0,0,0,0.4) | 675 |
676 if IsLegion then | |
677 scrollbg:SetColorTexture(0,0,0,0.4) | |
678 else | |
679 scrollbg:SetTexture(0,0,0,0.4) | |
680 end | |
671 | 681 |
672 local border = CreateFrame("Frame",nil,frame) | 682 local border = CreateFrame("Frame",nil,frame) |
673 border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT") | 683 border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT") |
674 border:SetPoint("BOTTOMRIGHT") | 684 border:SetPoint("BOTTOMRIGHT") |
675 border:SetBackdrop(PaneBackdrop) | 685 border:SetBackdrop(PaneBackdrop) |