feat: add a way to pack listbox at their end
This commit is contained in:
parent
ce1b1044e8
commit
ac63e377f9
1 changed files with 2 additions and 0 deletions
|
@ -37,6 +37,7 @@ function ListBox:new(name, x, y, w, h, slotNumber)
|
|||
self.h = slotNumber * self.widgetSize.h -- On fait en sorte que la hauteur
|
||||
-- soit un multiple du nombre de slot et de leur hauteur
|
||||
self.lateralFunc = nil
|
||||
self.packAtEnd = false
|
||||
end
|
||||
|
||||
-- UPDATE FUNCTIONS
|
||||
|
@ -91,6 +92,7 @@ end
|
|||
-- draw the menu and the rest of content.
|
||||
|
||||
function ListBox:getListPart(relativeNumber)
|
||||
if (self.packAtEnd) then relativeNumber = relativeNumber + math.max(0, self.view.slotNumber - self.widget:lenght()) end
|
||||
return 0, (relativeNumber) * self.widgetSize.h, self.w, self.widgetSize.h
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue