update done
This commit is contained in:
@@ -112,71 +112,6 @@ function public.create(params)
|
||||
|
||||
local total_width = 0
|
||||
|
||||
local labels = {}
|
||||
for i = 1,getn(params.columns) do
|
||||
local button = CreateFrame('Button', nil, content)
|
||||
if i == 1 then
|
||||
button:SetPoint('TOPLEFT', content, 'TOPLEFT', 5, params.plain and 16 or 0)
|
||||
total_width = total_width + 5
|
||||
else
|
||||
button:SetPoint('TOPLEFT', content, 'TOPLEFT', total_width + 3, params.plain and 16 or 0)
|
||||
total_width = total_width + 3
|
||||
end
|
||||
local label = content:CreateFontString(nil, 'OVERLAY', 'GameFontHighlight')
|
||||
label:SetText(params.columns[i].title)
|
||||
local column_width = params.columns[i].width or 30
|
||||
|
||||
total_width = total_width + column_width
|
||||
button:SetWidth(column_width)
|
||||
button:SetHeight(16)
|
||||
button:SetID(i)
|
||||
button:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
|
||||
button:SetScript('OnMouseDown', function() Aux.sheet.sort(sheet, this:GetID()) end)
|
||||
button:RegisterForClicks('LeftButtonDown', 'RightButtonDown')
|
||||
|
||||
local texture = content:CreateTexture(nil, 'ARTWORK')
|
||||
texture:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
|
||||
texture:SetTexCoord(0.1, 0.8, 0, 1)
|
||||
texture:SetAllPoints(button)
|
||||
button.texture = texture
|
||||
|
||||
local sort_texture = button:CreateTexture(nil, 'ARTWORK')
|
||||
sort_texture:SetTexture([[Interface\Buttons\UI-SortArrow]])
|
||||
sort_texture:SetPoint('TOPRIGHT', button, 'TOPRIGHT', 0, 0)
|
||||
sort_texture:SetPoint('BOTTOM', button, 'BOTTOM', 0, 0)
|
||||
sort_texture:SetWidth(12)
|
||||
sort_texture:Hide()
|
||||
button.sort_texture = sort_texture
|
||||
|
||||
-- local background = content:CreateTexture(nil, 'ARTWORK')
|
||||
-- background:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
|
||||
-- -- background:SetTextCoord(0.2, 0.9, 0, 0.9)
|
||||
-- background:SetPoint('TOPLEFT', button, 'BOTTOMLEFT', 0, 0)
|
||||
-- background:SetPoint('TOPRIGHT', button, 'BOTTOMRIGHT', 0, 0)
|
||||
-- background:SetPoint('BOTTOM', content, 'BOTTOM', 0, 0)
|
||||
-- background:SetAlpha(0.2)
|
||||
|
||||
label:SetPoint('TOPLEFT', button, 'TOPLEFT', 0, 0)
|
||||
label:SetPoint('BOTTOMRIGHT', button, 'BOTTOMRIGHT', 0, 0)
|
||||
label:SetJustifyH('CENTER')
|
||||
label:SetJustifyV('CENTER')
|
||||
label:SetTextColor(0.8, 0.8, 0.8)
|
||||
|
||||
label.button = button
|
||||
label.texture = texture
|
||||
label.sort_texture = sort_texture
|
||||
label.background = background
|
||||
labels[i] = label
|
||||
|
||||
if params.plain then
|
||||
for _, obj in ipairs({button, label, texture, sort_texture, background}) do
|
||||
obj:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
total_width = total_width + 5
|
||||
params.frame:SetWidth(total_width)
|
||||
|
||||
local rows = {}
|
||||
local row_index = 1
|
||||
local max_height = content:GetHeight()
|
||||
|
||||
Reference in New Issue
Block a user