mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Add columnlist:ResizeColumns
This commit is contained in:
parent
62f95614f4
commit
c5157379ae
@ -860,3 +860,29 @@ function newobject:GetColumnWidth(id)
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: ResizeColumns()
|
||||
- desc: resizes the object's columns to fit within the
|
||||
width of the object's list area
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:ResizeColumns()
|
||||
|
||||
local children = self.children
|
||||
local width = 0
|
||||
local vbody = self.internals[1]:GetVerticalScrollBody()
|
||||
|
||||
if vbody then
|
||||
width = (self:GetWidth() - vbody:GetWidth())/#children
|
||||
else
|
||||
width = self:GetWidth()/#children
|
||||
end
|
||||
|
||||
for k, v in ipairs(children) do
|
||||
v:SetWidth(width)
|
||||
self:PositionColumns()
|
||||
self.internals[1]:CalculateSize()
|
||||
self.internals[1]:RedoLayout()
|
||||
end
|
||||
|
||||
end
|
@ -285,7 +285,10 @@ function newobject:CalculateSize()
|
||||
end
|
||||
else
|
||||
if self.hbar then
|
||||
self:GetHorizontalScrollBody():Remove()
|
||||
local hbar = self:GetHorizontalScrollBody()
|
||||
hbar:Remove()
|
||||
self.itemheight = self.itemheight - hbar.height
|
||||
self.extraheight = self.itemheight - height
|
||||
self.hbar = false
|
||||
self.offsetx = 0
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user