|
|
|
@ -1664,9 +1664,7 @@ function List:setChoices(choices, selected)
|
|
|
|
|
-- Check if page_top needs to be adjusted
|
|
|
|
|
if #self.choices - self.page_size < 0 then
|
|
|
|
|
self.page_top = 1
|
|
|
|
|
elseif self.selected <= (self.page_size // 2) then
|
|
|
|
|
self.page_top = 1
|
|
|
|
|
elseif self.selected >= #self.choices - (self.page_size // 2) then
|
|
|
|
|
elseif self.page_top > #self.choices - self.page_size + 1 then
|
|
|
|
|
self.page_top = #self.choices - self.page_size + 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -1719,14 +1717,8 @@ function List:postComputeFrame(body)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local max_page_top = math.max(1, num_choices - row_count + 1)
|
|
|
|
|
|
|
|
|
|
if self.selected > num_choices - row_count then
|
|
|
|
|
self.page_top = max_page_top
|
|
|
|
|
elseif self.selected < self.page_top then
|
|
|
|
|
self.page_top = self.selected
|
|
|
|
|
else
|
|
|
|
|
self.page_top = math.max(1, self.selected - row_count + 1)
|
|
|
|
|
if self.page_top > num_choices - self.page_size + 1 then
|
|
|
|
|
self.page_top = math.max(1, num_choices - self.page_size + 1)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
update_list_scrollbar(self)
|
|
|
|
|